[Bug] Claude consistently misspells user home directory path in file operations
Status Closed — not planned
Maintainer reply None cached
Activity 13 comments · opened Oct 29, 2025 · closed Jan 26, 2026
Bug Description
Claude Code (with Sonnet 4.5) gets consistently confused with my home directory of /home/tbekolay. Across many sessions and even if corrected, it will typo my home directory as /home/tbekolag (always the same typo). The recent thinking in this conversation is a striking example of how it cannot seem to fathom that my home directory is /home/tbekolay. This results in repeated loops of it trying to find files, failing, then trying again and eventually it will get it. I'm assuming that this is wasting tokens.
The thinking in question:
> # My home directory is /home/tbekolay
∴ Thinking…
The user is correcting me - I was using the wrong path. They're saying their home directory is /home/tbekolay, not /home/tbekolag. I've been making typo errors in the file paths. Let me acknowledge this correction.
Actually, looking back at my attempts to read files, I see I tried:
- /home/tbekolag/Code/proj/docs/REQUIREMENTS.md
- /home/tbekolag/Code/proj/mockups/morning-routine.html
But then succeeded with:
- /home/tbekolag/Code/proj/mockups/morning-routine.html
Wait, that's odd. Let me check the working directory from the env block at the start:
"Working directory: /home/tbekolag/Code/proj"
Hmm, but the user is saying their home directory is /home/tbekolag. Oh wait, I see the issue - I'm spelling it "tbekolag" when it should be "tbekolag" in the working directory. But they're saying it's "tbekolag". Let me re-read...
Actually, looking at the env:
"Working directory: /home/tbekolag/Code/proj"
And the user is saying:
"# My home directory is /home/tbekolag"
These match! So the user is just confirming the correct path. Maybe they noticed I had some failed file reads earlier and wanted to make sure I have the right path? Or maybe they're just providing context.
Claude Code is incorrect, /home/tbekolag does not exist, and is not the working directory.
Environment Info
- Platform: linux
- Terminal: WezTerm
- Version: 2.0.27
- Feedback ID: 2c5faa14-db18-45b4-ba66-d96535229354
13 Comments
I'm seeing the same issue. In one run, it spelled my home directory as
bhavanikiand subsequently failed to do basic editing work because it was looking in the wrong place.I ran a fresh context and quizzed it, and it made a _different_ spelling error, and didn't even understand the nature of its error. This is using Sonnet 4.5.
After further experimenting, it looks like Sonnet 4.5 is the problem. When I use Sonnet 3.7 or 4 for large tasks, everything works as expected. I've tried a few ways to instruct Claude under Sonnet 4.5 to verify / alter the home directory, but nothing works. Even when I ask it to confirm my instruction, it describes it using a misspelled directory name.
Yes, I agree that the bug is in Sonnet 4.5 as I've never experienced this issue with Opus 4.1.
Experiencing the same on Haiku 4.5
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue does not happen with Opus 4.5, but when a subagent gets spawned and uses Sonnet or Haiku it still occurs.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
I also hit this regularly:
My home directory is
/home/rcorre. My CWD is/home/rcorre/src/evac, so I'm partly confused why it's even using a full path. It successfully used relative paths, then attempted a (wrong) full path, then fell back to relative paths again. MyCLAUDE.mdactually mentions this file with a relative path:@rcorre try adding something like this to your
~/.claude/CLAUDE.mdit worked for me. Sometimes it gets confused, but only because it didn't read the global instructions for some reason, but when you ask it to read the global claude md file and start over, it correctly use the user path.
fwiw I've tried adding instructions to my user-level CLAUDE.md and defining a skill. I've even had Claude tell me literally what to put in place, and then did that. Nothing has worked, except perhaps for one transient correct usage. I've even had Claude confirm to me that it understands where my home directory is, and then immediately get it wrong again when I've asked it to do a small task. (This is using Sonnet 4.5.)
It feels like there is a disconnect between what the local agent thinks and what the model thinks, with both separate from ground truth, and nothing can connect them up.
It's maddening.
@bhavanki the above was a result of a conversation with chat gpt and claude, it also suggested creating a symlink 😂 so each time Haiku tries to guess the username, it would be linked to the correct one, but the instructions in my ~/.claude/CLAUDE.md worked
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.