[BUG] Desktop update loses all Code mode sessions (no migration from previous storage format)
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?
Summary
After a Claude Desktop update, all Code mode sessions ("All projects" sidebar) are lost. The session list shows empty even though full conversation data (.jsonl files) still exists on disk at ~/.claude/projects/.
Environment
- Platform: Windows 11 Enterprise x64
- Claude Desktop version before: 1.569.0
- Claude Desktop version after: 1.1062.0
- CCD (Claude Code Desktop) version: 2.1.87
- Sessions lost: 39 sessions across 19 projects (date range: 2026-03-13 to 2026-04-08)
What happened
- Claude Desktop v1.569.0 was running normally with ~39 Code mode sessions visible in the sidebar
- The app auto-downloaded update to v1.1062.0
- After the update was applied, the "All projects" sidebar in Code mode was empty — only the current session remained
Root cause (from log analysis)
The main.log shows the issue clearly:
[LocalSessionManager] Initialization succeeded — accountId=f787b114..., orgId=abaa9011..., existingSessions=0
[LocalSessionManager] Session storage directory does not exist yet, skipping load:
C:\Users\...\AppData\Roaming\Claude\claude-code-sessions\{accountId}\{orgId}
The new version introduced a new session storage path:
%APPDATA%\Claude\claude-code-sessions\{accountId}\{orgId}\{sessionId}.json
This directory did not exist before the update (birth timestamp confirms it was created during the first post-update launch). The previous version stored session metadata differently (likely in LocalStorage/LevelDB or a different file structure), but no migration was performed to carry over existing sessions to the new format.
Data still on disk
The actual conversation data is fully intact at:
~/.claude/projects/{project-dir}/{sessionId}.jsonl
Each .jsonl file contains the full conversation history with messages, tool calls, and results. The files also contain the original cwd path in the user message metadata. Only the session index (the metadata that tells the Desktop app which sessions exist) was lost.
Workaround
Sessions can be manually restored by creating .json files in the new storage directory. Each file needs:
{
"sessionId": "local_{uuid}",
"cliSessionId": "{uuid-from-jsonl-filename}",
"cwd": "{extracted-from-jsonl-cwd-field}",
"originCwd": "{same}",
"createdAt": 1234567890,
"lastActivityAt": 1234567890,
"model": "claude-sonnet-4-6",
"title": "{first-user-message}",
"permissionMode": "default",
"remoteMcpServersConfig": [],
"completedTurns": 1,
"isArchived": false,
"effort": "medium"
}
After creating these files and restarting the Desktop app, all 38 sessions were recovered successfully.
What Should Happen?
Expected behavior
When the Desktop app upgrades to a version with a new session storage format, it should migrate existing sessions automatically — by scanning ~/.claude/projects/ for existing .jsonl files and creating corresponding entries in the new claude-code-sessions/ directory.
Error Messages/Logs
[LocalSessionManager] Initialization succeeded — accountId=f787b114..., orgId=abaa9011..., existingSessions=0
[LocalSessionManager] Session storage directory does not exist yet, skipping load:
C:\Users\...\AppData\Roaming\Claude\claude-code-sessions\{accountId}\{orgId}
Steps to Reproduce
Steps to reproduce
- Have Claude Desktop v1.569.0 (or any pre-1.1062.0 version) with multiple Code mode sessions in the sidebar
- Let the app auto-update to v1.1062.0 (or trigger update manually)
- Restart the app after the update is applied
- Switch to the Code tab and open the All projects sidebar
- Result: All previous sessions are gone. Only new sessions created after the update appear
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.569.0
Claude Code Version
1.1062.0
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
Suggested fix
During LocalSessionManager initialization, if the session storage directory doesn't exist (first run after upgrade), scan ~/.claude/projects/*/ for existing .jsonl files and auto-create session entries from their metadata (cwd, timestamps, first user message for title).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗