[BUG] Desktop app fails to display/index sessions migrated from another machine (works fine in CLI)
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?
Related feedback ID: 4e91ad12-3ab1-4b25-be26-ecde24c790d8
Summary:
After migrating my ~/.claude directory (including projects/ and .claude.json) from an old Windows machine to a new one, sessions created on the old machine do not appear in the Desktop app's sidebar or search — even though the underlying .jsonl session files are intact, readable, and correctly indexed by the CLI (claude --resume).
Environment:
Old machine: Desktop app version with lastVersionBase: 2.1.173
New machine: Desktop app version with lastVersionBase: 2.1.183
Install method: native (Windows Store / MSIX package)
OS: Windows, locale sr-Latn-RS
Steps to reproduce:
On machine A, use Claude Code (via Desktop app) on a project for several days, accumulating ~30+ sessions.
Copy ~/.claude/ (including projects/<encoded-path>/*.jsonl) and ~/.claude.json to machine B, same user folder structure (C:\Users\<username>\).
On machine B, open the Desktop app, go to the Code tab, and select the same project folder (e.g. via folder picker).
Sidebar shows "Sessions you start will show up here" — no historical sessions are listed.
Searching for known session titles (e.g. a distinctive word from an old session's title) via the global search returns no results.
Creating a brand-new session on machine B works fine and appears immediately in the sidebar.
Running claude --resume from the same project directory in a terminal correctly lists all ~30+ historical sessions with correct titles, timestamps, branch, and file size.
Expected behavior:
Desktop app sidebar and search should show the same sessions that claude --resume finds, since they read from the same ~/.claude/projects/ directory.
Actual behavior:
Desktop app shows zero historical sessions (sidebar and search), while new sessions created after the migration work normally. CLI resume correctly lists everything.
Additional notes:
~/.claude.json contained duplicate-looking project path entries differing only by drive-letter case (D:/... vs d:/...) and separator style (\\ vs /), likely from opening the same project differently across sessions on the old machine. This caused ConvertFrom-Json in PowerShell to throw a "duplicate keys" error, suggesting the file may not be strictly valid/deduplicated JSON in edge cases — possibly related, possibly a red herring.
The session whose lastSessionId is referenced in .claude.json for the project (with full lastModelUsage/cost data) is the same one the CLI lists and previews correctly, ruling out file corruption.
Suspected cause: a difference in how the Desktop app version (2.1.183) builds its session index/cache compared to the version that originally wrote the files (2.1.173), possibly tied to a first-run migration step that doesn't run for non-fresh .claude directories copied in from another machine.
Impact: Session history is not lost (recoverable via CLI), but the Desktop app's main value-add — visual session browsing — is unusable for any pre-migration sessions.
What Should Happen?
The Desktop app's session sidebar and search should display all historical sessions found in ~/.claude/projects/<project>/, the same way claude --resume does from the terminal. After migrating the .claude folder from another machine, sessions created before the migration (with an older app version, 2.1.173) should still appear and be resumable through the Desktop UI — not just through the CLI.
Error Messages/Logs
Steps to Reproduce
- On Machine A, use the Claude Desktop app (Code tab) on a project for an extended period (10+ days), accumulating 30+ sessions in ~/.claude/projects/<encoded-project-path>/*.jsonl. App version on Machine A: 2.1.173.
- Copy the entire ~/.claude/ directory (including the projects/ folder with all .jsonl session files) and ~/.claude.json from Machine A to Machine B, preserving the same folder structure under the same Windows username (C:\Users\<username>\.claude\ and C:\Users\<username>\.claude.json).
- On Machine B, install/open the Claude Desktop app (version 2.1.183) for the first time with this copied config already in place.
- Go to the Code tab, and select the same project folder that has historical sessions (e.g. via the folder picker, choosing the exact path that matches the encoded folder name under ~/.claude/projects/).
- Observe the sidebar under "Recents" — it shows "Sessions you start will show up here" instead of listing the 30+ historical sessions.
- Click the global search icon (top left) and search for a distinctive word from one of the old session titles (e.g. a project-specific term). Search results are empty.
- Create a brand-new session on Machine B in the same project — it appears correctly in the sidebar immediately.
- Open a terminal, cd into the same project folder, and run:
claude --resume
This correctly lists all 30+ historical sessions with accurate titles, branch names, timestamps, and file sizes — proving the .jsonl files are intact and readable.
Expected: step 5 and 6 should show the same sessions that step 8 finds.
Actual: Desktop app shows none of them, in either the sidebar or search, while CLI resume works perfectly.
Note: ~/.claude.json contained multiple entries for the same project path differing only in drive-letter case (D:/... vs d:/...) and separator style (backslash vs forward slash) — likely created by opening the project differently across sessions on Machine A. This caused PowerShell's ConvertFrom-Json to throw a "duplicate keys" error when parsing the file manually, though this may or may not be related to the root cause.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.183
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
This issue may affect any user who migrates a Claude Code workspace between machines (e.g. PC upgrade, OS reinstall) where the Desktop app version differs between the source and destination machine. The session data itself is never lost — it remains fully intact and accessible via claude --resume in the terminal — but the Desktop app's visual session browser (its main usability advantage over the CLI) becomes unusable for any session created before the migration.
Suspected root cause: the Desktop app likely builds and maintains its own session index/cache separately from simply reading the .jsonl files at runtime (unlike the CLI, which appears to read directly from disk each time). This index may only be populated during a specific first-run/migration step that does not trigger correctly when an existing, non-empty ~/.claude directory is already present on first launch.
A workaround in the meantime: affected sessions remain fully accessible via claude --resume from the terminal, so no functionality is permanently lost — but it does undermine the value of the Desktop app's UI for anyone who has switched machines.
Related feedback ID submitted via /feedback in Claude Code: 4e91ad12-3ab1-4b25-be26-ecde24c790d8
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗