[BUG] Claude Desktop logout destroys pinned sessions (localStorage.clear wipes pinnedOrder)

Resolved 💬 4 comments Opened Apr 18, 2026 by puneet1409 Closed Apr 22, 2026

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

  1. Open Claude Desktop, switch to Code mode
  2. Drag 2–3 sessions into the "Pinned" slots in the left sidebar
  3. Confirm they appear under "Pinned" above Recent
  4. Profile menu → Log out
  5. Log back in to the same account
  6. 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.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗