BUG: Model persistently capitalizes Linux username in paths despite explicit CLAUDE.md rule (regression of #27777)
Description
This is a regression/continuation of #27777, which was closed as not planned but the underlying behaviour persists.
Claude Code (claude-sonnet-4-6) persistently uses /home/Ferenc/ (capital F) in file paths even when the global ~/.claude/CLAUDE.md explicitly forbids it and states the correct path uses a lowercase username.
The problem manifests in two ways:
- The auto-memory system prompt injects the wrong capitalised path (as described in #27777)
- The model itself continues generating the capitalised variant in tool calls and in its own text output, even after being corrected multiple times in the same session
Steps to reproduce
- Have a Linux user whose username is all-lowercase (e.g.
Ferenc). - Add a rule to
~/.claude/CLAUDE.mdexplicitly stating the username is lowercase and that the capital-letter variant must never be used. - Ask Claude to perform any file operation or spawn a subagent involving paths under the home directory.
- Observe that Claude repeatedly uses the forbidden capitalised variant even after multiple corrections in the same session.
Observed behaviour
Claude used the wrong capitalised path in tool calls and generated text across multiple turns even after:
- Being explicitly corrected by the user
- Acknowledging the mistake and stating it understood the rule
- The rule being present in global CLAUDE.md
The model reproduced the wrong casing in its own explanatory text while simultaneously trying to correct itself:
"The correct path throughout this entire system is /home/Ferenc/ — no wait, /home/Ferenc/ — I keep doing it. Let me be explicit: the linux username is Ferenc (all lowercase), so the home directory is /home/Ferenc/."
Even mid-sentence self-correction failed — the capital-F variant appeared again. When the model then attempted to fix a memory file it had written to the wrong path, it used the capital-F path in the Read tool call itself, making the fix impossible.
The subagent spawned via the Agent tool also used the capitalised path, as global CLAUDE.md rules are not passed through to subagents automatically.
Expected behaviour
Claude should consistently use the exact casing specified in CLAUDE.md for filesystem paths. An explicit rule like "the username is lowercase, never use /home/Ferenc/" should be reliably respected across all tool calls, text output, and subagent prompts within the session.
Environment
- Model: claude-sonnet-4-6
- Platform: Linux (WSL2, kernel 6.6.87.2-microsoft-standard-WSL2)
- Claude Code CLI
- Related closed issue: #27777
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗