ccstatusline icon indicating copy to clipboard operation
ccstatusline copied to clipboard

Context bar widget assumes context window is 200k

Open wwp opened this issue 5 months ago • 2 comments

The context bar widget that shows token metrics presumes that the window size is 200k, whereas it can be different (by default Opus 4.6 has it to 1M, but users can change that in the environment). Here this widget often shows 750k/200k (bar is full since a long time) and is pretty useless if shown without numbers.

wwp avatar Jun 12 '26 22:06 wwp

Looked into your issue — there's a real finding here, but it's narrower than the title suggests.

ccstatusline already reads the true window from Claude Code's status JSON (context_window.context_window_size) when it's present, so on a current Claude Code the bar shows the right denominator (e.g. 750k/1.0M). The 750k/200k shows up when Claude Code doesn't send that field — older versions don't, and ccstatusline then falls back to a hard-coded 200k.

@wwp — which Claude Code version are you on? If it's not current, updating may already fix it (and would confirm the cause).

Either way, the hard-coded 200k is worth making user-configurable. I've got a small change that does that — a CCSTATUSLINE_CONTEXT_SIZE_FALLBACK env var (default 200000).

CorticalCode avatar Jun 24 '26 00:06 CorticalCode

@CorticalCode: with everything up-to-date I now see a 1000k denominator anyway with Opus and 200k with Sonnet, IOW that works fine. Thanks for CCSTATUSLINE_CONTEXT_SIZE_FALLBACK anyway.

wwp avatar Jun 24 '26 07:06 wwp