Claude Code Changes Its Context Percentage
Claude Code 2.1.336 changes the status line's context percentage. See which window it measures and how to label a full-window figure.

Claude Code 2.1.336, released December 3, 2026, changes what its status line’s context percentage measures. In a local session with auto-compaction on, context_window.used_percentage now compares input tokens with the auto-compact window. Previously it compared them with the model’s full context window. If your custom status line labels that field “model context used,” update the label or calculate a separate full-window figure. Anthropic states the change in its release notes and status line documentation.
What changed in the percentage
The numerator remains context_window.total_input_tokens. Anthropic says this total combines fresh input, cache creation input and cache read input from the current context. The denominator depends on the local session’s auto-compact setting. The two percentages answer different questions, so a custom display should name the window it uses.
| Claude Code state | Denominator for used_percentage |
What the figure describes |
|---|---|---|
| Before v2.1.336 | context_window_size |
Share of the model’s full context window |
| v2.1.336, local session with auto-compact on | Auto-compact window | Share of the window before automatic compaction |
| v2.1.336, local session with auto-compact off | context_window_size |
Share of the model’s full context window |
This is a change in the reported percentage, not an announcement that the model gained a larger context window. The release notes also mention a message when automatic compaction gives up, but they do not establish a new universal compaction threshold or a speed improvement. A reader comparing percentages across versions should check the version and setting before interpreting the difference as a change in actual capacity.
The companion context_window.remaining_percentage is 100 minus used_percentage, according to the field documentation. When auto-compaction is on in a local session, a label such as “remaining until auto-compact” describes the documented denominator more clearly than “remaining model context.” If auto-compaction is off, the full-window label fits the documented calculation. The percentage is a status reading for the current context, not a promise that a specific number of messages will still fit.
Label the two windows separately
If you want the model’s full-window percentage after updating, Anthropic documents this calculation:
full-window percentage = context_window.total_input_tokens × 100 ÷ context_window.context_window_size
Use the fields in the status line’s input JSON. The denominator is context_window.context_window_size, not a fixed number copied from a model comparison chart. A custom line can show both figures with distinct names: the supplied used_percentage for the auto-compact window when it applies, and the calculated figure for the full model window. Do not silently substitute one for the other in an existing chart or alert.
Here is illustrative arithmetic, not a measured Claude Code session. Suppose the latest response reports 80,000 total input tokens and a 200,000-token full window. The full-window calculation is 80,000 × 100 ÷ 200,000 = 40%. If that same hypothetical session had a 160,000-token auto-compact window, the auto-compact calculation would be 80,000 × 100 ÷ 160,000 = 50%. The 160,000 figure is an assumption for this example, not a Claude Code default. The point is that the numerator can stay fixed while the displayed percentage changes because the denominator changed.
If you are choosing a model for a long document, the context windows explainer covers model capacity and why output needs room too. The context window checker can help plan a document against a stated window size. Neither replaces the session-specific status fields for showing when Claude Code will compact a live conversation. The AI model tracker is useful for checking published model specifications; it does not report your current session’s auto-compact boundary.
Handle the gap after compaction
The fields describe the live context from the most recent API response. Anthropic’s documentation says context_window.current_usage is null before a conversation receives an API response. After /compact, it may be null or contain all zeros until the next API call. A status line should treat those states as empty or pending. It should not turn them into a durable claim that the session uses no context.
For a display that breaks out input types, current_usage has input_tokens, cache_creation_input_tokens and cache_read_input_tokens. Anthropic defines total_input_tokens as their sum for the current context. Its total_output_tokens field describes output from the most recent response. Those are current-context readings, rather than a running bill for every request in the session. A percentage based on them cannot by itself tell you your account’s remaining subscription allowance or API spending.
The status line schema has separate rate_limits.five_hour.used_percentage, rate_limits.seven_day.used_percentage and, where available, spend-limit fields. Anthropic says the rate-limit fields can be absent, and the windows update independently. Put a clear label beside each if you show them. “Context until auto-compact,” “five-hour usage” and “seven-day usage” refer to different denominators. A reader deciding whether to shorten a prompt needs the context reading; a reader checking a plan allowance needs the applicable rate-limit reading. The Claude Pro versus Max guide explains plan limits separately from context capacity.
Check a status line after updating
First, confirm that the local Claude Code version is at least 2.1.336. Then inspect the JSON field your custom script actually reads. If it uses context_window.used_percentage or remaining_percentage, check whether auto-compaction is enabled in that local session. Name the displayed percentage for the denominator the field now uses. If you also want a model-window reading, calculate it from total_input_tokens and context_window_size, and give it a different label.
Finally, compare your labels with Claude Code’s /context view during an active conversation, after a response has populated the fields. That comparison can catch a mistaken label or an empty-state display. It is not a benchmark of compaction timing, token costs or model performance. We have not run a live upgrade or measured how a particular account compacts. The official change is enough to justify reviewing an existing custom status line; any alert threshold should be assessed against the actual fields in that user’s session.
Sources
- Claude Code v2.1.336 release notes — release change to
used_percentageandremaining_percentage. - Anthropic’s status line documentation — field definitions, denominator conditions, full-window formula and empty states.
All pages read on December 4, 2026.
Free toolWill my whole document fit?Check a document

