- Since 2.1.334, Claude Code compacts 1M-context models like Haiku 5.5 and Sonnet 5.5 near 400K tokens, but the status line's
used_percentagekept dividing by a million. At 352,362 tokens my 2.1.335 status line said 35% while/contexton the same screen said 88%, and the next prompt set off compaction. - 2.1.336, out 3 December, measures
used_percentageagainst the auto-compact window. The same 73K tokens now read 18% instead of 7%. In my runs the gauge never passed 88% before compaction, because compaction fires 33K tokens below the window and the status line only moves when a response comes back. - If your status line turns red at 80% or 90%, those colors can now fire, so retune them for your window. ccstatusline's main context widget follows the new field. claude-powerline 1.34.0 does its own math against the full 1M and still reads about 38% when compaction runs.
Claude Code 2.1.336 reached npm at 18:09 UTC on 3 December. One of its 182 changelog lines fixes the status line: used_percentage and remaining_percentage now count against the auto-compact window, the way /context already did.
The fix matters because of what happened two releases earlier. 2.1.334 moved the default compaction point for current 1M models (Fable, Sonnet 5 and later, Haiku 5.5) from the full million to near 400K tokens, to cut the cost of long sessions. The status line kept measuring against the million. If your session was on that window and you had a custom status line, your context gauge ran out of room at about 37%.
The rig
Status line commands only run in interactive sessions, so claude -p was no use. I drove real terminal sessions through a pseudo-terminal from a Python script: Claude Code 2.1.335 and 2.1.336 side by side, Haiku 5.5 on my subscription login, no MCP servers, project settings only, and a status line script that wrote every JSON payload it got to a log.
To fill the context I had the model read files of random dictionary words, about 18,700 tokens each, on top of a 35,600-token start for system prompt, tools and skills. After each turn the script typed /context and kept the screen.
Ten sessions with model calls came to $1.42 at list price by the status line's own cost field, nearly all of it the two runs that went past 350K and one Sonnet 5.5 run.
Two numbers on one screen
Each row is one session, read at the end of the same prompt in both versions.
| Run | Tokens in context | Status line | /context |
|---|---|---|---|
| 2.1.335, default | 73,039 | 7% | 73k/400k (18%) |
| 2.1.336, default | 72,977 | 18% | 73k/400k (18%) |
2.1.336, --autocompact 1M |
72,977 | 7% | 73k/1m (7%) |
| 2.1.336, 1M context off | 72,936 | 36% | 72.9k/200k (36%) |
| 2.1.336, Sonnet 5.5 | 72,204 | 18% | 72.2k/400k (18%) |
| 2.1.335, 17 files read | 352,362 | 35% | 352.4k/400k (88%) |
| 2.1.336, 17 files read | 352,300 | 88% | 352.3k/400k (88%) |
On 2.1.335 the status line and /context disagreed by a factor of 2.5 whenever the session was on the 400K window. On 2.1.336 they match in every case I ran.
The code change is small. I read both functions in the binaries. 2.1.335 divides the input tokens of the last response by the model's context window. 2.1.336 divides by the auto-compact window when auto-compact is on, and falls back to the full window when it's off. Both round and clamp to 0 to 100.
One thing didn't change: context_window_size still says 1,000,000 in every payload on a 1M model. The JSON has no field for the auto-compact window, so a script that wants it has to back it out from total_input_tokens and used_percentage, or hard-code the window you set.
It never gets to 100
The docs say a 400K session compacts at about 367K, and /context shows a 33K "Autocompact buffer". So even with the fix, a full gauge at the moment of compaction is about 92% on a 400K window, 97% at 1M, 84% at 200K and 67% at the 100K minimum.
In practice you see less. The status line updates when a response comes back. Claude Code decides to compact on its own estimate of the next request, before sending it.
In my 400K run on 2.1.336, the gauge sat at 88%. I asked for two more files. Claude Code made the tool calls, added about 37K tokens of results, put the conversation at 373,919 tokens in its compaction record and compacted before the next request went out. The status line went from 88% to 0 to 19%. On 2.1.335 the same sequence went from 35% to 0 to 8%.
With --autocompact 100k it was starker. The gauge read 55% on 2.1.336 (5% on 2.1.335), one file read later the session compacted, and it came back at 56%. Compaction kept the file it had just read, so a 100K window was more than half full again right after it ran.
The last number before compaction sits below the trigger by however much the next step adds. One large tool result covers most of a 33K buffer.
Compaction itself was close to instant on the two big runs, 8 and 10 milliseconds, marked as precomputed in the record: the summary was ready before it was needed. On the 100K runs it took 8.6 and 9.8 seconds.
Your status line package
If you installed a status line instead of writing one, it depends on the package. I read the two I run into most.
ccstatusline 2.2.34, about 25,900 downloads last week, uses used_percentage for its main context widget when the field is there. It changes with the update, no action needed.
claude-powerline 1.34.0, about 5,100 downloads, reads the field but displays its own "usable" figure: tokens divided by context_window_size minus a 33,000-token buffer. Its README says that number shows how close you are to compaction. On a 1M model on the default window, that's tokens over 967K, so at the 367K compaction point it shows 38%. Its context colors default to warning at 60% and critical at 80%, which a session on the 400K window never reaches before it compacts. Until it reads the new field, you can fake it: set autocompactBuffer to 633000, which leaves 367K as the usable window, so 100% lands where compaction does.
What to change
If you wrote your own status line around used_percentage, three things.
Retune the thresholds. A red at 90% on a 400K window gives you about one turn, if any. I'd warn at 70% and treat 85% as the moment to /compact on your own terms, before a large tool result forces it.
If you want the old meaning, the share of the model's full window, compute total_input_tokens * 100 / context_window_size yourself. The docs now say the same.
If you're still on 2.1.334 or 2.1.335 with a 1M model, your gauge reads 2.5 times low. Update, or divide by 400,000 instead of context_window_size. /autocompact with no value shows which window your session is on. The 400K default was still rolling out per account in 2.1.334, so yours may differ from mine.
What I didn't test
Sonnet 5.5 past 73K tokens, Opus and Fable. Cloud sessions, where the source only passes the window through when the service enforces it. The case where more than 180K of system prompt and tools raises the window. The desktop app and VS Code, which draw their own context indicator. Whether print mode compacts at 400K: claude -p "/context" on one of these sessions printed 73k / 1m (7%) for a conversation the interactive /context put at 18%.


