[BUG] Chat history lost on VSCode restart - session files not saved (macOS)

Resolved 💬 3 comments Opened Dec 13, 2025 by gonta223 Closed Dec 16, 2025

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?

Chat history is completely lost every time VSCode is restarted, even though session IDs are logged correctly. Session files are never created on disk.

Note: This appears related to #9258, but occurs with different trigger (VSCode restart vs tab close) and different environment (macOS local vs Ubuntu SSH).

What Should Happen?

Chat sessions should persist across VSCode restarts. Session files should be saved to disk in the workspace storage directory.

Error Messages/Logs

No error messages are displayed. The issue is silent - users only discover it when trying to resume work after VSCode restart.

From extension logs (~/Library/Application Support/Code/logs/.../Claude VSCode.log):

2025-12-13 15:29:13.750 [info] Resuming session: aafd3708-d769-4216-9d1f-b97ddfef8fa6

Session ID is logged, but no corresponding file exists on disk.

Steps to Reproduce

  1. Open VSCode with Claude Code extension
  2. Start a chat session with Claude Code
  3. Have a conversation (any length)
  4. Close VSCode completely
  5. Reopen VSCode
  6. Try to access chat history
  7. Observe that all chat history has disappeared

Frequency: 100% reproducible on every VSCode restart

Technical Investigation

Expected Session Storage Location
~/Library/Application Support/Code/User/workspaceStorage/{workspace-id}/chatSessions/
Workspace Storage ID

e7425838a1a215c9b325c4564c3768a4

Actual Files Found
$ ls -la ~/Library/Application\ Support/Code/User/workspaceStorage/e7425838a1a215c9b325c4564c3768a4/chatSessions/
total 8
-rw-r--r--  1 user  staff  267 Dec  2 21:57 2b170d9d-8bd7-40b5-881f-b801a041a759.json

Only one old session from Dec 2nd exists. Current session ID aafd3708-d769-4216-9d1f-b97ddfef8fa6 has no corresponding file.

Search Results
$ find ~/Library/Application\ Support/Code -name "*aafd3708*"
# No results

Root Cause Analysis

Session metadata is logged, but session files are never written to disk:

  1. Claude Code creates session in memory ✅
  2. Session ID is generated and logged ✅
  3. Session file is NOT saved to chatSessions/ directory
  4. On VSCode restart, no session file exists to resume ❌

This means the session persistence mechanism is completely failing to write files.

Claude Model

Sonnet 4.5

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.65

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Comparison with #9258

This issue appears related to #9258 but has key differences:

| Aspect | #9258 | This Issue |
|--------|-------|------------|
| Trigger | Tab close/reopen | VSCode restart |
| Environment | Ubuntu 24.04 + SSH | macOS 15.5.0 (local) |
| Version | 2.0.12/2.0.13 | 2.0.64/2.0.65 |
| Architecture | - | arm64 (Apple Silicon) |

Impact
  • Severity: High - Makes VSCode extension unusable for any work spanning multiple sessions
  • Workaround: None - all chat context is permanently lost
  • User Experience: Users must re-explain context after every VSCode restart
Environment Details
  • macOS Version: 15.5.0 (Darwin 24.5.0)
  • VSCode Version: 2.0.64
  • Claude Code Version: 2.0.65
  • Architecture: arm64 (Apple Silicon)
  • Authentication: Anthropic API
Notes
  • No MCP server configuration issues
  • No authentication errors
  • Git operations work normally
  • Other VSCode extensions work normally
  • Only Claude Code chat history is affected

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗