[BUG] workingDirectory not updated on "! cd <dir>"
Resolved 💬 2 comments Opened May 3, 2026 by corby Closed Jun 1, 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?
The MCP client (Claude Code) sends a stale workingDirectory in _meta when calling MCP tools. If you start a session in repo A then cd to repo B, the MCP tools still think you're in repo A. This causes auto-detection of repo and head to return values from repo A.
What Should Happen?
Claude should pass the working directory of the current repo to the MCP
Error Messages/Logs
Steps to Reproduce
- start claude in a repo
- ! cd<repoB>
- call an MCP method and print the workingDir inside of it
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.126 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗