[BUG] Claude Desktop sessions lost on restart — claude-code-sessions directory never created

Resolved 💬 10 comments Opened Feb 21, 2026 by bradlawther 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?

All Claude Code sessions (8 active sessions) were lost after restarting the Claude Desktop app on Windows 11. The app shows "No sessions found" in the sidebar after restart.

Investigation of main.log reveals the root cause: the session storage directory is never created by the app, so sessions are never persisted to disk. The log contains 153 occurrences of:

Cannot save session: storage path not available

And 110 occurrences of:

Failed to read sessions directory: ENOENT: no such file or directory, scandir 'C:\Users<user>\AppData\Roaming\Claude\claude-code-sessions<account-id><project-id>'

Because sessions were never saved, Loaded 0 persisted sessions appears on every app startup. When the app crashed/restarted, all 8 in-memory sessions were permanently lost.

The directory %AppData%\Claude\local-agent-mode-sessions exists and contains session data

What Should Happen?

  1. The app should auto-create the claude-code-sessions directory if it doesn't exist
  2. Sessions should be successfully persisted to disk (the "Cannot save session: storage path not available" warning should not occur)
  3. On restart, previously active sessions should be restored from persisted storage
  4. The 153 silent warnings should be surfaced as a visible error so users know sessions aren't being saved

Error Messages/Logs

# From main.log — session persistence failure (153 occurrences across 3 days):
Cannot save session: storage path not available

# From main.log — missing directory (110 occurrences):
Failed to read sessions directory: ENOENT: no such file or directory, scandir 'C:\Users\<user>\AppData\Roaming\Claude\claude-code-sessions\<account-id>\<project-id>'
[LocalSessionManager] loadSessions failed during account transition, restoring previous sessions ENOENT: ...

# From main.log — all 8 sessions crashed simultaneously at 09:26:46:
Claude Code process exited with code 1 (process_crashed) — 8 sessions

# From main.log — on restart at 09:26:52:
Starting app { appVersion: '1.1.3918' }
Loaded 0 persisted sessions

Steps to Reproduce

  1. Open Claude Desktop app on Windows 11
  2. Create multiple Claude Code sessions and use them over several days
  3. Check %AppData%\Claude\logs\main.log — you will see repeated "Cannot save session: storage path not available" warnings
  4. Verify %AppData%\Claude\claude-code-sessions directory does NOT exist
  5. Restart the Claude Desktop app
  6. All sessions are gone — sidebar shows "No sessions found"

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

1.1.3918

Platform

Other

Operating System

Windows

Terminal/Shell

Other

Additional Information

Environment

  • Claude Desktop app v1.1.3918
  • Windows 11 Pro (10.0.26200)
  • Session data files still exist in %AppData%\Claude\local-agent-mode-sessions\ but the app reads from the non-existent claude-code-sessions directory instead

Timeline

  • 2026-02-19 to 2026-02-21: "Cannot save session" warning logged 153 times (sessions were NEVER persisted)
  • 2026-02-21 09:26:46: App crash killed all 8 active sessions simultaneously
  • 2026-02-21 09:26:52: App restarted, loaded 0 sessions
  • Additional instability: 14 React hydration error reloads (#418) and 2 fatal error boundary crashes (#185) over the 3-day period

Possible Fix

The app should create the claude-code-sessions directory tree on startup if it doesn't exist (e.g., fs.mkdirSync(path, { recursive: true })) before attempting to read/write sessions.

View original on GitHub ↗

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