[BUG] "No sessions found" - race condition in storage path initialization (Windows)
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
- Open Claude Desktop on Windows
- Click "Code" tab
- Sidebar shows "No sessions found"
- Start a new session, work in it
- Close Claude Desktop completely
- Reopen - the session from step 4 is gone
- 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_
12 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
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
👎
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:
/resumecommand flicker (TUI rendering issue)history.jsonl.lockEBADF from Chokidar file watchingNone of these involve the Code tab session store failing to initialize due to
accountId/orgIdnot 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
"Cannot save session: storage path not available"in main.logsessions-index.jsonis completely missing from the sessions directory — session indexing is broken.jsonfiles remain inclaude-code-sessions/{accountId}/{orgId}/accountId/orgIdresolves before the Code tab initializesoauth:tokenCachefrom config.json, clearedSession Storagedirectory — log shows fresh OAuth exchange succeeds but "Cannot save session" continues immediately afterActual 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}/) beforeaccountIdandorgIdare resolved from the OAuth flow. When the async resolution loses the race, the storage path isundefined/null, causing:Suggested fix
The session store initialization should
awaitthe account info resolution before attempting any read/write operations, or use a deferred initialization pattern that queues operations until the path is available.Environment
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.logon 2026-02-19:The
claude-code-sessions/directory was never created on my system. Account info consistently resolves ~2s afterLocalSessionManagerinit.Throughout the day, 40+ occurrences of:
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:
I just suffered bad because of this bug.
why they not fix it?
same issue here. please resolve this asap.
++
same here, no sessions found :-(
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.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
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.