claude-code - 💡(How to fix) Fix Windows Desktop App: File → Open Folder doesn't switch the working directory for new chat sessions [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#52165Fetched 2026-04-23 07:34:54
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

Error Messages/Logs

No error messages

Fix Action

Fix / Workaround

Primary working directory stays pinned to D:\ProjectAlpha D:\ProjectAlpha\CLAUDE.md and its memory folder auto-load into the new chat D:\ProjectBeta only appears as an additional working directory, not the primary Workarounds tried (none worked)

Code Example

No error messages
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Environment

OS: Windows 11 Pro Claude Code Desktop App version: [fill in — check Help → About in the app] Two project roots: D:\ProjectAlpha and D:\ProjectBeta, each with its own CLAUDE.md Steps to reproduce

Launch the Claude Code Desktop App with project A loaded (D:\ProjectAlpha). Without closing the app, use File → Open Folder and pick a different project (D:\ProjectBeta). Start a new chat / session. Expected

Primary working directory = D:\ProjectBeta Only D:\ProjectBeta\CLAUDE.md auto-loads Memory loads from C:\Users<user>.claude\projects\D--ProjectBeta\memory
Actual

Primary working directory stays pinned to D:\ProjectAlpha D:\ProjectAlpha\CLAUDE.md and its memory folder auto-load into the new chat D:\ProjectBeta only appears as an additional working directory, not the primary Workarounds tried (none worked)

Fully closing the app window and relaunching Picking Open Folder before starting a new chat /exit and Ctrl+D do nothing in the app's chat input Impact

Can't cleanly switch between projects. Old project's CLAUDE.md + memory "leak" into the new project's context, which is confusing and wastes tokens. Particularly bad when each project has strict scope rules about which folder can be written to.

What Should Happen?

Proposed correct behavior

When a user picks File → Open Folder and then starts a new chat, the app should treat that folder as the primary working directory for that new session. Specifically:

Primary working directory The new session's "Primary working directory" (shown in the environment block / status area) = the folder just opened. Any previously opened folders drop off, or at most get demoted to "Additional working directories" the user can explicitly re-add. CLAUDE.md loading Only the CLAUDE.md at the root of the newly opened folder is auto-loaded. CLAUDE.md files from previously opened projects do not leak into the new session. Memory folder Memory auto-loads from C:\Users<user>.claude\projects<hash-of-new-folder>\memory. The old project's memory index (MEMORY.md) and its referenced memory files are not loaded. UI clarity The app's title bar or status area clearly shows the active primary folder's name/path, so a user can confirm at a glance which project is loaded. If the user wants to keep a secondary folder accessible (read-only reference to another project), there should be an obvious way to add it as an "additional working directory" — but that should be opt-in, not the default. Existing chats are unaffected Switching folders applies only to new chats going forward. Any open chat that was started in the old folder keeps its original primary directory (so in-progress work isn't disrupted). Session handoff clarity If the user picks Open Folder while a chat is active, the app could show a prompt: "This will apply to your next chat. Start a new chat now?" — making the behavior explicit rather than silent.

Error Messages/Logs

No error messages

Steps to Reproduce

Prerequisites

Windows 11 with the Claude Code Desktop App installed. Create two separate project folders, each with a distinctive CLAUDE.md: D:\ProjectAlpha\CLAUDE.md — contains a line like # PROJECT ALPHA — this should load when ProjectAlpha is active D:\ProjectBeta\CLAUDE.md — contains a line like # PROJECT BETA — this should load when ProjectBeta is active Confirm each folder has its own memory directory already in use: C:\Users<user>.claude\projects\D--ProjectAlpha\memory\MEMORY.md C:\Users<user>.claude\projects\D--ProjectBeta\memory\MEMORY.md Reproduction

Launch the Claude Code Desktop App from a cold start (no existing session). The app opens with D:\ProjectAlpha as the primary working directory (this was the last-used project). Start a new chat. Ask the agent something like "What CLAUDE.md and memory files are currently loaded?" — confirm it lists D:\ProjectAlpha\CLAUDE.md and the ProjectAlpha memory folder. This is correct. Without closing the app or exiting the chat, go to File → Open Folder and select D:\ProjectBeta. Observe that the app's window content updates to show D:\ProjectBeta in the file tree / sidebar. Start a new chat (click New Chat or equivalent). In the new chat, ask "What is your primary working directory? Which CLAUDE.md and memory files are loaded?" Observed result

The agent reports primary working directory = D:\ProjectAlpha (the OLD folder). It says D:\ProjectAlpha\CLAUDE.md is loaded. It says the ProjectAlpha memory folder is loaded. D:\ProjectBeta shows up only as an additional working directory, not the primary. Expected result

Primary working directory = D:\ProjectBeta. Only D:\ProjectBeta\CLAUDE.md is auto-loaded. Memory auto-loads from the D--ProjectBeta folder. D:\ProjectAlpha is not referenced at all. Additional attempts that also fail 7. Fully close the app (including any tray icon), relaunch, pick File → Open Folder → D:\ProjectBeta before starting any chat, then start a new chat. Same wrong result — ProjectAlpha still loads as primary. 8. Typing /exit or pressing Ctrl+D in the chat input does nothing (doesn't close the chat or allow a clean session restart).

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Prerequisites Windows 11 with the Claude Code Desktop App installed. Create two separate project folders, each with a distinctive CLAUDE.md: D:\ProjectAlpha\CLAUDE.md — contains a line like # PROJECT ALPHA — this should load when ProjectAlpha is active D:\ProjectBeta\CLAUDE.md — contains a line like # PROJECT BETA — this should load when ProjectBeta is active Confirm each folder has its own memory directory already in use: C:\Users<user>.claude\projects\D--ProjectAlpha\memory\MEMORY.md C:\Users<user>.claude\projects\D--ProjectBeta\memory\MEMORY.md Reproduction Launch the Claude Code Desktop App from a cold start (no existing session). The app opens with D:\ProjectAlpha as the primary working directory (this was the last-used project). Start a new chat. Ask the agent something like "What CLAUDE.md and memory files are currently loaded?" — confirm it lists D:\ProjectAlpha\CLAUDE.md and the ProjectAlpha memory folder. This is correct. Without closing the app or exiting the chat, go to File → Open Folder and select D:\ProjectBeta. Observe that the app's window content updates to show D:\ProjectBeta in the file tree / sidebar. Start a new chat (click New Chat or equivalent). In the new chat, ask "What is your primary working directory? Which CLAUDE.md and memory files are loaded?" Observed result The agent reports primary working directory = D:\ProjectAlpha (the OLD folder). It says D:\ProjectAlpha\CLAUDE.md is loaded. It says the ProjectAlpha memory folder is loaded. D:\ProjectBeta shows up only as an additional working directory, not the primary. Expected result Primary working directory = D:\ProjectBeta. Only D:\ProjectBeta\CLAUDE.md is auto-loaded. Memory auto-loads from the D--ProjectBeta folder. D:\ProjectAlpha is not referenced at all. Additional attempts that also fail 7. Fully close the app (including any tray icon), relaunch, pick File → Open Folder → D:\ProjectBeta before starting any chat, then start a new chat. Same wrong result — ProjectAlpha still loads as primary. 8. Typing /exit or pressing Ctrl+D in the chat input does nothing (doesn't close the chat or allow a clean session restart).

Platform

Other

Operating System

Windows

Terminal/Shell

Other

Additional Information

No response

extent analysis

TL;DR

The issue can be addressed by implementing a mechanism to update the primary working directory when a new folder is opened via File → Open Folder, ensuring that only the newly opened folder's CLAUDE.md and memory files are loaded for new chats.

Guidance

  • The problem seems to stem from the application not properly updating its internal state when a new folder is opened, leading to the previous project's settings being retained.
  • To fix this, the application should be modified to reset its working directory and loaded files (CLAUDE.md and memory) when a new folder is selected through File → Open Folder.
  • The application should also provide a clear indication of the current primary working directory, possibly through the title bar or status area, to help users confirm which project is currently active.
  • Consider adding an option for users to explicitly add additional working directories, making it an opt-in feature rather than the default behavior.

Example

No specific code example can be provided without knowing the application's codebase, but the fix would involve updating the application's logic for handling folder changes and chat sessions.

Notes

The exact implementation details may vary depending on the application's architecture and technology stack. Ensuring that existing chats are not affected by the folder change is crucial to prevent disruption of in-progress work.

Recommendation

Apply a workaround by fully closing the application, including any system tray icons, and then relaunching it before opening a new project folder. However, a proper fix would require modifying the application's source code to correctly handle folder changes and session management.

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