Desktop app: sessions silently drop out of their sidebar group while in use
Description
In the desktop app (Code tab), sessions spontaneously fall out of their sidebar group while they are being worked in. A session that was created inside a group, and displayed under that group's header, moves to Ungrouped on its own a short time later. No manual "Remove from group" was performed.
This has now happened at least three separate times on this machine.
Environment
- Desktop app, macOS 26.6.2 (Apple Silicon)
- Bundled Claude Code version: 2.1.260 (also present: 2.1.258)
- CLI on PATH: 2.1.226
What I found
Group membership and the session record appear to be stored in two independent places:
- The session record, at
~/Library/Application Support/Claude/claude-code-sessions/<workspace-uuid>/<folder-uuid>/local_<session-uuid>.json
I dumped every key in the affected session's file. It contains sessionId, cliSessionId, cwd, originCwd, lastFocusedAt, createdAt, lastActivityAt, model, title, titleSource, permissionMode, and similar fields — but no group field of any kind. cwd was still correct and unchanged throughout.
- The group assignment, which lives separately in the app's Local Storage leveldb at
~/Library/Application Support/Claude/Local Storage/leveldb/
under a key ending in -groups (alongside a sibling -sessions key).
Because the two are decoupled, the leveldb -groups entry can be rewritten or lost without the session record showing any change — which matches the observed symptom exactly: the session is otherwise completely intact, it just silently leaves its group.
Steps to reproduce
Not reliably pinned down, but the pattern across all three occurrences:
- Create a session inside an existing sidebar group.
- Confirm it renders under that group's header.
- Work in the session normally (tool calls, a title being auto-generated, subagents).
- Within minutes, the session is under Ungrouped.
My suspicion is that the leveldb -groups entry is rewritten on some sidebar state change (auto-title assignment seems a likely candidate, since it happens early and rewrites the session row) and the existing membership is not carried over.
Expected
A session stays in whichever group it was created in, or was manually moved to, until it is explicitly ungrouped or moved.
Actual
Group membership is silently dropped while the session is in active use.
Impact
Minor but persistent: any grouping scheme decays over time, so groups stop being usable for organising work and sessions have to be repeatedly re-filed by hand.