Can no longer tell Claude to change its working directory mid-session (regression)
Note: This supersedes #42837, which was filed with an inaccurate description. I cannot edit or close that issue.
Description
It used to be possible to tell Claude Code to change its working directory mid-session (e.g., "change dir to ~/") and it would update the session's working directory for all tools — Bash, Read, Glob, Grep, Edit, etc. This no longer works.
Now when Claude attempts to change directories via the Bash tool, the session cwd is immediately reset back to the project root with the message:
Shell cwd was reset to /Users/.../original-project-root
All subsequent tool calls continue to operate from the original project directory regardless.
How It Used to Work
- User tells Claude: "change dir to ~/" (or any path)
- Claude runs
cd ~/ && pwdvia Bash - The Claude Code harness detects the new cwd and updates the session's working directory
- All subsequent tool calls (Read, Glob, Grep, Bash, etc.) resolve paths from the new directory
This is confirmed by 51+ instances across my past conversation logs where this behavior worked correctly with the same configuration.
Current Behavior
- User tells Claude: "change dir to ~/"
- Claude runs
cd ~/ && pwd— output shows/Users/username - Immediately:
Shell cwd was reset to /Users/.../original-project-root - All subsequent tool calls remain in the original project directory
- The directory change does not take effect
Expected Behavior
Per the official docs (Bash tool behavior):
"Working directory persists across commands. Set CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1 to reset to the project directory after each command."
The default should be persistence — the env var is the opt-in to reset. CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR is not set in my environment.
Environment
- OS: macOS (Darwin 25.3.0)
- Claude Code: Latest version
- Shell: zsh
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR: Not set- Custom
statusLine: Yes — but was also present in prior sessions where changing directories worked fine
Relationship to #31471
May be related to #31471 (statusLine resetting cwd), but the key difference: this is a regression. The same statusLine config was in place when this capability worked. Something in a recent update broke the ability to tell Claude "switch to a different directory" and have the entire session context move there.
Impact
This breaks a core workflow — switching between project directories mid-conversation. Users who work across multiple repos or need to navigate to different locations must restart Claude Code from the target directory, or manually prefix every command with cd /path &&.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗