Claude Desktop update loses Code session history (migration from local-agent-mode-sessions to claude-code-sessions)

Resolved 💬 5 comments Opened Feb 27, 2026 by mbbender Closed Mar 28, 2026

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

  1. Have an existing Claude Desktop installation with Code sessions
  2. Update/reinstall Claude Desktop to the version that uses claude-code-sessions
  3. 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"
done

Then 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.js line 771 — const $6t="claude-code-sessions" and the loadSessions() / getStorageDir() methods in LocalSessionManager

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.

View original on GitHub ↗

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