claude-code - 💡(How to fix) Fix Desktop app and CLI store sessions in different project directories — history not synced

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The Claude Code CLI and the desktop app mangle the project path differently when determining the session storage directory under ~/.claude/projects/. This means sessions created in the CLI don't appear in the desktop app's sidebar (and vice versa), even when both are opened to the same directory.

Root Cause

The CLI mangles /Users/johndoe/Projects-Users-johndoe-Projects.

The desktop app appears to resolve the path through ~/.claude/projects/ itself (or similar), producing the double-encoded path -Users-johndoe--claude-projects--Users-johndoe-Projects.

Fix Action

Fix / Workaround

Attempted workarounds (none worked)

RAW_BUFFERClick to expand / collapse

Summary

The Claude Code CLI and the desktop app mangle the project path differently when determining the session storage directory under ~/.claude/projects/. This means sessions created in the CLI don't appear in the desktop app's sidebar (and vice versa), even when both are opened to the same directory.

Steps to reproduce

  1. Open the CLI from ~/Projects/ — sessions are stored in ~/.claude/projects/-Users-johndoe-Projects/
  2. Open the desktop app and set the working directory to ~/Projects/
  3. The desktop app creates a different directory: ~/.claude/projects/-Users-johndoe--claude-projects--Users-johndoe-Projects/
  4. No CLI session history appears in the desktop sidebar

Root cause

The CLI mangles /Users/johndoe/Projects-Users-johndoe-Projects.

The desktop app appears to resolve the path through ~/.claude/projects/ itself (or similar), producing the double-encoded path -Users-johndoe--claude-projects--Users-johndoe-Projects.

Attempted workarounds (none worked)

  • Restarting CLI in the project directory (hoping it would rebuild the index)
  • Manually creating a sessions-index.json in both directories
  • Copying .jsonl session files + index into the desktop app's directory
  • Fully quitting and relaunching the desktop app

Environment

  • CLI version: 2.1.133
  • macOS 26.1 (25B78)
  • Desktop app: latest (as of 2025-05-08)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING