Auto-compact fires at ~1M tokens on large-context models (~24% of window) — silently, with no user notification

Status Open
Reported on v2.1.170
Maintainer reply None cached
Activity 0 comments · opened Aug 28, 2026

Summary

Auto-compact fired at ~999k tokens on a large-context model (claude-fable-5) whose context meter showed only ~24% used. The compaction was silent — no notification to the user before or after — and the injected summary header falsely told the model the conversation "ran out of context." A multi-day working session's full context was destroyed while ~76% of the window was still free.

Environment

  • Claude Code 2.1.170, Windows 11 Pro (10.0.26200), PowerShell/Git Bash
  • Model: claude-fable-5 (large context window)
  • Long-running interactive session in a git worktree, spanning 2026-08-26 → 2026-08-28 (session kept open across days, with usage-limit pauses and resumes)

Evidence (from the session transcript .jsonl)

"compactMetadata":{"trigger":"auto","preTokens":999438,"durationMs":131272,...}
"isCompactSummary":true
"subtype":"compact_boundary"
  • trigger: "auto", preTokens: 999438 — i.e. auto-compact fired at almost exactly 1M tokens.
  • The user's context meter in the UI read ~24% used at the time. 999,438 tokens ≈ 24% of a ~4M-token window, consistent with the model's actual capacity.
  • The injected continuation header stated the session "ran out of context" — presented to the model as fact, and false.

What seems to be happening

The auto-compact trigger threshold appears to be anchored to the ~1M context budget of smaller-context models rather than scaling to the active model's actual context window. On a ~4M-window model it therefore fires at ~24% utilization.

Expected behavior

  1. Auto-compact should not fire until the model's actual context window is near exhaustion.
  2. The user should be notified when compaction occurs (it is currently invisible unless the model happens to mention it).
  3. The injected summary should not assert "ran out of context" when the trigger was an unrelated threshold.

Impact

The session lost verbatim context for ~23 carefully force-read project files mid-task (a project with a strict read-in-full discipline), silently. The user only discovered it days later when the model's answers revealed the loss, and a full re-read had to be performed. For long-context models, this defeats the primary value of the larger window.

Repro sketch

  1. Start an interactive session on a large-context model.
  2. Accumulate ~1M tokens of conversation (well under the model's window).
  3. Observe auto-compact fire ("trigger":"auto" in the transcript) with no UI notification, while the context meter shows the window mostly free.

View original on GitHub ↗