[BUG] Context usage percentage computed against 200K while session actually runs with 1M context ([1m] model variant)

Open 💬 1 comment Opened Jul 2, 2026 by RyutaOno-primcopurin

Environment

  • Claude Code version: 2.1.198
  • Platform: Linux (Debian-based container on WSL2, Docker sandbox)
  • Auth: first-party subscription (claude.ai login)
  • Model: claude-fable-5[1m] (set via /model, persisted in ~/.claude/settings.json as "model": "claude-fable-5[1m]")

Bug description

In an interactive session using a [1m] model variant, the context usage percentage exposed to the statusline (context_window.used_percentage) appears to be computed against the 200K window, not the effective 1M window.

Observed

  • The statusline used_percentage reached 100% when cumulative input tokens (input + cache read + cache creation) were around 200K (88.6% was shown at ~177K, consistent with a 200K denominator).
  • The session then continued normally well past 200K: a later manual /compact recorded preTokens: 219313 in the transcript compactMetadata, and there were no API errors before that.
  • Since requests above 200K input are only possible with the 1M context window, the effective window was 1M while the displayed percentage was 200K-based.

Expected

used_percentage (and any context-low warnings derived from it) should be computed against the effective context window of the session — 1M when the [1m] model variant is active.

Impact

  • Users see "100%" and assume imminent overflow while the real window is only ~20% used.
  • Expectations around auto-compact get miscalibrated: auto-compact (correctly) does not fire at ~200K in a 1M session, which at first looks like the auto-compact regression reported elsewhere (#65585), but is actually a display issue.

Steps to reproduce

  1. Select a [1m] model variant via /model in an interactive session.
  2. Fill the context past ~180K tokens (e.g. have Claude read several large files).
  3. Watch the statusline used_percentage reach 100% around 200K while the session keeps working fine beyond that point.

Additional question

Is CLAUDE_CODE_DISABLE_1M_CONTEXT still supported? Setting it to "1" in project settings env had no observable effect on 2.1.198 (both interactive and headless sessions exceeded 200K input regardless). If it was removed, it would be helpful to have that documented.

View original on GitHub ↗

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