[BUG] [Critical Data Loss] VSCode extension does not persist main conversation transcripts to disk
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?
The Claude Code VSCode extension stores main conversation transcripts only in memory, not on disk. Extension upgrades wipe this memory, causing complete and permanent data loss of all conversation history. Only subagent (Task tool) conversations are persisted to disk.
What Should Happen?
- Main conversation transcripts should be persisted to disk in session folders
- Expected file:
<session-uuid>/main.jsonlcontaining full conversation history - Conversations should survive VSCode restarts and extension upgrades
- Similar to how the CLI version persists conversations
Error Messages/Logs
Steps to Reproduce
- Install Claude Code VSCode extension (any version)
- Have conversations with Claude
- Note that session folders only contain
tool-results/andsubagents/ - Restart VSCode → conversations appear to persist (loaded from memory)
- Upgrade extension to new version
- All conversation history permanently lost
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.3
Claude Code Version
2.1.3
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
VSCode Extension Does Not Persist Main Conversation Transcripts to Disk
Summary
The Claude Code VSCode extension stores main conversation transcripts only in memory, not on disk. Extension upgrades wipe this memory, causing complete and permanent data loss of all conversation history. Only subagent (Task tool) conversations are persisted to disk.
Environment
- OS: Windows 10/11
- VSCode Version: Latest
- Claude Code Extension Versions Tested:
- v2.1.3 (current, rolled back from 2.1.30)
- v2.1.20 (previous working version)
- v2.1.30 (triggered the data loss)
- Project Path:
e:\repo\ai-assistant-assem-struct - Session Storage:
C:\Users\yiv\.claude\projects\e--repo-ai-assistant-assem-struct\
Issue Description
What Happened
- Extension auto-updated from v2.1.20 → v2.1.30
- After update, all previous conversation history disappeared
- Conversation titles changed from actual titles to generic "Claude Code"
- Rolled back to v2.1.3 - conversations still missing
- Investigation revealed conversations were never written to disk
Expected Behavior
- Main conversation transcripts should be persisted to disk in session folders
- Expected file:
<session-uuid>/main.jsonlcontaining full conversation history - Conversations should survive VSCode restarts and extension upgrades
- Similar to how the CLI version persists conversations
Actual Behavior
- No
main.jsonlfiles exist in any session folders (30+ sessions checked) - Only
subagents/*.jsonlfiles exist (with"isSidechain":true) - Only
tool-results/folders exist - Main conversations stored in memory only
- Extension upgrade wiped memory → complete data loss
Evidence
1. Session Folder Structure (All 30 Sessions)
C:\Users\yiv\.claude\projects\e--repo-ai-assistant-assem-struct\
├── 199fa9b3-e735-4d03-9e07-c936f994e9c8\ (current session)
│ └── tool-results\
├── 8404b0a2-1a45-400c-abc7-1af52c7f7ca1\ (recent session)
│ └── tool-results\
├── 4cc878ec-c436-410e-8ac0-3f3a2807ca84\ (largest session - 8.4MB)
│ ├── subagents\ (23 files, all with "isSidechain":true)
│ └── tool-results\
└── [27 more sessions - same structure]
Missing in ALL sessions: main.jsonl, conversation.jsonl, or any main transcript file
2. What IS Persisted
A. Subagent Conversations (subagents/*.jsonl):
{
"parentUuid": null,
"isSidechain": true,
"sessionId": "4cc878ec-c436-410e-8ac0-3f3a2807ca84",
"version": "2.1.20",
"agentId": "a0a7cc0",
"type": "user",
"message": {"role": "user", "content": "Search the codebase..."}
}
B. History Metadata (~/.claude/history.jsonl):
- Only user prompts (display text)
- Timestamps and project paths
- No assistant responses
C. Tool Results (tool-results/*.txt, *.json)
3. System-Wide Search Results
# Search for ANY main conversation files
find /c/Users/yiv/.claude/ -name "main.jsonl" -o -name "conversation.jsonl"
# Result: NO FILES FOUND
# All JSONL files are subagents
find /c/Users/yiv/.claude/projects/e--repo-ai-assistant-assem-struct/ -name "*.jsonl" -type f
# Result: 100% are in subagents/ folders with "isSidechain":true
4. Version Timeline
- Jan 10-29: v2.1.20 - Conversations appeared to persist (memory only)
- Feb 2-3: v2.1.30 - Auto-update caused all conversations to disappear
- Feb 3: Rolled back to v2.1.3 - Data still missing (memory already wiped)
5. Comparison with CLI Version
The CLI version creates proper session structure:
session-uuid/
├── main.jsonl ← MAIN CONVERSATION (missing in VSCode extension)
├── subagents/
│ └── agent-*.jsonl
└── tool-results/
Impact
Data Loss Scope
- 30 sessions with this project alone
- 8.4MB of subagent data preserved (proves tools were used extensively)
- 146 conversation entries in history.jsonl (only prompts, no responses)
- Months of work documented only in unretrievable memory
Example Lost Conversations
From history.jsonl, I asked about (responses lost):
- MCP tool loading and integration patterns
- Fixing authentication and password handling
- Refactoring agent code to be stateless
- Multi-phase implementation plans
- CRUD agent debugging and error analysis
- Test assertion fixes
- Code review and architectural decisions
Root Cause Analysis
- Design Flaw: Extension stores main conversations in memory (possibly in VSCode's
state.vscdbor similar) - No Disk Persistence: Only subagent conversations written to
*.jsonlfiles - No Migration Path: Extension upgrades don't migrate/backup in-memory data
- Inconsistent Architecture: Subagents persisted to disk, main conversations not
Why Rollback Didn't Work
- v2.1.30 wiped the in-memory conversation store during upgrade
- Rolling back to v2.1.3 reinstalled old code
- But the in-memory data was already gone
- v2.1.3 has nowhere to restore conversations from
Reproduction Steps
- Install Claude Code VSCode extension (any version)
- Have conversations with Claude
- Note that session folders only contain
tool-results/andsubagents/ - Restart VSCode → conversations appear to persist (loaded from memory)
- Upgrade extension to new version
- All conversation history permanently lost
Expected Fix
Short-term
- Persist main conversations to
<session-uuid>/main.jsonl(same format as CLI) - Write incrementally after each message exchange
- Load from disk on extension restart
Long-term
- Implement data migration for extension upgrades
- Add backup/export functionality
- Warn users before upgrades that may affect data
- Document data persistence behavior clearly
Workaround
Use Claude CLI instead of VSCode extension:
npm install -g @anthropic-ai/claude-code
claude
The CLI properly persists all conversations to disk.
Additional Context
Related Observations
- Developer Mode enabled: Conversation title initially displays correctly, then changes to "Claude Code" after extension loads (indicating failed session restore)
- No EPERM symlink errors found: These were red herrings - no symlinks exist in session folders
- All versions affected: v2.1.3, v2.1.20, v2.1.30 all have the same fundamental issue (no main conversation persistence)
Files to Inspect
For Anthropic developers investigating this:
- Extension's session manager code
- Where conversations are stored (likely in-memory or VSCode state DB)
- Subagent persistence logic (this WORKS correctly)
- Why main conversations aren't persisted like subagents
System Info
Working directory: e:\repo\ai-assistant-assem-struct
Platform: win32
Extension path: C:\Users\yiv\.vscode\extensions\anthropic.claude-code-2.1.3-win32-x64
Session storage: C:\Users\yiv\.claude\projects\e--repo-ai-assistant-assem-struct\
History file: C:\Users\yiv\.claude\history.jsonl (70KB, 146 entries)
Request
Please prioritize this as a critical data loss bug. Users are losing valuable conversation history with no warning and no way to recover it. The extension should persist conversations to disk like the CLI version does.
---
Diagnostic Session: 2026-02-03
Affected User: yiv
Data Loss: Months of conversations across 30+ sessions
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗