[Feature Request] Working directory should be agent/task-specific, not session-bound
Bug Description
Working directory should be attached to the agent, not the session (multi-worktree confusion)
I work in one repo with three git worktrees (main checkout plus two siblings), running Claude Code inside GNU screen and switching between Claudes with the agent view. The working directory is stamped on a session at launch and can never change, so the agent view ends up being a switcher between invisible places: if I'm standing in worktree B in my shell and use the agent view to switch to a Claude that was launched from worktree A, I'm now silently operating in worktree A. Which worktree I'm in is determined by which session I happen to select, not by where I am or what task I'm doing.
It feels like the working directory should be a property of the agent/task rather than the session, or at minimum be re-anchorable and prominently visible when switching. With multiple worktrees, the current behavior means the wrong-worktree state is decided at launch time and there's no way to correct it mid-session, so work keeps landing on the wrong branch. Stacked multiplexers (screen on the outside, the agent view inside) make it worse because neither layer surfaces where a session is actually anchored.
What I'd want: either let each agent/task carry its own working directory, or make the session's anchor directory and git branch a first-class, always-visible part of the agent view so switching sessions is never a silent teleport.
Environment Info
- Platform: darwin
- Terminal: xterm-256color
- Version: 2.1.222
- Feedback ID: ee3cbe86-4887-4cc8-9011-81aefc3f28e8
Errors
[]