Conversations with large first messages (images) are invisible in Past Conversations due to 64KB head buffer limit
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?
Conversations that include images (screenshots) in the first user message are invisible in the "Past Conversations" dropdown in the VS Code extension. The .jsonl session file exists on disk and is valid, but the conversation does not appear in the list.
Root cause: FR() in extension.js reads only 64KB (Hx = 65536) from the head of each .jsonl file. When the first user message contains base64-encoded images, the JSON line can be ~5MB, exceeding the buffer. The title extraction chain Gx(tail, "customTitle") || Gx(tail, "summary") || wR(head) fails because wR() receives truncated JSON and returns null. fetchSessions() then skips the conversation entirely.
What Should Happen?
All conversations should appear in "Past Conversations" regardless of message size. The extension should either stream-parse the first user message or write a summary/customTitle as a small separate line in the .jsonl file.
Error Messages/Logs
No error messages. The conversation is silently missing from the list.
Steps to Reproduce
- Open a folder in VS Code with the Claude Code extension
- Start a new chat
- Attach 2-3 screenshots (e.g. phone screenshots ~1125x2436) in your first message along with text
- Have a conversation with several exchanges
- Close the chat
- Click "Past Conversations" — the chat is not listed
- Verify the .jsonl file exists: ls ~/.claude/projects/-<encoded-path>/*.jsonl
- Check the first user message line size: it will be ~5MB due to base64 images, exceeding the 64KB buffer in FR()
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.59
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
Workaround: appending a small customTitle entry to the end of the .jsonl file (within the 64KB tail buffer) makes the conversation visible again:
{"type":"user","customTitle":"Chat title here","isSidechain":false}
The tail is read by the same FR() function with the same 64KB buffer, and Gx(tail, "customTitle") successfully extracts the title.
Suggested fixes:
- Increase head buffer or use streaming parse for oversized lines
- Always write customTitle/summary as one of the first small lines in the .jsonl
- Use a separate lightweight index instead of parsing each .jsonl on every load
7 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
⚠️ This is NOT a duplicate — the v2.1.47 fix (16KB→64KB) did not resolve this
I'm hitting the exact same bug on the latest version of the VS Code extension (v2.1.63). The buffer constant is still
fK = 65536inextension.js. I can confirm the root cause analysis in this issue is 100% correct.Important distinction: Issues #26140, #25920, #25721 were about the CLI
/resumepath with a 16KB buffer (eS$). That was fixed in v2.1.47 by @ashwin-ant (commitb757fc9). However, the VS Code extension has a separate code path (fetchSessions()→FW()→fK = 65536) that was never fixed — the buffer was already 64KB in the extension, and it's still 64KB in v2.1.63.My reproduction: no images needed — IDE context alone exceeds 64KB
The original report demonstrates this with base64-encoded screenshots. I want to add that images are not required — the VS Code extension itself injects large IDE context (
<ide_opened_file>,<system-reminder>, CLAUDE.md contents, auto-memory) into the first user message, routinely inflating it well beyond 64KB.Environment:
7 affected sessions from my project:
| Session ID | First
type:"user"line size | Visible? | Content ||---|---|---|---|
|
4855730f-...| 372 KB | ❌ Hidden | IDE context + user text ||
20fa070c-...| 1,008 KB | ❌ Hidden | IDE context + user text ||
69fa37ed-...| 114 KB | ❌ Hidden | IDE context + user text || 4 other sessions | 65–400 KB | ❌ Hidden | IDE context + user text |
None contain images. The inflation comes entirely from the extension's own context injection.
Code path in v2.1.63 (confirming it's unchanged)
LW(head)(the prompt extractor) triesJSON.parse()on truncated lines → fails silently → returnsnull→ session is invisible.Why increasing the buffer won't fix this long-term
The extension injects unbounded context into the first message — IDE selections, opened files, system reminders, CLAUDE.md, memory files. This will only grow as features are added. Bumping
fKto 1MB is a band-aid.Suggested fix: write a metadata header early in the .jsonl
When creating a new session, write a small metadata line as the 2nd or 3rd line (after
queue-operation):This guarantees
LW()always finds parseable content within the 64KB head, regardless of how large subsequent messages are. Minimal code change, maximum robustness.Workaround (fragile)
Manually appending a
summaryentry to the .jsonl tail:This works via
uK(tail, "summary"), BUT it's fragile — the extension continues appending data (subagent results, file-history-snapshots) which can push the summary outside the 64KB tail window, making the session invisible again. I've observed this happen in practice.---
@ashwin-ant This is a continuation of the buffer issue you fixed in v2.1.47. The 16KB→64KB increase resolved the CLI
/resumepath, but the VS Code extension'sFW()/fetchSessions()has the same class of bug — and it's triggered much more easily because the extension itself injects large IDE context into the first message. Still present in v2.1.63.@hackyon-anthropic This lives in the VS Code extension's
extension.js—fK = 65536inFW()and theLW()title extraction chain. An architectural fix (metadata header) would be more robust than bumping the buffer.cc @chrislloyd @vbhavsar (related: #26140, #25721, #25920)
I independently found the same issue on Windows 11 + VSCode extension v2.1.69.
In my case, the first user message contained a base64-encoded PDF (~2.3MB), making line 4 of the .jsonl file 2,361,422 bytes. The 64KB head buffer in
Ys()truncates this line,JSON.parse()fails, andTs()returns empty ? soUU()returns null and the session is excluded.As a temporary workaround, I changed
sV=65536tosV=4194304inextension.jsand the session appeared immediately.This issue is part of a family of ~20 bugs that all stem from the same root cause: the VS Code extension reads titles by raw-string-scanning the last 64KB of each JSONL file, which causes title eviction on long sessions, cross-session contamination from tool result content, and overwrite-on-resume.
See #33165 (comment: https://github.com/anthropics/claude-code/issues/33165#issuecomment-4070011372) for the full root cause analysis, all related issues collected, and a working workaround (persistent title registry + hook).
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This bug is still present in v2.1.108 and silently affects many users reporting "session loss".
I independently investigated disappearing sessions on Windows 11 / VS Code and traced it to the same 64KB
D2buffer inPp()→Yq4(). In my case, 22 out of 193 sessions were silently dropped — every single one had a first user message containing pasted screenshots with base64 data exceeding 64KB.Additional findings:
sessions-index.json(the CLI knows about them) but the VS Code extension'slistSessions()→Fd()→xZ4()→Cp()→Pp()chain drops them becausePp()returns nullWorkaround that works: Inject a
{"type":"ai-title","aiTitle":"..."}record after thequeue-operationlines at the top of each affected.jsonlfile. This puts the title within the 64KB head window. All 22 sessions reappeared immediately after VS Code reload.Suggested fix: Write the
ai-titlerecord early in the.jsonlfile (immediately after generating it), not just inline after the first assistant response. This would be a one-line change and permanently prevent the issue. Alternatively, increaseD2to 1MB, or fall back to a generic title instead of returning null.Closing this as "not planned" means every user who pastes screenshots in their first message permanently loses those sessions from the sidebar. Please reconsider.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.