[BUG] Claude Desktop logout destroys pinned sessions (localStorage.clear wipes pinnedOrder)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
In Claude Desktop's Code mode, pinning sessions via drag-to-pin works while the app is open, but logging out destroys all pinned state permanently. Pins do not come back when logging in to the same account afterwards — the data is actively cleared by the logout handler, not merely hidden.
I hit this with multiple Claude Max accounts rotating due to session limits: I had pinned ~15 sessions on account A, hit the limit, logged out, signed in to account B. Later logged back into A — pinned section was empty. Confirmed by inspecting %APPDATA%\Claude\Local Storage\leveldb\ that pinnedOrder is [].
What Should Happen?
Pinned sessions should survive a logout/login cycle of the same account. (Ideally they'd also be account-scoped so switching accounts doesn't leak pins between them, but the minimum fix is to stop destroying them.)
Error Messages/Logs
Not an error — silent data loss. Tracked down in the renderer bundle resources/ion-dist/assets/v1/index-*.js:
// logout handler (minified, approximately)
const e = function(keys, includePersisted = true) {
if (includePersisted) keys.push(...Object.keys(localStorage).filter(k => k.startsWith("persisted.")));
return keys.reduce((acc, k) => {
const v = localStorage.getItem(k);
return v !== null && acc.push([k, v]), acc;
}, []);
}(["lastLoginMethod"]);
localStorage.clear(); // <-- destroys pinnedOrder here
sessionStorage.clear();
// ... only lastLoginMethod + persisted.* are restored from `e`
The session-picker state blob (which contains pinnedOrder, sidebarWidth, collapsed, lastKnownMode) is stored under a key that does not start with persisted., so it is wiped by localStorage.clear() on every logout.
Steps to Reproduce
- Open Claude Desktop, switch to Code mode
- Drag 2–3 sessions into the "Pinned" slots in the left sidebar
- Confirm they appear under "Pinned" above Recent
- Profile menu → Log out
- Log back in to the same account
- Open Code mode — Pinned section shows "Drag to pin" placeholder; all previously pinned sessions are gone
Environment
- Claude Desktop: 1.3109.0 (Windows Store, arm64)
- Claude Code (embedded): 2.1.111
- OS: Windows 11 26200, Snapdragon X Elite (ARM64)
- Electron: 41.2.0
- Repro: 100% reproducible on my machine; happens every logout
Suggested Fix
Prefix the session-picker state key with persisted. (or add the literal key name to the preservation whitelist alongside lastLoginMethod). One-line change.
Pinning is a curation action users invest real time in — losing it silently on every logout is a significant UX regression for anyone managing multiple accounts or forced to re-auth.
Workaround (for other users hitting this)
Before logging out, snapshot the whole %APPDATA%\Claude\Local Storage\ folder, then after login quit the app and restore the folder. LevelDB is a single-writer store so Claude Desktop must be fully quit (not just window-closed) during the restore.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗