You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every repository under that a hook or scan touched has a .codemap/ directory. In at least 10 repos it shows as untracked in git status because nothing ever added it to an ignore list.
In business-skills, .codemap/agent_edits.jsonl and .codemap/status were committed, and they change on every session, so every later commit carries state churn.
codemap . on this repo counted watch/testdata five times because agent worktrees under .claude/worktrees/ are scanned; that produced a wrong before/after figure in PR feat(scanner): Skip testdata directories by default #179's original body.
The reputation this earns: "codemap leaves a lot behind."
Proposed fix
State goes somewhere the repo does not see. Prefer a per-repo directory under the user cache ($XDG_CACHE_HOME/codemap/<hash of repo root>/), or, if the in-repo location must stay, write .codemap/ into .git/info/exclude on first use so it is ignored without touching a tracked .gitignore.
codemap setup and codemap doctor report any tracked .codemap/* files and offer git rm --cached.
Ignore .claude/worktrees/ and .git/ worktree checkouts by default in the walker, alongside vendor and testdata.
Hooks must never create .codemap/ in a repo that has no codemap config and was only visited by a scan (e.g. a one-off codemap . in someone else's project).
Exit test
Fresh clone of any repo, run codemap ., run a session with hooks, then git status --porcelain is empty and codemap . file counts match git ls-files | wc -l modulo ignore rules.
Symptoms, measured 2026-09-04 on one machine
.codemap/directory. In at least 10 repos it shows as untracked ingit statusbecause nothing ever added it to an ignore list.business-skills,.codemap/agent_edits.jsonland.codemap/statuswere committed, and they change on every session, so every later commit carries state churn.codemap .on this repo countedwatch/testdatafive times because agent worktrees under.claude/worktrees/are scanned; that produced a wrong before/after figure in PR feat(scanner): Skip testdata directories by default #179's original body.Proposed fix
$XDG_CACHE_HOME/codemap/<hash of repo root>/), or, if the in-repo location must stay, write.codemap/into.git/info/excludeon first use so it is ignored without touching a tracked.gitignore.codemap setupandcodemap doctorreport any tracked.codemap/*files and offergit rm --cached..claude/worktrees/and.git/worktree checkouts by default in the walker, alongsidevendorandtestdata..codemap/in a repo that has no codemap config and was only visited by a scan (e.g. a one-offcodemap .in someone else's project).Exit test
Fresh clone of any repo, run
codemap ., run a session with hooks, thengit status --porcelainis empty andcodemap .file counts matchgit ls-files | wc -lmodulo ignore rules.Related: #179, #183, #172.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TcyheQmM3HCvxF5wRL3s5t