[BUG] Claude doesn't know in what directory it was opened, leading to reading files from generic path: /home/user/...

Resolved 💬 2 comments Opened Apr 12, 2026 by johnib Closed May 24, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

As can be seen in the picture below, a new conversation (in SIMPLE mode), asking a simple question just for the repro - leading Claude to read some files from the repo.

The problem is that Claude doesn't know where it was opened in, in this case: ~/repos/some-api.
Instead, Claude tries to ls files on: /home/user leading to read permission request.

Only when Claude learns what is the working directory, then it continues to work properly.

<img width="590" height="233" alt="Image" src="https://github.com/user-attachments/assets/019d35a8-17cc-411d-a1ee-766f40cefc10" />

  1. I tried reverting back to an older version (v.92) which still has this issue.
  2. It happens on the latest version too (v.104).
  3. My work computer has Claude with (v.92) which does not suffer from this behavior (this is why I reverted back to this version on the problematic computer)
  4. I tried SIMPLE mode too, still happens (CLAUDE_CODE_SIMPLE=1), still did not help.
  5. I reviewed my CLAUDE.md file - the issue is not there.

What Should Happen?

Claude should be aware of the working directory, and avoid going out of it for simple tasks such as in the picture.
The PWD is specified in the system prompt.

Error Messages/Logs

Steps to Reproduce

as in the picture.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.104

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗