claude-code - 💡(How to fix) Fix [Bug] /context display shows >100% (190%) due to wrong denominator — output token budget used instead of input context window

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Root Cause (suspected)

Code Example

claude-sonnet-4-6
379.5k/200k tokens (190%)

Estimated usage by category:
  System prompt:    6.8k   (3.4%)
  System tools:    16.1k   (8.1%)
  MCP tools:        0.5k   (0.3%)
  Custom agents:    0.3k   (0.1%)
  Memory files:     3.5k   (1.7%)
  Skills:           0.6k   (0.3%)
  Messages:       350.8k (175.4%)
RAW_BUFFERClick to expand / collapse

Environment

  • Model: claude-sonnet-4-6
  • Platform: macOS 14.6 (darwin 24.6.0)
  • Claude Code CLI (desktop app)

Bug Description

/context reports token usage as 190% (379.5k / 200k) even though the session is still fully functional. The percentage exceeds 100%, which is impossible if the denominator is the actual context window.

Observed /context Output

claude-sonnet-4-6
379.5k/200k tokens (190%)

Estimated usage by category:
  System prompt:    6.8k   (3.4%)
  System tools:    16.1k   (8.1%)
  MCP tools:        0.5k   (0.3%)
  Custom agents:    0.3k   (0.1%)
  Memory files:     3.5k   (1.7%)
  Skills:           0.6k   (0.3%)
  Messages:       350.8k (175.4%)

The autocompact warning also fires: "Context is 190% full" — while the session is still alive and responding normally.

Expected Behavior

The denominator should be the input context window size for the model, not the output token budget. A value above 100% should not be possible in a functioning session.

Root Cause (suspected)

The 200k denominator appears to be Sonnet 4.6's max output token limit, not its input context window. The percentage calculation divides total accumulated tokens by the output cap, producing misleading values well above 100%.

Impact

  • /context percentage is useless as a capacity signal — it shows >100% while the session works fine
  • The autocompact threshold warning triggers based on this wrong percentage, firing prematurely
  • Users have no reliable way to gauge actual context pressure from the display

Related

  • #63627 — different symptom (autocompact not firing at configured threshold on 1M Opus) but same general area: context window accounting is unreliable

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] /context display shows >100% (190%) due to wrong denominator — output token budget used instead of input context window