VS Code extension: sessions not saved, history tab clears current chat, and history shows empty sessions

Resolved 💬 1 comment Opened Jun 8, 2026 by RehasLiamsi Closed Jun 18, 2026

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?

Environment

  • Claude Code VS Code extension
  • OS: Linux (Ubuntu)

Bugs

  1. Sessions are not being saved

Completed chat sessions do not appear in the history panel and no corresponding
.jsonl files are created under ~/.claude/projects/<project>/

  1. Sessions only saved when Claude accesses the session directory mid-conversation

The only sessions that were saved are ones where Claude ran filesystem commands
against ~/.claude/projects/ during the conversation (e.g. ls, cat on session files).
This suggests that accessing the session directory mid-conversation triggers an
unintended flush/save as a side effect — not normal intended save behavior.

  1. Clicking the history tab clears the current chat

As soon as the history tab is opened, all messages in the currently active chat
disappear from view.

  1. Sessions in the history panel show no messages

Clicking on any session in the history panel displays an empty chat — no messages
are rendered even when the underlying .jsonl file exists on disk with correct content.

What Should Happen?

  1. All sessions should be continuously saved to disk and appear in the history panel
  2. Sessions should only be saved due to normal session lifecycle events, not as a

side effect of filesystem access

  1. Clicking the history tab should not affect the currently active chat session
  2. Selecting a session in the history panel should render all its messages from the

corresponding .jsonl file on disk

Error Messages/Logs

No visible error messages. The chat silently clears and the history panel silently 
shows empty sessions with no error output.

Steps to Reproduce

For bug 3 & 4:

  1. Start a chat session in the VS Code extension and exchange several messages
  2. Click the history tab/button in the chat panel
  3. Observe: all messages in the current chat disappear from view
  4. Click on the current session in the history panel
  5. Observe: the session shows no messages despite the .jsonl file existing on disk

For bug 1:

  1. Start and complete multiple chat sessions in the VS Code extension
  2. Close each session normally
  3. Check ~/.claude/projects/<project>/ — most session .jsonl files will be missing
  4. Only sessions where Claude ran ls/cat commands on ~/.claude/projects/ during the

conversation will have corresponding .jsonl files on disk

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.168

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Related issue: #59202 (VS Code webview discards sessionID on re-deserialization).
Bug 3 & 4 may share the same root cause — clicking history triggers a webview
re-render which discards the sessionID, orphaning the current session.

Bug 1 & 2 appear to be unreported and may be a separate issue where sessions are
only flushed to disk when the project directory is accessed, rather than on a
normal save/close lifecycle.

Verified: the surviving .jsonl file contains correct content (confirmed by reading
it directly), so the issue is in session lifecycle management and UI rendering,
not data corruption.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗