[BUG] Agent still misspells .claude -> .claire creating stray dir on v2.1.169 (recurrence of #31493 / #31984)
Filing per the lock-bot guidance on #31984 ("please file a new issue and reference this one"). This is a still-reproducing recurrence of #31493 and #31984 (both closed + locked, March 2026, reported on v2.1.71). It is not fixed on the current v2.1.169.
What happened
During an Agent worktree-isolation session, a subagent's Write tool wrote to:
.claire/worktrees/<branch>/tests/unit/<file>.py
instead of:
.claude/worktrees/<branch>/tests/unit/<file>.py
The misspelled .claude -> .claire path silently created the entire .claire/ directory tree, because Write auto-creates parent directories. The session even noticed ?? .claire/ in git status, talked itself out of it ("could be a cosmetic typo"), and moved on without cleaning up.
Downstream harm (not purely cosmetic)
Because .claire/ is not in any default .gitignore, the stray directory sat untracked for ~3 weeks. It was then nearly committed when a later git add -A swept it into staging alongside real work. So this can leak a junk directory into commits, not just clutter git status.
Steps to reproduce
- Run an Agent / subagent flow with
isolation: "worktree"(or any worktree-based workflow). - After the session, run
git status. - Observe
.claire/listed as untracked, containing files that were meant to land under.claude/.
Suggested fixes
- Normalize/validate the
.claudeliteral in the worktree +Writepath handling so the.clairemisspelling can't reach the filesystem. - And/or add
.claire/to the default ignore set and emit a warning when it is created.
Environment
- Claude Code 2.1.169
- macOS
- Anthropic API
References: #31493, #31984, #38589