[BUG] Desktop: "New session" from a sidebar group (or from a cloud session) silently clears the remembered project folder; next sessions start as "No folder"
Environment
- Claude Desktop 1.52386.0 (macOS 26.6, arm64), Claude Code 2.1.266
- Code tab, local sessions
What happened
The Code tab remembers the project folder for new sessions (ccd-session-store → selectedFolder).
On 2026-09-11 that value was reset to null without any folder change by me. From then on every new
session started in a scratch workspace ("No folder"), so the project's CLAUDE.md, agents and .mcp.json
were not loaded. Only 2 of ~700 sessions on this machine ever started folderless, both that afternoon,
both tagged envScopeId=builtin_local. Re-selecting the folder once fixed it and it now persists across restarts.
Cause (from reading the served bundles)
Three code paths call setSelectedFolder(null) on the ccd-session-store:
- Sidebar group header "+" (
group_new_session_clicked, custom group →Uq→Hq): clears the folder
before navigating to the composer, and the cleared value is persisted.
- "New session from current" when the current session is a cloud/remote one (
Wq:n(null)+setWorker(environment)). setHostKey()whencurrentHostKeyis still undefined (legacy state) dropsselectedFolderinstead of saving it tofolderByHost.
Because the null is written back to localStorage, the user loses the remembered folder for ALL later
sessions, not just the one created from the group / cloud session.
Expected
- Group "+" / new-from-cloud-session should prefill (or at least not persist a cleared folder) for the local host.
setHostKeywith undefinedcurrentHostKeyshould preserveselectedFolderintofolderByHost["local"].- Ideally: a visible warning before starting a session with no folder when a folder was previously remembered.
Repro
- Have a remembered local folder in the new-session composer.
- Click "+" on a custom sidebar group (or open a cloud session → New session from current).
- Go back to Home → New session: folder field is empty and stays empty until re-selected.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗