[BUG] Windows: Claude Code Desktop app shows sessions in sidebar but all message content missing after auto-update — content not persisted to claude-code-sessions JSONL files
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?
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
---
Platform: Windows
App: Claude Code Desktop
Area: Session persistence / Desktop app
---
What's Wrong?
After the Claude Code Desktop app auto-updated, all session message content
disappeared. The session list in the left sidebar still shows all previous
sessions correctly, but clicking any session shows "No messages yet." —
even for sessions that were actively used.
Reinstalling the app and clearing cache did not fix the issue.
---
Steps to Reproduce
- Use Claude Code Desktop on Windows over multiple sessions
- App auto-updates in the background
- Relaunch the app after the update
- Session titles are visible in the left sidebar
- Clicking any session shows "No messages yet." — content is gone
---
Expected Behavior
All previous session message content should be visible after an app update.
---
Actual Behavior
- Sidebar session list renders correctly (titles intact)
- All session message content is missing ("No messages yet.")
- Cache clear does not fix it
- Full uninstall + reinstall does not fix it
- Running /resume in the Claude Code CLI shows only a small subset
of sessions, confirming content was never flushed to the
claude-code-sessions JSONL files on disk
- The JSONL files in %APPDATA%\Claude\claude-code-sessions are all
only 1KB (empty stubs with no message content)
---
Root Cause (suspected)
The Desktop app (Electron renderer) was storing session message content
in IndexedDB / in-memory cache but never properly flushing it to the
claude-code-sessions JSONL files on disk. When the update cleared the
Electron cache, all message content was permanently lost.
---
Impact
Permanent data loss of all session conversation history prior to the update.
Work output files on disk are unaffected, but all conversation transcripts
are gone with no way to recover them.
---
Additional Context
- %APPDATA%\Claude\claude-code-sessions contains JSONL files all sized 1KB
- %APPDATA%\Claude\DIPS-wal was 910KB at time of investigation (WAL not checkpointed)
- Claude Code CLI /resume only shows sessions from AFTER the update
- Issue persists across reinstall, confirming it is a data persistence
bug and not an Electron cache issue
What Should Happen?
NA
Error Messages/Logs
no error msg
Steps to Reproduce
NA
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
latest
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
14 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
my issue is different as my chat history really got wiped out and i have no idea how it was all wiped out
Adding a related diagnostic distinction from #56172 that may help triage/recovery here.
When Desktop shows session titles/sidebar entries but the pane is empty or says there are no messages, there are at least two materially different cases:
For this report, the 1KB stubs suggest it may be the second bucket rather than the recoverable
cliSessionIdcase, but checking thecliSessionIdfield in%APPDATA%\Claude\claude-code-sessions\<acct>\<org>\local_*.jsonis a quick way to avoid conflating the two.Before touching any metadata files: fully quit Claude Desktop, including the tray process. Desktop holds metadata in memory and flushes back to disk — changes made while it's running get silently overwritten. Verify with
tasklist /FI "IMAGENAME eq claude.exe"before proceeding.---
Fix: cliSessionId-missing case
Step 1 — Diagnose
Step 2 — Repair
Match each broken metadata file to its JSONL by timestamp (first-record timestamp within ±30s of metadata
createdAt— deterministic in practice), then backfillcliSessionId. Run without--applyfirst to review matches.After running with
--apply, relaunch Desktop — repaired sessions should render correctly.This won't help the second bucket (stub JSONL / genuine data loss). But if the JSONL content is on disk and only the pointer is missing, this fixes it.
This happened to me ... Sidebar projects all still exists in Claude Code Desktop but ALL content form chats completely wiped.
Affected on Windows 11, Claude Code v2.1.128 (desktop).
Lost session history for 10+ active projects after auto-update.
Months of accumulated context across parallel builds — gone.
Max subscriber. No warning, no migration prompt, no recovery path.
Sessions show in sidebar with correct titles but "No messages yet"
when opened. New empty .jsonl files created on first interaction,
old history nowhere on disk.
This is unacceptable for a paid product. Requesting:
I'm seeing a very similar data-loss issue on macOS, with a slightly different failure mode that may help diagnose the root cause.
Environment
Observed behavior
20 early local Desktop sessions (2026-03-31 to 2026-04-16) are visible in the sidebar with correct titles, dates, and project paths. Opening them shows: "Session not found on disk".
These were not empty sessions: the Desktop metadata records non-zero
completedTurnsvalues, ranging from 2 to 185 across the affected sessions. The transcripts are missing, but the metadata clearly indicates these sessions had real completed conversation turns.All sessions created after 2026-04-17 are intact. The affected sessions are all older than 30 days.
Metadata analysis
The session metadata JSON files under
~/Library/Application Support/Claude/claude-code-sessions/are intact. The critical difference between broken and working sessions:Broken session (one of 20):
Working session:
For the working session,
{cliSessionId}.jsonlexists at~/.claude/projects/<project>/f6fc6bad-....jsonl.For the broken sessions,
cliSessionIdis absent andtranscriptUnavailableistrue. The user recalls being able to read some of these sessions previously, suggesting the JSONL transcripts may have originally existed but were deleted by Claude Code's default 30-day transcript cleanup (cleanupPeriodDays). It appears that when cleanup deletes a JSONL, Desktop also removes thecliSessionIdfield from the session metadata and setstranscriptUnavailable: true— leaving a visible but unrecoverable session card.Statistics
| Category | Count |
|---|---|
| Sessions with no
cliSessionId+transcriptUnavailable: true| 20 || Sessions with
cliSessionIdbut JSONL file deleted | 3 || Working sessions (JSONL intact) | 112 |
| Total affected | 23 |
All 20 no-cliSessionId sessions fall within the date range 03/31–04/16 — all older than 30 days. From 04/17 onward, all sessions are intact (none have exceeded 30 days yet or
cleanupPeriodDayshas since been set to a high value).Audit script
Likely root cause: 30-day cleanup + Desktop metadata desync
Claude Code's default
cleanupPeriodDays(30 days) deletes old JSONL transcript files from~/.claude/projects/. However, Desktop's session metadata in~/Library/Application Support/Claude/claude-code-sessions/is not cleaned up in sync. This creates zombie session cards: visible in the sidebar with title, date, and turn count, but no backing transcript.Worse, it appears Desktop reacts to the missing JSONL by removing
cliSessionIdfrom the metadata and settingtranscriptUnavailable: true— erasing the link to the deleted file and making it impossible to determine what was lost.Relation to this issue
This is the same class of bug: Desktop session metadata outlives the transcript backing store. The difference is:
cliSessionIdcleared from metadata, sessions show "Session not found on disk"Both point to a gap between Desktop's session UI and the underlying transcript lifecycle.
Warning: "Send a message to start fresh" silently masks the bug
Sending a message in a broken session does not recover the old conversation. Instead, Desktop binds a new
cliSessionIdto the same session card, creating a fresh transcript that overwrites the broken state:Before sending a message:
After sending "hi":
The new JSONL (
995a48fd-....jsonl) contains only 9 lines — just the new "hi" and its response. The original 4-turn conversation from April 12 is permanently lost.This is dangerous because:
transcriptUnavailableis gone, a validcliSessionIdexistscompletedTurnsstill shows the old count (4), which is misleading since the new transcript only has 1 turnUsers affected by this bug should avoid sending messages in broken sessions, as it permanently destroys the diagnostic evidence.
Impact
These include the user's first-ever sessions — initial project setup, research workflows, and early tool configuration. This content cannot be recreated. No backup mechanism exists for session transcripts.
@1nwooozip — your macOS case is the one I built for: cleanup deleted the JSONLs, so they have to come back from a snapshot before the metadata pointer can be repaired. Two scripts that do that on macOS:
garrettmoss/restore-claude-history
restore_claude_code.pypulls the deleted JSONLs back from Time Machine / APFS snapshots;restore_claude_desktop.pythen backfillscliSessionIdand dropstranscriptUnavailable. Hinges entirely on whether a snapshot from before the 30-day cleanup still has the file — mine reached back to early March and caught most of them.One amplification of your warning, since it matters for recovery: don't send a message in a broken session — it rebinds
cliSessionId, so a later restore points the metadata at the wrong transcript. Leave them untouched until you've restored from a snapshot.(Also filed #62272 on the cleanup behavior itself.)
Same symptom on Linux CLI (not just Windows/Desktop) — v2.1.177
Reproducing the core of this issue — session metadata persists but the message body never reaches the JSONL — on the Linux CLI (no Desktop app, no Electron/IndexedDB involved), which suggests the root cause is in the session-persistence/flush path itself, not the Desktop renderer cache.
Environment
versionfield in its events shows both2.1.168and2.1.177)Symptom 1 — title-only "stub" session files
Two sessions produced JSONL files containing only an
ai-titleline and zero message events:That's it — one line, ~130 bytes, no
user/assistant/systemevents at all. The session clearly ran (it got an AI-generated title), but the conversation body was never written.Symptom 2 — truncated tail on a resumed session
A separate long session (
db6953e4-…, version2.1.177):/proc/*/fd— it was a closed session, not mid-flush)But that session demonstrably kept working until ~14:37, proven by on-disk artifacts it created after its last JSONL event:
| Time | Artifact |
|-------|----------------------------------------------|
| 14:31 | new output directory created |
| 14:33 |
__pycache__(a Python script was executed) || 14:35 | a ~11 KB script + two output files written |
| 14:37 | a memory
.mdfile edited |None of these ~30 minutes of activity exist in the JSONL — no
Write/Edittool_use, none of the files' unique strings, no tool results. The trailing turns were lost on session exit.Why this matters / why it was hard to detect
--resumeand all transcript-search tooling correctly find nothing — the content was never written, so there's nothing to index or recover.Possible contributing factor:
/cdThe session wrote files under one project path while editing a memory file under a different project's path — consistent with a
/cdhaving occurred (/cdwas introduced in 2.1.169). This overlaps with #22566 ("assistant responses stop persisting to JSONL aftercd"). Flagging in case the flush target (project dir) goes stale after a working-directory change.Relevant changelog history
--resume) when launched from the VS Code integrated terminal" — same bug class; the fix implies it was live in 2.1.168/169, where this session began.Ask
Please confirm whether the persistence/flush path has an exit/
/cdwindow where message events are buffered but not flushed (producing title-only stubs and truncated tails), independent of the Desktop/Electron layer. A periodic flush, or a flush-on-exit/flush-on-/cdguarantee, would prevent silent data loss like this.Same issue on:
OS: Windows 11
Claude Desktop app v1.12603.1, released June 11, 2026
Updated to this version and all chats older than April 25 (~10:00pm EST is the oldest last-message chat - all prior give this error) are missing transcripts.
Is this expected functionality? Is this recoverable? Lots of valuable context is now missing and there doesn't seem to be a toggle or notice to prevent this arbitrary deletion with no backup.
Same issue here. I can't even reboot my machine now so i wont loss all my chat history.
Claude itself says that the json's are there, but the desktop UI wont show/use them.
How is this not being addressed?!??
@jgabriel98 The desktop version of Claude doesn't automatically scan for matching JSONL files in the working directory. Instead, it uses a database that registers all previous sessions. Therefore, restored JSONL files do not appear in the app because they aren't indexed in the Claude desktop app's database.
@garrettmoss Have you found any way to reindex the metadata?
Same core failure — session content not persisted to the JSONL — reproduces on a very different platform and trigger, which suggests the root cause isn't specific to Windows / the Desktop app / auto-update, but lives in the core session-persistence layer.
My environment: Claude Code 2.1.197, Linux x86_64, CLI (not Desktop), model
claude-opus-4-8. No auto-update involved — just a long session resumed with--resumeacross three calendar days.What I saw
During one span, the assistant did real, verifiable work — an
Artifacttool render (which produced a still-accessible artifact) plus severalWrite/Editcalls to project files. After a later resume, the model had no record of any of it and denied it happened. The work was only recoverable from on-disk side effects.Concrete evidence:
file-historyand the transcript disagree within the same session~/.claude/file-history/<session-id>/retained the file writes from that span (snapshots dated on the missing day — a rendered HTML doc and apackage.jsonedit).~/.claude/projects/<slug>/<session-id>.jsonlhas noArtifact/Write/Edittool_use and no assistanttextfor that span. The only transcript references to that work appear days later, when the user re-pasted an artifact URL and it was re-fetched.So the file-write path persisted while the conversation turns (assistant
text+tool_use) did not. This is not a display/index issue (cf. #22030, stalesessions-index.jsonwhere data is present but not loaded) — here the turns are genuinely absent from the.jsonl, so the reasoning/decisions from them are unrecoverable; only file outputs survive.Likely related and apparently regressed
This matches two issues that are now closed and locked as
resolved, but the behavior is back on 2.1.197:/resume, messages before the break become unreachable"Given those are CLI/cross-platform and this Desktop/Windows report is the only open thread on JSONL non-persistence, it'd be worth treating this as a platform-independent session-persistence defect rather than a Windows-Desktop-only one.
Repro (CLI)
file-history/<session-id>/against the session.jsonl: file snapshots exist for a span with no corresponding assistanttext/tool_useentries in the transcript.Happy to share the parsing script that cross-checks
file-historyagainst the.jsonl.---
Update — found the write gap, and a likely trigger (worktree / cwd drift)
Digging further on disk turned up a concrete signature and a plausible mechanism. The two persistence stores are keyed differently:
file-history/<session-id>/is keyed by session id (independent of cwd).projects/<project-slug>/<session-id>.jsonl, where the slug is derived from the project / launch cwd.On the affected day there is a ~2.5-hour window where
file-historyrecorded file writes but the transcript has ZERO entries:file-historycaptured file writes (an HTML document + apackage.jsonedit) at ~T..jsonlduring the window, even though the session was demonstrably active (it wrote files).The correlating condition: during that silent window the session's working cwd had drifted into git worktrees created under the project (and other sibling repo dirs), i.e. away from the original launch-cwd project root, while the session's project association stayed pinned to the launch dir. The session-keyed store (
file-history) kept writing; the project-keyed store (transcript) went silent. That asymmetry is exactly why file outputs survived while the conversation turns were lost.Hypothesis: when the working cwd moves into a git worktree / away from the launch project root, the project-keyed transcript write path can silently stop persisting turns (while session-keyed
file-historyis unaffected).Reproducible signature to look for: entries in
file-history/<session-id>/whose mtimes have no corresponding turns inprojects/<slug>/<session-id>.jsonlfor the same window — especially aftergit worktree add+ working inside the worktree.I can't prove causation from disk alone (the drift is strongly correlated with the gap, not provably its cause), but the keying asymmetry + the empty transcript window + the worktree cwd drift line up cleanly. Environment unchanged from above (CLI, Linux, 2.1.197,
claude-opus-4-8).@mon-jai yes, this is what my tool is for. https://github.com/BasedGPT/claude-code-session-recovery
@BasedGPT It does not work for me unfortunately :(
---
Edit: Never mind, it works now.