[FEATURE] Desktop: New session should inherit the focused session's folder, not the global last-used folder
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
In the Desktop app's Code tab, a new session created with Ctrl+N does not open in the folder of the session I am looking at. It opens in the last-used folder, tracked globally rather than per session.
So while working in project A, if the most recently used folder is B, Ctrl+N gives me a session in B. The session I had open and in focus, in the project I am actually working on, does not determine the new session's scope. Every new session in a multi-repo day therefore starts with a folder correction.
This is specifically about which folder is chosen by default, not about the picker being ignored once I use it.
Proposed Solution
Resolve the working directory for a new session in this order:
- The working folder of the currently focused session, when one is open.
- The existing global last-used folder, as the fallback when no session is focused (app just launched, all sessions closed).
The folder picker keeps working as an explicit override, so nothing is taken away — this only changes which folder is pre-filled.
Alternative Solutions
Changing the folder manually after each Ctrl+N is the current path. It is slow enough to shape behavior: It discourages spinning up a session per task, which is the main thing the Code tab's parallel sessions are good for. It also currently drops keyboard focus from the composer, so the correction costs a mouse round trip as well.
A configurable default project directory would not solve this. The right folder is not a fixed preference, it is context — whichever project I am in at the moment.
Additional Context
Both Codex and OpenCode scope a new session to the current project this way, and it is a meaningful part of why session creation feels cheap there: You stay in a project and open as many sessions against it as the work needs.
Closed prior reports in the same area, listed for triage. Each is distinct from this request, and all four were closed by lifecycle automation as not_planned with the standard invitation to file again if still relevant:
- #49888 — a new session opens in the last-used directory instead of the one explicitly selected during creation. That is the explicit override being lost; this request is about the default being drawn from the wrong scope. Fixing #49888 alone would still leave a folder correction on every new session.
- #60448 — the inherited folder is pinned to new sessions with no way to clear it. Reports that the app takes the
cwdfrom the most recently active session file, which matches the behavior described here. - #67249 — cache recent directories in the new-session folder picker. Makes the correction faster rather than unnecessary.
- #62843 — change the working directory within an already-running session.
Also related: #70032 (a defaultProjectDirectory setting) was auto-closed as a duplicate of #44933, which is Cowork-scoped.
Claude Code Version
2.1.247
Platform
Claude Code Desktop app (Code tab)
Operating System
Windows 11