[BUG] "No sessions found" - race condition in storage path initialization (Windows)

Status Closed — not planned
Reported on v2.1.34
Maintainer reply None cached
Activity 12 comments · opened Feb 8, 2026 · closed Mar 26, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Code tab sidebar intermittently shows
"No sessions found" on startup. Sessions
created during this broken state are
permanently lost because the app cannot
write to disk.

The problem is non-deterministic: sometimes
restarting fixes it, sometimes it doesn't.
There is no reliable user-side workaround.

main.log shows 133 occurrences of:
"Cannot save session: storage path not available"

Root cause appears to be a race condition:
the Code tab initializes before accountId/orgId
is resolved, so the storage path
(claude-code-sessions/{accountId}/{orgId}/)
is not yet available.

What Should Happen?

Code tab should reliably load all persisted
sessions on every startup. The session store
initialization should wait for account info
before attempting to read/write sessions.

Error Messages/Logs

Failing restart (2026-02-08 10:07):

  [info] No persisted sessions found
  [info] No persisted sessions found
  [warn] Cannot save session: 
         storage path not available
  [warn] Cannot save session: 
         storage path not available

Working restart (2026-02-07 19:23, 
same machine, no config changes):

  [info] Loaded 38 persisted sessions from 
         ...\claude-code-sessions\
         a992af79-...\9d09c42b-...

Total "Cannot save session" warnings 
in main.log: 133

Steps to Reproduce

  1. Open Claude Desktop on Windows
  2. Click "Code" tab
  3. Sidebar shows "No sessions found"
  4. Start a new session, work in it
  5. Close Claude Desktop completely
  6. Reopen - the session from step 4 is gone
  7. Repeat close/reopen multiple times -

sessions appear randomly on some restarts

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.34

Claude Code Version

1.1.2321

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

12 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/23786
  2. https://github.com/anthropics/claude-code/issues/23159
  3. https://github.com/anthropics/claude-code/issues/15739

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

ylmzsalih8 · 6 months ago

Bu issue önerilen 3 duplicate'tan farklıdır:

#23786 CLI /resume — benim sorunum Claude Desktop Code tab
#23159 stdin race condition — farklı semptom
#15739 history.jsonl.lock EBADF — farklı root cause
Log kanıtları:

139x "Cannot save session: storage path not available"
Bug ilk kez 2026-01-31 17:48'de başladı
Intermittent: bazen restart'ta çalışıyor (38 session yükleniyor), bazen değil
sessions-index.json dosyası yok — session indexing tamamen kırık
OAuth token cache temizleme çözmedi
38 session'dan 36'sı kalıcı olarak kayboldu

ylmzsalih8 · 6 months ago

👎

Not a duplicate — this is a distinct Code tab (Desktop GUI) bug, not a CLI issue

The 3 suggested duplicates are unrelated to this bug:

  • #23786 → CLI /resume command flicker (TUI rendering issue)
  • #23159 → stdin race condition causing unresponsive input field
  • #15739history.jsonl.lock EBADF from Chokidar file watching

None of these involve the Code tab session store failing to initialize due to accountId/orgId not being resolved in time.

Forensic evidence from main.log (139 occurrences analyzed)

Timeline of the bug

| Date | Status | Sessions |
|------|--------|----------|
| Jan 14 → Jan 31 16:51 | ✅ Healthy | 1 → 18 (steadily growing) |
| Jan 31 17:48 | ❌ First break | "No persisted sessions found" starts |
| Jan 31 17:51 | ❌ | First "Cannot save session: storage path not available" |
| Jan 31 21:07 | ✅ Self-healed on restart | 18 sessions loaded |
| Feb 1 → Feb 7 19:23 | ✅/❌ Intermittent | When working: 21→38 sessions |
| Feb 7 22:26 → Feb 8 11:15 | ❌ Permanently broken | Never loads sessions |

Key findings

  1. 139 occurrences of "Cannot save session: storage path not available" in main.log
  2. sessions-index.json is completely missing from the sessions directory — session indexing is broken
  3. 36 out of 38 session files are permanently lost — only 2 .json files remain in claude-code-sessions/{accountId}/{orgId}/
  4. Intermittent pattern confirms race condition: same machine, same config, sometimes sessions load (38 sessions), sometimes they don't — depends on whether accountId/orgId resolves before the Code tab initializes
  5. Workarounds tried and failed: Cleared oauth:tokenCache from config.json, cleared Session Storage directory — log shows fresh OAuth exchange succeeds but "Cannot save session" continues immediately after

Actual log evidence

Failing startup (2026-02-08 10:07):

[info] No persisted sessions found
[info] No persisted sessions found
[warn] Cannot save session: storage path not available
[warn] Cannot save session: storage path not available

Working startup (2026-02-07 19:23, same machine, no config changes):

[info] Loaded 38 persisted sessions from ...claude-code-sessions\a992af79-...\9d09c42b-...

Root cause hypothesis

The Code tab's session store component attempts to construct the storage path (claude-code-sessions/{accountId}/{orgId}/) before accountId and orgId are resolved from the OAuth flow. When the async resolution loses the race, the storage path is undefined/null, causing:

  • All session reads to return empty ("No persisted sessions found")
  • All session writes to fail ("Cannot save session: storage path not available")
  • Sessions created during this broken state to be permanently lost

Suggested fix

The session store initialization should await the account info resolution before attempting any read/write operations, or use a deferred initialization pattern that queues operations until the path is available.

Environment

  • Claude Desktop v1.1.2321 (Windows 11)
  • Bug first appeared: 2026-01-31 17:48 (possibly triggered by an update)
  • Last known working version: pre-Jan 31 update
Hordemar · 6 months ago

Reproducing on Claude for Windows v1.1.3647 (8f7c53), CCD v2.1.45, Windows 11 Pro 10.0.26200

Exact same race condition. From main.log on 2026-02-19:

17:16:17 [warn] [LocalSessionManager] Cannot initialize sessions: accountId=null, orgId=null. Keeping existing sessions.
17:16:17 [info] No persisted sessions found
17:16:19 [info] claude.ai account details provided    ← 2 seconds later

The claude-code-sessions/ directory was never created on my system. Account info consistently resolves ~2s after LocalSessionManager init.

Throughout the day, 40+ occurrences of:

[warn] Cannot save session: storage path not available

Every app restart hits No persisted sessions found (6 occurrences today across restarts). Sessions created in the desktop app are permanently lost since they can't be written to disk.

Impact: All previous desktop sessions gone from sidebar. Only CLI sessions in ~/.claude/projects/ survive (those use a different storage mechanism).

Environment:

  • Claude for Windows: 1.1.3647 (8f7c53) — MSIX install
  • CCD: 2.1.45
  • Platform: win32/x64
  • OS: Windows 11 Pro 10.0.26200
  • CPU: AMD Ryzen 5 5600U
brimalm · 6 months ago

I just suffered bad because of this bug.

amibars · 6 months ago

why they not fix it?

bradlawther · 6 months ago

same issue here. please resolve this asap.

georgeriaskin · 6 months ago

++

Sh11m11 · 6 months ago

same here, no sessions found :-(

mwolters-cmyk · 6 months ago

Same issue here. Windows 11, Max plan, Opus 4.6. Had ~20 Code mode sessions, all gone after app restart on Feb 26. Investigation of %AppData%/Claude/local-agent-mode-sessions/ shows only 2 folders remaining, and .claude.json has today's date as firstStartTime, confirming the metadata was recreated. Chat mode sessions (synced to claude.ai) are unaffected.

github-actions[bot] · 5 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.