Allow switching session working directory at runtime (especially painful in desktop app)
Resolved 💬 2 comments Opened May 18, 2026 by daberni Closed May 18, 2026
Problem
There is currently no way to change the session's primary working directory once Claude Code has been started. The Bash tool resets cwd between calls, so cd only affects a single command. The only workaround is to exit and relaunch Claude Code from the desired directory.
This is mildly annoying in the terminal CLI, but significantly worse in the desktop app, where restarting the session in a different directory is more cumbersome than just opening a new terminal tab.
Common scenarios where this hurts
- Switching to a git worktree spun up mid-session (e.g.
~/.agents/worktrees/<project>/<branch>) - Hopping between sibling projects in a multi-repo workspace
- Following a user request like "now work in
path/to/other/repo" — currently requires either prefixing every Bash call withcd …or losing the conversation context by restarting
Proposal
A first-class way to rebase the session's working directory at runtime, e.g.:
- A slash command like
/cd <path>(or/cwd <path>) - An MCP/agent-facing tool the assistant can call when the user explicitly asks to switch directories
- Desktop app: a directory picker in the session header to change cwd without restarting
The change should update:
- The default cwd used by
Bashand any tool that resolves relative paths - The "Primary working directory" context shown to the model
- Any cached git status / repo metadata derived from cwd
Workarounds today
- Prefix every Bash call with
cd <abs-path> &&— verbose, easy to forget - Always pass absolute paths to Read/Edit/Write — works but loses ergonomics
- Restart the session — loses conversation context
🤖 Filed via Claude Code
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗