[BUG] /context header shows 0/1m (0%) post-compact + resume while breakdown sums to ~9%

Resolved 💬 1 comment Opened May 6, 2026 by tomaDev Closed Jun 3, 2026

Summary

After /compact followed by /exit and resume, /context shows 0/1m tokens (0%) in the header while the per-category breakdown reports a sane non-zero total (~90k loaded in my case). The two displays disagree by the entire used context.

This is the inverse direction of #50732 (header lower than breakdown sum) and a different surface than #53672 (status-line staleness after /compact). Filing separately because the symptom is /context itself, not the status line, and the header is under-reporting rather than over-reporting.

Reproduction

  1. Long session with the 1M context Opus 4.7 model (claude-opus-4-7[1m]).
  2. Run /compact and let it complete.
  3. Run /exit.
  4. Resume the same session (claude --resume <session-id>).
  5. Run /context.

Expected

Header Tokens: X / 1m (Y%) matches the sum of the per-category breakdown (or at minimum is non-zero when the breakdown is non-zero).

Actual

Header reports 0/1m tokens (0%). Breakdown lists:

⛁ System prompt:  9.8k tokens (1.0%)
⛁ System tools:   8.8k tokens (0.9%)
⛁ Custom agents:  2.2k tokens (0.2%)
⛁ Memory files:   13.5k tokens (1.3%)
⛁ Skills:         6.1k tokens (0.6%)
⛁ Messages:       49.4k tokens (4.9%)
⛶ Free space:     910.4k (91.0%)

Breakdown sums to ~90k (~9% used). Free space line corroborates the breakdown (910.4k free of 1M = ~90k used). Only the top-of-display header counter is stuck at zero.

A second /context invocation moments later shows the same 0/1m (0%) header while the breakdown reflects the additional /context output bytes — so the breakdown is being live-aggregated post-resume, but the header counter is not wired to the same source.

Environment

  • Claude Code: 2.1.129
  • Node: v25.9.0
  • OS: macOS 26.3.1 (Darwin 25.3.0)
  • Model: claude-opus-4-7[1m] (Opus 4.7, 1M context)
  • Plan: Max

Impact

Cosmetic — sending messages still works, free space is real. But:

  • /context is the planning tool for "do I need to compact"; a header pinned at 0% while the breakdown shows real usage breaks trust in either number.
  • Users may discount the breakdown believing the header, or vice versa, leading to either premature /compact or hitting the limit unexpectedly.

Suspected cause

Same class as #53672 — events that rewrite conversation state (/compact, session resume) don't trip the header-counter recompute path, while the breakdown aggregator is on a different (live) path. After /exit+resume, the header is initialized to zero and only a triggering event (new assistant message?) re-renders it.

Workaround

Send any message — the header recomputes on next /context.

Related

  • #50732 — /context header (76%) and breakdown (138.7%) disagree on resume (opposite direction)
  • #53672 — Status line not refreshed after /compact
  • Changelog 2.1.98 — Fixed /context Free space and Messages breakdown disagreeing with the header percentage (this report shows a residual case on 2.1.129)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗