[BUG] claude frequently changes current dir and then it forgets where it is!
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?
claude frequently changes current dir and then it forgets where it is! I can see this because I see it trying to read files with a relative path and it fails to read them, then moments later it reads successfully with the correct path, or it has changed dir again.
This business of changing dirs and forgetting what is cwd is very frustrating. I am sure that it costs us tokens.
Why change dirs at all? Why not stay in the same dir for the whole session and always use correct paths?
What Should Happen?
Claude should never change dirs it should remain in startup dir and use correct file paths and avoid waisting tokens.
Error Messages/Logs
Steps to Reproduce
use claude in a project, make lots of mods, eventually you'll run into this.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.22
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗