[BUG] VS Code: Context compression not recorded in JSONL causing silent message loss and self-contradiction

Resolved 💬 6 comments Opened Mar 21, 2026 by bmoody-seismic Closed May 19, 2026

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?

Context compression happens mid-session but is never written to the JSONL session log
as a summary event. This causes:

  1. Messages disappear from the chat UI — tool calls, todo completions, and code edits

the user watched happen in real time vanish when scrolling back up

  1. Claude contradicts its own earlier work — says "I haven't implemented that yet" for

things it completed minutes earlier, because the compressed-out context included the work

  1. TodoWrite updates that were visible (tasks progressing in_progress → completed)

collapse to only showing the first entry

Previously, a compression indicator block appeared in the UI showing where context was
trimmed. That no longer appears.

What Should Happen?

  1. Compression events should be written to the JSONL as summary type entries (like they were previously)
  2. The UI should render a compression indicator where messages were trimmed
  3. At minimum, tool output that the user observed (TodoWrite state changes, code edits) should have a visible marker showing "content was here but was compressed"

Error Messages/Logs

No errors — the issue is silent. Examined two affected session JSONLs and found:

Session bd5bf724 (1,034 lines):
- progress: 510, assistant: 239, user: 153, file-history-snapshot: 83, 
  queue-operation: 48, ai-title: 1
- summary events: 0

Session 74f82ecc (149 lines):
- summary events: 0

Zero summary events in either session despite compression clearly occurring.

Self-contradiction evidence (session bd5bf724):
- Lines 233-837: Multiple TodoWrite calls progress tasks in_progress → completed
- Line 996: Claude states "All of this is already implemented" only after user 
  challenged it — Claude initially didn't remember doing the work

Steps to Reproduce

  1. Open Claude Code in VS Code extension
  2. Start a session with multiple implementation tasks (enough to approach context limits)
  3. Watch as Claude creates todos, completes them, edits files
  4. Continue the session until context compression occurs
  5. Scroll back up — messages from the middle of the session are gone,

no compression indicator shown

  1. Ask Claude about work it did earlier — it may not remember doing it

Session IDs available for inspection:

  • bd5bf724-f138-4422-8739-be3afef31721
  • 74f82ecc-3572-4636-b9d2-34e62a4bd33c

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.81

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Platform: Windows 11 Enterprise 10.0.26100
Model: Claude Opus 4.6 (1M context)
Both sessions were in the VS Code extension, not CLI.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗