VS Code extension: "teleport" repeatedly creates empty local session stubs (messageCount: 0), shadowing real session history
Environment
- Claude Code VS Code extension, version 2.1.226 (entrypoint
claude-vscode) - Windows 11
- Project opened at repo root, single folder (not multi-root, not a worktree)
What's happening
Every time VS Code is closed and reopened on the same project folder, a new local session file is created under ~/.claude/projects/<encoded-project>/<new-uuid>.jsonl whose entire content is just:
{"type":"teleported-from","remoteSessionId":"session_XXXXXXXXXXXXXXXXXXXXXXXX","messageCount":0}
No actual messages are ever written into these files. Over 4 days (Aug 7-Aug 11) I observed 6 such empty stub files created, referencing only 2 distinct remoteSessionId values that repeat across separate VS Code restarts - i.e. the same remote/cloud session record is repeatedly "teleported" locally on every restart, but its message content is never actually pulled down.
Impact
Because these stub files have the most recent mtime, they sort to the top of / show up in the Session History panel ahead of the real, fully-populated session files. Selecting one of them to resume fails with:
Error: Claude Code returned an error result: No conversation found with session ID: <uuid>
This makes it hard to find and resume genuine prior conversations from the VS Code panel - the real session data is intact on disk (verified: multiple .jsonl files in the same project folder with full conversation content and hundreds of KB-MB of data), but the broken empty stubs shadow them.
Steps to reproduce
- Use Claude on claude.ai (web) periodically for unrelated requests, while also using the Claude Code VS Code extension on a local project.
- Have a real conversation in the VS Code extension (produces a fully-populated session .jsonl).
- Close VS Code entirely.
- Reopen VS Code on the same project folder.
- Inspect ~/.claude/projects/<encoded-project>/ - a brand-new .jsonl appears containing only the teleported-from stub with messageCount: 0.
- Repeat steps 3-5 across several restarts - a new empty stub is created each time, referencing the same 1-2 remoteSessionId values already seen.
Expected behavior
Either the teleport should actually populate the local session with the remote messages, or - if the teleport/sync fails - no empty stub file should be created, and/or empty stub sessions (messageCount: 0) should be filtered out of the Session History UI so they don't shadow real, resumable sessions.