You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Statusline context percentage incorrect for Sonnet 4 #666
When using the statusline, the context percentage is showing very low, for example, the context could be shown as 130,000 tokens but the percentage could be 13%.
On inspection of the code, it looks just the litellm max_input_tokens is used verbatim. However, this is only available on the API usage and not the plan usage. Maybe we need to do a check for what plan is being used (if thats available or can be configured)
I believe its the same model and model id etc, however it seems if you use the API you have access to a 1000000 token window, however if you're on a plan, you only have access to a 200000 context window.
The current statusline still relies on hookData.context_window.total_input_tokens, which can diverge from /context and the actual current usage. That problem is covered by #823, and #923 is the active PR direction for fixing it, so I am closing this as a duplicate.
Activity
chrisbeardy commentedon Sep 26, 2025
I've noticed its just dividing it by 1000. Looks like there is a maths error somewhere.
chrisbeardy commentedon Sep 26, 2025
On inspection of the code, it looks just the litellm max_input_tokens is used verbatim. However, this is only available on the API usage and not the plan usage. Maybe we need to do a check for what plan is being used (if thats available or can be configured)
ryoppippi commentedon Sep 27, 2025
so what is the difference between claude-plan and claude model from api
chrisbeardy commentedon Sep 28, 2025
I believe its the same model and model id etc, however it seems if you use the API you have access to a 1000000 token window, however if you're on a plan, you only have access to a 200000 context window.
chrisbeardy commentedon Oct 4, 2025
as of today this appears to have corrected itself, but this is only because litellm for sonnet 4.5 has max tokens of 200000
[-]Statusline context percentage incorrect[/-][+]Statusline context percentage incorrect for Sonnet 4[/+]adstr123 commentedon Oct 18, 2025
I also get completely different values from ccusage on the statusline vs. the
/contextcommand that's now in CC.willma-andela commentedon May 13, 2026
This is still an issue
Would love a fix for this as I use this information to help me decide when to
/clearryoppippi commentedon May 17, 2026
The current statusline still relies on hookData.context_window.total_input_tokens, which can diverge from /context and the actual current usage. That problem is covered by #823, and #923 is the active PR direction for fixing it, so I am closing this as a duplicate.
willma-andela commentedon May 20, 2026
@ryoppippi you closed #923, so I think this should be reopened.