This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A VS Code extension that adds customizable aliases and tooltips to files/folders in the explorer tree. Aliases are stored in JSON config files (folder-alias.json / private-folder-alias.json) at the workspace root or .vscode/ directory.
pnpm build # Build with tsdown → dist/index.cjs
pnpm dev # Build in watch mode with sourcemaps
pnpm lint # ESLint (antfu config, double quotes, semicolons)
pnpm typecheck # tsc --noEmit
pnpm test # vitest
pnpm pack # Package .vsix (no dependencies bundled)The extension uses reactive-vscode for lifecycle and reactive state management.
Entry (src/index.ts): defineExtension iterates workspace folders, creates a useFileAlias instance per folder, and registers commands.
Core flow:
src/file-alias.ts—useFileAlias()wires up aFileSystemWatcher(viauseFileSystemWatcher) on the workspace folder to detect config file changes, creates aFileDecorationProviderthat reads merged config to supply badges/tooltips, and exposes an event emitter for decoration updates.src/hooks/useConfig.ts—useConfig()loads public and private JSON configs into reactiverefs, providesresetConfig()(re-read from disk), andsavePublic()/savePrivate()(write back, preferring.vscode/location if the file already exists there).src/utils/file.util.ts— Low-level file I/O: reads config with.vscodepriority over root, writes JSON withdestrfor safe parsing.src/command/add-alias.command.ts— Prompts user for scope (public/private) and alias text via QuickPick + InputBox, updates the appropriate config ref, saves, and fires the decoration change event.src/command/refresh-aliases.command.ts— Re-reads both config files from disk.
Generated code: src/generated/meta.ts is auto-generated by vscode-ext-gen (runs during pnpm install via the prepare script). Do not edit manually.
- Build tool:
tsdown(outputs CJS todist/index.cjs;package.jsonmain must match) - Linting:
@antfu/eslint-configwithstylistic(double quotes, semicolons) and JSONC support - Reactive primitives (
ref,computed,useCommand,useFileSystemWatcher,defineLogger) come fromreactive-vscode - The
vscodemodule is externalized at build time (never bundled)
This project enforces Conventional Commits via commitlint and husky. Every commit message MUST follow this format:
<type>(<scope>): <subject>
<body>
<footer>
Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
Rules:
- The subject line MUST start with a type followed by
:(e.g.,feat: add new feature) - The
scopeis optional but must be in parentheses after the type (e.g.,fix(config): fix .vscode path) - The body is optional but MUST be separated from the subject by a blank line
- The footer is optional but MUST be separated from the body by a blank line
- The commit-msg hook will REJECT any commit that does not follow this convention
- ALL commits, including those made by Claude Code, must pass commitlint validation
Examples:
feat: add delete alias command
fix: decode URI-encoded path segments
docs: update README with current architecture
refactor: simplify findInstanceByUri with es-toolkit maxBy
build: add changelogen and configure release flow
chore(release): v1.0.3