claude-code - 💡(How to fix) Fix [BUG] VS Code extension wipes ~/.claude/sessions/ index on restart after VS Code update, clearing sessions panel history [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#55066Fetched 2026-05-01 05:47:07
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

Code Example

~/.claude/sessions/        ← wiped; only one new file (294 bytes, current session)
~/.claude/.credentials.json
~/.claude/session-env/
~/.claude/shell-snapshots/
~/.claude/ide/

---

deaab55a-b316-4e6f-a91c-2390d315603a.jsonl   5,749,117 bytes  (04/29)
1fedb810-94c8-4ae1-95e5-033fb095c213.jsonl     256,810 bytes  (today, current session)
77031f06-a401-4f84-b0a8-4fc8ed69f776.jsonl      75,603 bytes  (today)

---

{
  "pid": 18364,
  "sessionId": "1fedb810-94c8-4ae1-95e5-033fb095c213",
  "cwd": "s:\\...",
  "startedAt": 1777557381494,
  "procStart": "...",
  "version": "2.1.123",
  "peerProtocol": 1,
  "kind": "interactive",
  "entrypoint": "claude-vscode"
}

---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Describe the bug

After a VS Code update, the Claude Code VS Code extension re-initialized its local state and wiped all files in ~/.claude/sessions/. The sessions panel is now completely blank. The actual conversation data (.jsonl files in ~/.claude/projects/) survived intact — only the sessions index layer was cleared.

This is distinct from #53717 (Desktop app, empty JSONL stubs). Here the JSONL files have full content (5.5 MB), but the index files that point to them are gone.

Environment

  • OS: Windows 11 Pro (10.0.26100)
  • Claude Code: VS Code extension (not Desktop app, not standalone CLI)
  • VS Code: updated prior to incident

Evidence / Investigation

All files under ~/.claude/ show the same reset timestamp (8:42 AM on the day of the VS Code update), indicating the extension re-initialized its entire local state:

~/.claude/sessions/        ← wiped; only one new file (294 bytes, current session)
~/.claude/.credentials.json
~/.claude/session-env/
~/.claude/shell-snapshots/
~/.claude/ide/

The ~/.claude/projects/<project>/ directory was not wiped:

deaab55a-b316-4e6f-a91c-2390d315603a.jsonl   5,749,117 bytes  (04/29)
1fedb810-94c8-4ae1-95e5-033fb095c213.jsonl     256,810 bytes  (today, current session)
77031f06-a401-4f84-b0a8-4fc8ed69f776.jsonl      75,603 bytes  (today)

The session index file format (from the surviving entry) is:

{
  "pid": 18364,
  "sessionId": "1fedb810-94c8-4ae1-95e5-033fb095c213",
  "cwd": "s:\\...",
  "startedAt": 1777557381494,
  "procStart": "...",
  "version": "2.1.123",
  "peerProtocol": 1,
  "kind": "interactive",
  "entrypoint": "claude-vscode"
}

Since the JSONL files are intact, --resume <session-id> via CLI would theoretically recover them, but the standalone CLI is not installed (VS Code extension only).

What Should Happen?

Session history should persist across VS Code updates. At minimum, the sessions panel should be able to reconstruct its list from the existing .jsonl files in ~/.claude/projects/.

On startup, if ~/.claude/sessions/ is empty but ~/.claude/projects/ contains .jsonl files, reconstruct the sessions index from the existing project files rather than starting blank.

Error Messages/Logs

Steps to Reproduce

  1. Use Claude Code VS Code extension on Windows with existing session history
  2. Apply a VS Code update and restart
  3. Reopen Claude Code panel — sessions history is blank

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.123

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

extent analysis

TL;DR

Reconstruct the sessions index from existing .jsonl files in ~/.claude/projects/ when ~/.claude/sessions/ is empty.

Guidance

  • Verify that the .jsonl files in ~/.claude/projects/ contain the necessary session data by checking their contents and sizes.
  • Consider implementing a fallback mechanism in the Claude Code VS Code extension to rebuild the sessions index from the .jsonl files when the ~/.claude/sessions/ directory is empty.
  • Check the extension's code for any logic that might be causing the sessions index to be wiped during VS Code updates.
  • Test the extension with different scenarios, such as updating VS Code with and without existing session history, to ensure the issue is resolved.

Example

No code example is provided as it would require modifying the extension's code, which is not explicitly mentioned in the issue.

Notes

The provided information suggests that the issue is specific to the VS Code extension and not the Desktop app or standalone CLI. The fact that the .jsonl files are intact but the sessions index is wiped indicates a potential issue with the extension's data management.

Recommendation

Apply a workaround by modifying the extension to reconstruct the sessions index from the existing .jsonl files when ~/.claude/sessions/ is empty, as this would allow users to recover their session history without requiring a full fix.

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 [BUG] VS Code extension wipes ~/.claude/sessions/ index on restart after VS Code update, clearing sessions panel history [1 comments, 2 participants]