Context meter ~doubles during in-flight advisor tool call, reverts on cancel — forces premature compaction (Opus 4.7 [1m])

Resolved 💬 3 comments Opened May 22, 2026 by okas Closed Jun 26, 2026

Environment: Claude Code v2.1.148 · model claude-opus-4-7[1m] (1M context) · Windows 11 · advisor tool in use.

Symptom: During an in-flight turn, the context-usage indicator jumps from ~44% to ~87% (≈2×), then reverts to ~44% when the in-flight job is cancelled. Reproduced multiple times in a single session.

Suspected cause: Correlates with advisor tool invocations. The advisor tool forwards the entire conversation transcript to the advisor model; the ≈2× spike is consistent with the transcript being counted a second time as the in-flight forwarded payload. Because it reverts on cancel, it appears to be a transient/projected count rather than committed context.

Impact: On long sessions these transient spikes can hit the "Context low → use /compact or /clear" hard wall prematurely, forcing manual compaction while steady-state usage is far below the 1M window. (The same session also saw a forced compaction well below the 1M window.)

Expected: The usage meter and the compaction trigger should reflect committed context, not transiently double-count an in-flight forwarded payload.

Repro:

  1. Long session on Opus 4.7 [1m] (1M context).
  2. Invoke the advisor tool.
  3. Watch the context-usage meter spike (~2×).
  4. Cancel the in-flight job → meter reverts to its prior value.

View original on GitHub ↗

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