Repository navigation
Conversation
A configured indexPath replaces the scope's default index directory in every place that resolves it (indexer, watcher, background worker, auto index, MCP diagnostics, index_status). The main checkout owns the configured index and linked worktrees inherit it, so the existing inherited-index safety checks still apply. index_status now reads the runtime config, so it honours --config like the rest of the server.
|
Automated PR review Reviewed head FindingP2 — Evaluation Observed CI and limits
|
Requested by Bonny
Summary
Adds an
indexPathconfig option so a project's index can live outside the repository, for example under~/.local/share/..., while keeping per-project indexes and worktree sharing. Today the index location is fixed:<repo>/.claude/index/(or the host's equivalent) forscope: "project", or one shared global index forscope: "global". The indexer already accepts an index path override internally, but the CLI, MCP server, watcher, background worker, auto-index andindex_statuseach resolve the path themselves, so it can't be used.Changes
indexPathin the config schema: absolute or~/-prefixed, with{env:NAME}substitution.src/config/paths.ts, used by the indexer, the file watcher, the background worker, auto-index, MCP diagnostics andindex_status.scope: "project", stored paths stay root-relative, so linked worktrees that use the same configuration share the index exactly as they share.claude/index/today. The main checkout owns the index, and the existing inherited-index safety checks (no force rebuild or recovery from a linked worktree) still apply.index_statusnow reads the runtime config, so it honours--configlike the rest of the server. Previously it read the default config locations.docs/configuration.md.Testing
tests/configured-index-path.test.ts(5 tests). They fail without the change and pass with it.--configon a ~1,000-file repo with linked worktrees. The index is outside the repo, worktree changes show up through the watcher, andgit statusstays clean.npm run build:ts). The native module was not rebuilt, sincenative/is unchanged since 0.38.2 and the prebuilt 0.38.2 binary was used.npm run typecheck)npm run test:run): 3,086 passed. The 2 failures are intests/watcher-snapshot-reconciler.test.ts, which also fails intermittently on unpatchedmainon this machine (WSL2, 1 to 3 of its 10 tests per run).npm run lint)Release Labels
I can't add labels from a fork. Suggested:
feature,semver:minor.Related Issues
None. I searched issues and PRs for an index-path request first.
🤖 Generated with Claude Code