Status line CTX after /compact reflects single-turn input, not steady-state context
Resolved 💬 3 comments Opened May 6, 2026 by bigdogla777 Closed May 10, 2026
Summary
The CTX: number shown in the status line immediately after /compact is misleadingly high. It reflects the input-token cost of the compaction turn itself (which includes a flurry of system-reminders re-injecting recent tool-call results), not the persistent post-compaction context floor.
Repro
- Run a session long enough to hit a few
Readcalls and accumulate context. - Run
/compact. - Observe the status line CTX number — for me it landed at 136K.
- Send any short follow-up message (e.g. "ok").
- Status line drops to 60K on the next turn with no other state change.
Expected vs actual
- Expected: After
/compact, the CTX number reflects the new compacted state (system prompt + project instructions + memory + tools + summary). Subsequent turns shouldn't shrink it further unless something else is freed. - Actual: The compaction turn itself bundles a large pile of system-reminders that re-inject file contents from recently called Read tools, plus the deferred-tool list, plus other one-shot reminders. Those tokens are real input cost for that turn but are not persistent. The next turn — which does not re-fire those reminders — drops to the actual steady-state floor.
In my case the gap was 136K vs 60K — a >2x overstatement of the persistent context budget.
Why this matters
Users use the CTX number to estimate "how much room is left." If it's inflated by ~76K right after /compact, the UX implies compaction did less than it did, and users might over-correct (e.g. running /clear instead of /compact, or re-compacting prematurely).
Suggested fix
Either:
- Option A: Show two numbers in the status line — "this turn" vs "persistent floor" (or just label the existing one clearly).
- Option B: On the
/compactturn specifically, suppress the one-shot reminders from the displayed CTX, or refresh the status line on the next turn so users see the steady-state number. - Option C: Document the behavior somewhere users will find it — but a number that needs explanation is itself the problem.
Environment
- Claude Code v2.1.131
- Platform: Linux (Pop!_OS, kernel 6.17.9)
- Model: Claude Opus 4.7 (1M context)
- Status line: custom token tracker (but the underlying CTX figure comes from the CLI)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗