claude-code - 💡(How to fix) Fix [FEATURE] Desktop Recents to enumerate ~/.claude/projects/ directly. [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#54911Fetched 2026-05-01 05:51:12
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Root Cause

Use the standalone CLI (@anthropic-ai/claude-code) for several weeks. Sessions accumulate in C:\Users<user>.claude\projects<encoded-cwd>*.jsonl. Install the Claude Desktop app for the first time. Open the Code tab and select the same working directory used by the CLI. Expected: Recents lists prior sessions (the data is on disk and readable). Actual: Recents is empty. The Stats panel correctly shows the historical session/message counts because it does read ~/.claude/projects/, which makes the inconsistency more confusing. Evidence on my machine

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Problem

The Claude Desktop app's "Recents" panel (Code tab) only lists sessions stored in %APPDATA%\Claude\claude-code-sessions, which is populated exclusively by sessions created through the desktop app itself. Sessions stored on disk at ~/.claude/projects/<encoded-cwd>/*.jsonl — the canonical session location used by the standalone CLI — are never enumerated or imported. As a result, users who installed the desktop app after using the CLI see an empty Recents list despite having a full history of valid sessions on disk.

Reproduction (Windows 11, desktop app v2.1.121)

Use the standalone CLI (@anthropic-ai/claude-code) for several weeks. Sessions accumulate in C:\Users<user>.claude\projects<encoded-cwd>*.jsonl. Install the Claude Desktop app for the first time. Open the Code tab and select the same working directory used by the CLI. Expected: Recents lists prior sessions (the data is on disk and readable). Actual: Recents is empty. The Stats panel correctly shows the historical session/message counts because it does read ~/.claude/projects/, which makes the inconsistency more confusing. Evidence on my machine

~/.claude/projects/G--workspace/ contains 35 valid JSONL session files (~200 MB). Stats panel shows 34 sessions, 19,684 messages, 30M tokens. %APPDATA%\Claude\claude-code-sessions\ contains exactly one UUID, created at desktop-app first-run timestamp. claude --resume (standalone CLI) lists all 35 sessions correctly from the same working directory. Impact

Proposed Solution

Proposed Solution

Make ~/.claude/projects/ the single source of truth for the Recents list. The desktop app should enumerate it directly instead of maintaining a parallel store.

Specifics

On directory selection (when the user picks a working directory in the Code tab), the app should: Compute the encoded path (G:\workspace > G--workspace). Read ~/.claude/projects/<encoded-cwd>/*.jsonl. Parse each file's first event for the timestamp and the first user message for a preview/title. Render the list, sorted by most-recent activity, in Recents. On new session creation, write the session JSONL to ~/.claude/projects/<encoded-cwd>/<uuid>.jsonl directly — same location and format the CLI uses. Drop the separate %APPDATA%\Claude\claude-code-sessions\ store entirely (or keep it only as a UI-state cache like "last opened tabs", not as the session list). On session resume, read the JSONL from ~/.claude/projects/ rather than from the parallel store. This makes desktop and CLI fully interchangeable: a session started in either surface can be resumed in the other. Why this approach over a one-time import

Permanently fixes the divergence . There is no "two stores that need to stay in sync" problem to maintain. Sessions started via the CLI after desktop install also appear in Recents automatically (one-time import would miss those). The Stats panel already reads ~/.claude/projects/ correctly, so the data path is proven and trusted. Eliminates an entire class of future bugs (index out of sync, missing imports, encoding mismatches between the two stores). Migration

No migration needed for users. On the next desktop launch after the fix ships, Recents populates from existing JSONL files automatically. The orphaned %APPDATA%\Claude\claude-code-sessions\ folder can be cleaned up by the app on first run post-update, or simply ignored.

Backward compatibility

The CLI already uses ~/.claude/projects/ exclusively. Aligning the desktop app on the same store is the compatibility story — it removes the only point of divergence.

Alternative Solutions

No response

Priority

Critical - Blocking my work

Feature Category

Configuration and settings

Use Case Example

Users perceive the desktop app as "losing" their history, even though no data is lost. Forces users to keep the CLI installed alongside the desktop app to access prior conversations. Stats panel and Recents disagree on what exists, eroding trust in the UI.

On first run / on directory change, enumerate ~/.claude/projects/<encoded-cwd>/*.jsonl and surface those sessions in Recents directly. Make ~/.claude/projects/ the single source of truth (preferred — matches the CLI). Or, on first run, perform a one-time import that registers existing JSONL sessions into claude-code-sessions. At minimum, show an explanatory empty-state ("N sessions exist on disk but were not created in this app — open in CLI with claude --resume") so the gap is discoverable.

Additional Context

No response

extent analysis

TL;DR

Make ~/.claude/projects/ the single source of truth for the Recents list by enumerating it directly instead of maintaining a parallel store.

Guidance

  • On directory selection, compute the encoded path and read ~/.claude/projects/<encoded-cwd>/*.jsonl to populate the Recents list.
  • Parse each file's first event for the timestamp and the first user message for a preview/title, and render the list sorted by most-recent activity.
  • Consider dropping the separate %APPDATA%\Claude\claude-code-sessions\ store entirely to eliminate divergence and future bugs.
  • On new session creation, write the session JSONL to ~/.claude/projects/<encoded-cwd>/<uuid>.jsonl directly to maintain consistency with the CLI.

Example

No code snippet is provided as the issue description does not include specific code references.

Notes

This solution assumes that the desktop app has the necessary permissions to read and write to ~/.claude/projects/. Additionally, the app should handle cases where the user has multiple working directories with different encoded paths.

Recommendation

Apply the proposed solution to make ~/.claude/projects/ the single source of truth for the Recents list, as it eliminates the divergence between the desktop app and CLI, and provides a consistent user experience.

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

claude-code - 💡(How to fix) Fix [FEATURE] Desktop Recents to enumerate ~/.claude/projects/ directly. [1 comments, 2 participants]