claude-code - 💡(How to fix) Fix [BUG] Local session history disappears after VS Code restart [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#54186Fetched 2026-04-29 06:33:58
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

Root Cause

This creates a major usability issue because session names are not reliable identifiers, making it difficult to locate and resume previous work.

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?

Sessions listed under Local → Session History are not persistent across restarts of Visual Studio Code.

While working, sessions appear correctly in the dropdown. However, after closing and reopening VS Code, some sessions disappear from the list even though they still exist and can be resumed manually using:

claude --resume <session-id>

This creates a major usability issue because session names are not reliable identifiers, making it difficult to locate and resume previous work.


Expected Behavior

  • All previously created local sessions should persist
  • Session history should remain consistent after restart
  • UI should reflect all available sessions accurately

Actual Behavior

  • Some sessions are missing from the Local session list after restart
  • Sessions still exist and can be resumed via CLI
  • UI does not reflect the actual session state

Environment

  • VS Code Version: 1.113.0
  • OS: macOS (Darwin arm64 25.0.0)
  • Electron: 39.8.3
  • Node.js: 22.22.1
  • Claude Code Extension Version: (fill this)

Additional Context

  • Issue appears intermittently (not always 100% reproducible)
  • Affects workflow continuity significantly
  • Requires manual recovery using session IDs

What Should Happen?

What Should Happen?

  • All sessions created under Local → Session History should persist after restarting Visual Studio Code
  • The session list should remain consistent and not lose entries across restarts
  • Previously created sessions should be visible and selectable without requiring manual CLI recovery
  • The UI should accurately reflect all existing local sessions at all times

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Open Visual Studio Code
  2. Start multiple sessions using Claude Code extension
  3. Confirm sessions are visible under Local → Session History
  4. Close VS Code completely
  5. Reopen VS Code
  6. Open the session dropdown again

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.121 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The issue can be mitigated by ensuring that the session data is properly persisted and loaded by the Claude Code extension in Visual Studio Code.

Guidance

  • Verify that the session data is being stored in a persistent location, such as a file or database, and that the Claude Code extension is configured to load from this location.
  • Check the extension's settings and configuration to ensure that session persistence is enabled and properly configured.
  • Investigate the extension's code to determine if there are any issues with loading or saving session data, particularly when the VS Code application is restarted.
  • Consider adding logging or debugging statements to the extension to help diagnose the issue and understand what is happening to the session data when VS Code is restarted.

Example

No specific code example can be provided without more information about the extension's codebase, but ensuring that session data is properly loaded and saved using a persistent storage mechanism is key.

Notes

The issue appears to be intermittent and may be related to the specific version of the Claude Code extension or VS Code being used. Further investigation and debugging are needed to determine the root cause.

Recommendation

Apply workaround: The best course of action is to investigate and address the issue with session persistence in the Claude Code extension, as upgrading to a fixed version is not currently an option due to the lack of information about a specific fixed version.

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