claude-code - 💡(How to fix) Fix Allow switching session working directory at runtime (especially painful in desktop app)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

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.

Workarounds today

RAW_BUFFERClick to expand / collapse

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 with cd … 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 Bash and 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Allow switching session working directory at runtime (especially painful in desktop app)