New session always opens in last used project directory instead of selected one
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 4 comments · opened Apr 17, 2026 · closed May 25, 2026
Bug Report
Version: Claude Code Desktop App
OS: Windows 11 with WSL2 (Ubuntu)
Description
When creating a new session in the Claude Code desktop app, the session always opens in the last used project directory (e.g. npm-jpcore) regardless of which directory is selected or added during session creation.
Steps to Reproduce
- Have an existing project open (e.g.
npm-jpcore) - Click "New session"
- Add/select a different directory (e.g.
/home/dev/temp/santa1) - Confirm session creation
Expected Behavior
The new session should open in the newly selected directory (/home/dev/temp/santa1).
Actual Behavior
The new session opens in the previously used project directory (npm-jpcore) instead of the one selected.
Impact
It is impossible to start a session on a directory other than the last used project from the desktop app UI. The only workaround is to run claude from the terminal inside the target directory.
4 Comments
This looks like a race condition between persisted last-directory state and the new-session directory parameter being processed.
When "New session" is clicked, there are likely two sources for the working directory: (1) a persisted value from the previous session stored in app state or a config file, and (2) the directory selected/added during session creation. If the selected directory is processed asynchronously and the persisted value wins the initial state merge, you get the behavior you're describing — the new session inherits the old project's directory regardless of what was selected.
The specific WSL2 dimension matters here: The Windows desktop app communicates the directory selection to the WSL2-side process via some IPC path (probably a flag or environment variable passed to the shell). If that IPC value arrives after the shell has already initialized its working directory from the persisted config, the selected directory gets ignored.
To confirm the race theory: Try adding a 1-2 second delay after selecting the new directory before confirming session creation. If the new session opens in the correct directory with the delay, the IPC is winning when given time.
Expected fix: The session creation flow should pass the selected directory as a first-class argument to the new session process, and the WSL2-side initialization should treat an explicit argument as authoritative, overriding any persisted last-directory value. Persisted state should only apply when no explicit directory is provided.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This happens on MacPro as well
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.