Context meter ~doubles during in-flight advisor tool call, reverts on cancel — forces premature compaction (Opus 4.7 [1m])
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:
- Long session on Opus 4.7
[1m](1M context). - Invoke the
advisortool. - Watch the context-usage meter spike (~2×).
- Cancel the in-flight job → meter reverts to its prior value.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗