Compaction reports inflated cumulative token count and produces degenerate summary for tool-heavy sessions
Resolved 💬 3 comments Opened May 17, 2026 by OfficialDelta Closed May 20, 2026
Problem
The compaction banner reports an inflated, misleading token count ("Compacted from 3,656,675 tokens") that exceeds the model's actual context window (1M tokens) by 3.6x. The number appears to be cumulative session token usage rather than the context size at the time compaction fired.
Additionally, when the conversation is dominated by machine-generated tool calls/results (e.g. from an MCP-heavy agentic workflow), the compaction summarizer produces a degenerate summary: "No task was specified — the conversation is empty" — even when the session has been actively working for hours.
Expected Behavior
- The compaction banner should report the actual context window size at the time compaction fires, not cumulative session token usage. If cumulative is shown for informational purposes, it should be labeled as such.
- The summarizer should extract meaningful state from tool-call-heavy conversations, or at minimum preserve the most recent assistant reasoning/progress rather than defaulting to "empty."
Reproduction Context
- Model: claude-opus-4-6 (1M context window)
- Session type: Long-running agentic session with heavy MCP tool use (GSD workflow automation)
- Session duration: multi-hour
- Total units executed: ~1024 over the project lifetime
- The compaction fires and the summary reads "No task was specified" despite hundreds of completed work units
Impact
- Users see a number (3.6M) that doesn't correspond to any real limit, creating confusion about what triggered compaction
- The degenerate summary means the agent loses all context after compaction — it can't continue the task
- In automated/agentic workflows, this effectively kills the session since the agent has no idea what it was doing
Environment
- Claude Code (terminal CLI)
- Model: claude-opus-4-6
- Platform: Linux
---
Filed via GSD forensics analysis
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗