.claude/ isn't in this repo's .gitignore, and .claude/worktrees/ already exists here as an empty directory. That combination is a live fuse rather than a theoretical one.
Without the ignore entry, all of these are demonstrated behaviour, not guesses:
git add -A in the main checkout stages a nested worktree as an embedded gitlink — the broken-submodule shape — not as files. One careless git add -A while a worktree is populated puts it in history.
rg --hidden walks into another agent's in-progress worktree and duplicates every match, including anything secrets-shaped. The ignore entry suppresses it, because ripgrep respects gitignore. find never does.
git clean -fd and git stash -u skip a nested worktree, but git clean -ffd deletes it.
Fix is one line in .gitignore:
I've appended it to this clone's .git/info/exclude as a local mitigation so nothing can fire today, but that's unshared and doesn't protect a second clone or another contributor. The committed line is the actual fix.
Shape file: standards/worktrees.md in codeswhat-ops, which also carries the rest of the worktree target state and this repo's measured drift.
.claude/isn't in this repo's.gitignore, and.claude/worktrees/already exists here as an empty directory. That combination is a live fuse rather than a theoretical one.Without the ignore entry, all of these are demonstrated behaviour, not guesses:
git add -Ain the main checkout stages a nested worktree as an embedded gitlink — the broken-submodule shape — not as files. One carelessgit add -Awhile a worktree is populated puts it in history.rg --hiddenwalks into another agent's in-progress worktree and duplicates every match, including anything secrets-shaped. The ignore entry suppresses it, because ripgrep respects gitignore.findnever does.git clean -fdandgit stash -uskip a nested worktree, butgit clean -ffddeletes it.Fix is one line in
.gitignore:.claude/I've appended it to this clone's
.git/info/excludeas a local mitigation so nothing can fire today, but that's unshared and doesn't protect a second clone or another contributor. The committed line is the actual fix.Shape file:
standards/worktrees.mdin codeswhat-ops, which also carries the rest of the worktree target state and this repo's measured drift.