[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"

Status Open
Reported on v2.1.266
Maintainer reply None cached
Activity 1 comment · opened Sep 11, 2026

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-storeselectedFolder).
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:

  1. Sidebar group header "+" (group_new_session_clicked, custom group → UqHq): clears the folder

before navigating to the composer, and the cleared value is persisted.

  1. "New session from current" when the current session is a cloud/remote one (Wq: n(null) + setWorker(environment)).
  2. setHostKey() when currentHostKey is still undefined (legacy state) drops selectedFolder instead of saving it to folderByHost.

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.
  • setHostKey with undefined currentHostKey should preserve selectedFolder into folderByHost["local"].
  • Ideally: a visible warning before starting a session with no folder when a folder was previously remembered.

Repro

  1. Have a remembered local folder in the new-session composer.
  2. Click "+" on a custom sidebar group (or open a cloud session → New session from current).
  3. Go back to Home → New session: folder field is empty and stays empty until re-selected.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗