claude-code - 💡(How to fix) Fix BUG: Model persistently capitalizes Linux username in paths despite explicit CLAUDE.md rule (regression of #27777) [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51672Fetched 2026-04-22 07:55:58
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×5commented ×2

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:

  1. The auto-memory system prompt injects the wrong capitalised path (as described in #27777)
  2. 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

Root Cause

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:

  1. The auto-memory system prompt injects the wrong capitalised path (as described in #27777)
  2. 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
RAW_BUFFERClick to expand / collapse

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:

  1. The auto-memory system prompt injects the wrong capitalised path (as described in #27777)
  2. 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

  1. Have a Linux user whose username is all-lowercase (e.g. Ferenc).
  2. Add a rule to ~/.claude/CLAUDE.md explicitly stating the username is lowercase and that the capital-letter variant must never be used.
  3. Ask Claude to perform any file operation or spawn a subagent involving paths under the home directory.
  4. 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

extent analysis

TL;DR

The issue can be mitigated by ensuring that the username casing is consistently handled across all components, including subagents, and that the global CLAUDE.md rules are properly applied.

Guidance

  • Review the CLAUDE.md file to ensure the rule for lowercase username is correctly formatted and prioritized.
  • Verify that the subagent spawned via the Agent tool is properly configured to inherit or respect the global CLAUDE.md rules.
  • Investigate if there's a caching or persistence issue causing Claude to remember and reuse the incorrect capitalised path despite corrections.
  • Consider adding additional logging or debugging to understand how Claude generates and uses file paths in its operations.

Example

No specific code snippet can be provided without more details on the implementation, but ensuring consistent casing in file paths can be achieved by using string normalization techniques or path construction functions that respect the specified casing rules.

Notes

The issue seems to stem from a combination of factors including how Claude handles casing in file paths, how it applies global rules to subagents, and possibly a caching or memory issue. Without direct access to the code or more detailed logs, pinpointing the exact cause is challenging.

Recommendation

Apply workaround: Implement a temporary solution to enforce consistent casing in file paths, such as manually correcting the paths in tool calls or adding an intermediate step to normalize path casing before they are used by Claude or its subagents. This is recommended because it directly addresses the observed behavior and can provide immediate relief while a more permanent fix is developed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix BUG: Model persistently capitalizes Linux username in paths despite explicit CLAUDE.md rule (regression of #27777) [2 comments, 2 participants]