Repository navigation
Description
Bug Description
After reinstalling/updating Claude Desktop (to v1.1.4498), all Code sessions disappear from the sidebar. Chat and Cowork sessions are unaffected. The session data remains on disk but is not displayed in the app.
Root Cause
The update changed the session storage directory from local-agent-mode-sessions to claude-code-sessions (under ~/Library/Application Support/Claude/). The app's LocalSessionManager.loadSessions() reads from the new claude-code-sessions/<accountId>/<orgId>/ directory, but no migration runs to copy existing session JSON files from the old local-agent-mode-sessions/<accountId>/<orgId>/ directory.
There is a migrateLegacySessions() method in the codebase, but it only handles migration from a single local-sessions.json file — it does not handle migration from the local-agent-mode-sessions directory structure.
Steps to Reproduce
- Have an existing Claude Desktop installation with Code sessions
- Update/reinstall Claude Desktop to the version that uses
claude-code-sessions - Open the app — Code sessions are gone from the sidebar
Expected Behavior
Existing Code sessions should be migrated from local-agent-mode-sessions to claude-code-sessions automatically during the update, or the app should check both directories.
Workaround
Copy the session JSON files from the old directory to the new one:
OLD_DIR="$HOME/Library/Application Support/Claude/local-agent-mode-sessions/<accountId>/<orgId>"
NEW_DIR="$HOME/Library/Application Support/Claude/claude-code-sessions/<accountId>/<orgId>"
# The account/org IDs can be found by listing the subdirectories
# Copy all session files that don't already exist in the new location
for f in "$OLD_DIR"/local_*.json; do
basename=$(basename "$f")
[ ! -f "$NEW_DIR/$basename" ] && cp "$f" "$NEW_DIR/$basename"
doneThen restart Claude Desktop. Sessions will reappear.
Technical Details
- Platform: macOS (Darwin 25.2.0, Apple Silicon)
- Claude Desktop version: 1.1.4498
- Old directory:
~/Library/Application Support/Claude/local-agent-mode-sessions/ - New directory:
~/Library/Application Support/Claude/claude-code-sessions/ - App bundle code reference:
.vite/build/index.jsline 771 —const $6t="claude-code-sessions"and theloadSessions()/getStorageDir()methods inLocalSessionManager
Suggested Fix
Add a migration step in LocalSessionManager initialization that checks for the existence of local-agent-mode-sessions/<accountId>/<orgId>/ and copies any local_*.json files not already present in claude-code-sessions/<accountId>/<orgId>/.
Note: This bug was diagnosed and fixed by Claude (Opus 4.6) running inside Claude Desktop — it reverse-engineered the session storage change by extracting and reading the app's asar bundle, then copied the session files to restore 30 lost sessions. The user (filing this issue) did not perform the debugging themselves.
Activity
github-actions commentedon Feb 27, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
mbbender commentedon Feb 27, 2026
Follow-up: Additional issue found — VM/Cowork sessions vs local Code sessions
After the initial fix (copying JSON files from
local-agent-mode-sessionstoclaude-code-sessions), the sessions appeared in the sidebar but all showed "Folder no longer exists. Please start a new session."Root Cause
The
local-agent-mode-sessionsdirectory contained both VM/Cowork sessions and local Code sessions. The VM/Cowork sessions havecwdpaths like/sessions/friendly-lucid-edison(VM paths that don't exist on the local machine) and avmProcessNamefield. The app'sgetAllSessions()callscheckFolderExistsCached(n.cwd)which fails for these VM paths, causing the error message.These VM sessions should not have been copied into
claude-code-sessions— they belong in the Cowork section and were already showing correctly there.The actual missing Code sessions
The real local Code sessions (ones run from Claude Desktop with terminal access) store their conversation history in
~/.claude/projects/<project-dir>/<sessionId>.jsonl, but the Desktop sidebar reads session metadata fromclaude-code-sessions/<accountId>/<orgId>/local_*.json. After the update, the metadata files were never created for pre-existing Code sessions.Complete fix
claude-code-sessions(ones withvmProcessNameorcwdstarting with/sessions/)claude-code-sessions/<accountId>/<orgId>/for each.jsonlsession in~/.claude/projects/, using this format:{ "sessionId": "local_<new-uuid>", "cliSessionId": "<the .jsonl filename without extension>", "cwd": "<actual local project path>", "originCwd": "<actual local project path>", "createdAt": <timestamp_ms>, "lastActivityAt": <timestamp_ms>, "model": "claude-opus-4-6", "isArchived": false, "title": "<first user message from the JSONL>", "permissionMode": "default" }The
cliSessionIdfield is the critical link between the Desktop sidebar entry and the conversation history stored in~/.claude/projects/.Suggested fix for Anthropic
On app startup/update, scan
~/.claude/projects/for.jsonlsession files that don't have corresponding entries inclaude-code-sessions/and create the metadata files automatically.Diagnosed and fixed by Claude (Opus 4.6) running inside Claude Desktop.
tomer-dev commentedon Feb 28, 2026
Thank you!
github-actions commentedon Mar 28, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Apr 4, 2026
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.