VSCode extension drops sessions with large early base64 images from session picker
Bug Summary
Sessions that contain large base64-encoded images (screenshots) in early messages become completely invisible in both the VSCode extension session picker and the CLI /resume picker. There is no way to resume these sessions from the VSCode extension.
Root Cause
Both the CLI and VSCode extension read only the first 64KB and last 64KB of session .jsonl files to extract metadata (title, summary, first prompt). When a session's first user message contains a base64-encoded screenshot, that single JSON line can be 900KB+, pushing the ai-title entry (written after the first assistant response) far beyond the 64KB read window.
Concrete example from my session:
| Entry | Byte offset | In 64KB window? |
|-------|------------|-----------------|
| L0-L1: queue-operation headers | 0–278 | Yes |
| L2: first user message (896KB screenshot) | 278–917,788 | Only first 65KB captured |
| L7: ai-title | 925,468 | No — 14x beyond the 64KB window |
Code paths affected:
VSCode extension (extension.js):
mx6()reads first/last 64KB →qU6()extracts metadata →if (!W) return null→ session silently dropped from list- No fallback, no error logged, session completely invisible
CLI (cli.js):
lR7()reads first/last 64KB →kmY()extracts metadata →NmY()falls back to"(session)"label- Session may appear with generic "(session)" label but is easy to miss/not recognizable
What the user sees:
- Session worked fine during the conversation
- After closing, session disappears from both pickers
- VSCode extension: completely gone, no way to find it
- CLI:
claude --resume <full-uuid>still works (bypasses the picker), but user must know the UUID
Bug 2: VSCode extension has no resume-by-ID
The CLI has claude --resume <session-id> as an escape hatch. The VSCode extension has no equivalent — the session picker is the only entry point. When a session is dropped from the picker (as described above), there is no way to resume it from within the extension.
Steps to Reproduce
- Start a new session in VSCode extension or CLI
- Send a message that includes a large screenshot/image as the first user message
- Have a conversation (so the session gets an
ai-title) - Close the session
- Open the session picker — the session is missing
Environment
- Claude Code 2.1.92 (VSCode extension + CLI)
- Windows 11
- Session file: 14.1MB, 509 lines, 12 lines over 100KB (base64 screenshots)
Suggested Fixes
- Write
ai-titlebefore user content — if the title entry were written as one of the first few lines (before the user message), it would always be within the 64KB head window - Scan further when head contains image data — if the 64KB head contains
"type":"image", read additional chunks untilai-titleis found - Add resume-by-ID to VSCode extension — an input field or command palette entry (
Claude: Resume Session by ID) as an escape hatch - Store title in a sidecar index — write session titles to a separate lightweight index file that doesn't require parsing the full session
Workaround
Built an MCP server (session-manager) that scans up to 2MB per file using line-by-line streaming, correctly finding titles that the 64KB window misses. Available as a tool within conversations but still can't trigger a VSCode extension resume.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗