Pinned sessions silently wiped to empty array in desktop app
Summary
Previously pinned sessions in the Claude Code desktop app sidebar disappeared without any user action. Pin state in the Electron LevelDB (~/Library/Application Support/Claude/Local Storage/leveldb/) shows "pinnedOrder":[] — empty.
Environment
- Claude Code desktop app version: 2.1.121
- Entrypoint:
claude-desktop - macOS: 26.4.1 (build 25E253), Apple Silicon
What happened
Multiple sessions were previously pinned in the sidebar. After what was likely an app update or restart, all pins were gone. Sessions and transcripts themselves are intact — only the pin state was lost.
Investigation
Pin state appears to live exclusively in the Electron app's LevelDB local storage:
- Path:
~/Library/Application Support/Claude/Local Storage/leveldb/ - Key fragment found:
"pinnedOrder":[],"groupBy..."(empty array) - The two most recent
.ldbfiles (017577.ldb dated Apr 29 15:17, 017580.ldb dated Apr 29 15:28) both showpinnedOrderas[]. - The oldest extant
.ldb(017327.ldb dated Apr 26) contains nopinnedOrderdata at all — LevelDB compaction has already discarded the previous state. - Per-session JSON files at
~/Library/Application Support/Claude/claude-code-sessions/<account>/<workspace>/local_*.jsoncontainisArchived,title,model, etc. — but no pin field. So pin state is not duplicated to durable per-session storage.
Why this is a bug
- No redundancy: Pin state lives in a single Electron LevelDB key. A migration, a corrupt write, or a compaction loss wipes it permanently with no recovery path.
- Silent failure: No warning, no fallback, no log message visible to the user.
- No backup or sync: Pins do not appear to sync across machines or persist through app updates.
Suggested fix
Persist isPinned: true (and a pinnedAt timestamp for ordering) on each session's JSON metadata file alongside isArchived. The sidebar can derive pinnedOrder from those, with the LevelDB key acting only as a UI cache rather than the source of truth.
Reproduction
Not directly reproducible without the triggering event, but trivially observable:
- Pin one or more sessions.
strings "~/Library/Application Support/Claude/Local Storage/leveldb/"*.ldb | grep pinnedOrder— you will find the array.- Compare to per-session JSON in
claude-code-sessions/— no pin field exists there.
The asymmetry between durable session metadata and ephemeral pin state is the root cause.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗