VS Code extension: conversation content never persisted to session file — 'No conversation found' on reopen, only title/mode metadata written
Environment
- Claude Code version: 2.1.215
- Interface: VS Code native extension (
claude-vscodeentrypoint) - OS: macOS
Summary
A session tab in the VS Code sidebar failed to reopen with:
Error: Claude Code returned an error result: No conversation found with session ID: <session-id>
Investigation of the local session store (~/.claude/projects/<project-slug>/<session-id>.jsonl) showed the file was not missing or misplaced — it existed in the correct project directory, but contained only two bookkeeping lines, no actual conversation:
{"type":"ai-title","aiTitle":"Read initial session files","sessionId":"<session-id>"}
{"type":"mode","mode":"normal","sessionId":"<session-id>"}
The file's created and modified timestamps were identical — it was never written to again after creation, even though a real conversation with generated content had taken place in that tab.
A second session created in the same minute showed the same pattern, which suggests this isn't specific to renaming a tab, but affects message persistence more generally for certain VS Code-extension sessions:
{"type":"custom-title","sessionId":"<id2>","customTitle":"Milestone Audit"}
{"type":"custom-title","sessionId":"<id2>","customTitle":"Milestone Audit 1"}
{"type":"last-prompt","lastPrompt":"now, analyse the user experience and provide your complete analysis...","leafUuid":"<leaf-uuid>","sessionId":"<id2>"}
{"type":"custom-title","customTitle":"Milestone Audit 1","sessionId":"<id2>"}
{"type":"ai-title","aiTitle":"Review initial project context and files","sessionId":"<id2>"}
This file records a real user prompt (last-prompt) and multiple rename events (custom-title), proving the session was actively used — but it likewise contains zero type":"user" / type":"assistant" message entries. The leafUuid referenced in the last-prompt line does not appear as a message node in any .jsonl file anywhere under ~/.claude/projects/.
For comparison, sessions that resume/open correctly begin with queue-operation lines followed immediately by real type":"user" message entries, and their file size grows in step with the conversation.
What I checked to rule out other causes (none held the missing content):
~/.claude.jsonand its rotating backups in~/.claude/backups/— no reference to either session ID beyond what's in the stub files themselves~/.claude/sessions/*.json— these are just PID lock files for currently-running interactive processes, unrelated- VS Code's own
workspaceStorage/*/chatSessions/— no related entries (all pre-existing, unrelated, from a much earlier date) - No Time Machine local snapshot old enough to help
Expected behavior
Title/mode/last-prompt bookkeeping and the actual message stream should be persisted atomically (or the message stream should be the source of truth), so that a tab which recorded a real prompt and generated a real response cannot end up with a session file containing metadata only. At minimum, "No conversation found" should not be the failure mode for a session that visibly had content in the UI — the extension should either recover the in-memory transcript on save, or surface a clearer "conversation failed to persist" error rather than treating it as if the session never existed.
Impact
Silent loss of conversation content with no recovery path — the UI shows the tab as if the conversation was there (correct title, correct last-prompt preview in the sidebar in one case), but the underlying data was never written.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗