used_percentage uses wrong context window size for 1M context models

Resolved 💬 8 comments Opened Mar 26, 2026 by jackle1127 Closed May 24, 2026

Bug Description

The used_percentage field in the status line JSON is calculated against the wrong context window size for the claude-opus-4-6[1m] model (1M context). It appears to use ~113k (standard Opus context) as the divisor instead of 1,000,000.

Steps to Reproduce

  1. Use Claude Code with claude-opus-4-6 model and 1M context enabled
  2. Enable a status line that displays used_percentage from the context window stats
  3. Observe that at ~77k tokens, the percentage shows ~68% instead of the expected ~8%

Expected Behavior

77k tokens out of a 1M context window should report ~8% usage.

Actual Behavior

77k tokens reports 68% usage, consistent with dividing by ~113k instead of 1,000,000.

Environment

  • Claude Code on Windows 11
  • Model: claude-opus-4-6[1m] (Opus 4.6 with 1M context)
  • Status line reads the pre-calculated used_percentage field from the context window JSON

View original on GitHub ↗

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