Context remaining not working on Claude code 2
Hey- been a faithful user since launch- with the switch to Claude code 2 I'm noticing the context remaining percentage no longer decrements as it used to.
Noticed it as well
Can you provide more details on what's happening, your OS, and your ~/.config/ccstatusline/settings.json file contents? I'm on macOS, and as soon as I start interacting with claude I see both the Context, Context %, and Context % (Usable) widgets all updating.
The only main difference I noticed is /context now shows 45k tokens reserved for autocompact, so the total 'usage' shown by /context is 45k higher than my statusline shows, because they are including the reserved tokens in the count.
If possible, a small video of your terminal showing a fresh session with the statusline visible with the context widgets displayed, then submit a prompt and let it run for a bit, then show the ouput of /context.
similar problem for me - i'm also zsh on ubuntu
I think it's an ohmyzsh theme conflict. It's all good in bash on the Linux. On Mac I have themed ohmyzsh and might be conflicting. Still investigating.
I have zsh and omz and in 2.x CC it does not move (Ctx: 91.1k | Ctx: 45.6% | Total: 29.0M |) Cost is changing ok
@williavs @tdi Can you test if the issue persists if you disable omz?
The code for this isn't something that should be affected, it's simply parsing the jsonl file passed in via the statusline json. If you see context numbers at all, they should continue to update unless something is up with the transcript file.
One thing you can try is adding a "custom command" widget and set the command to cat > log.txt, save it, run Claude, try a few requests, then send me the log.txt, and the jsonl transcript for that session referenced in the log.txt. Make sure to remove the custom command after so you don't keep getting a log.txt showing up.
Maybe something in the jsonl for your account is different than what I'm seeing on my account, causing the issue. The only thing I can think is the timestamp not sorting correctly, so it doesn't pick up the most recent message. The jsonl you send should help determine if that's the case.
@sirmalloc here is the log.txt. Tested on zsh -f without any config, tmux on and off - still does not update. Tested on bash too and terminal different than ghostty.
EDIT: I just noticed something weird. /usage command does not work for me.
{"session_id":"0adfcb0c-ed77-476e-845b-35b6beb6ee6b","transcript_path":"/Users/darek/.claude/projects/-Users-darek-Projects-securemcp/0adfcb0c-ed77-476e-845b-35b6beb6ee6b.jsonl","cwd":"/Users/darek/Projects/securemcp","model":{"id":"claude-sonnet-4-5-20250929","display_name":"Sonnet 4.5"},"workspace":{"current_dir":"/Users/darek/Projects/securemcp","project_dir":"/Users/darek/Projects/securemcp"},"version":"2.0.5","output_style":{"name":"default"},"cost":{"total_cost_usd":0.21642670000000003,"total_duration_ms":172569,"total_api_duration_ms":72390,"total_lines_added":0,"total_lines_removed":0},"exceeds_200k_tokens":false}
@tdi if you are able to send a copy of this file: /Users/darek/.claude/projects/-Users-darek-Projects-securemcp/0adfcb0c-ed77-476e-845b-35b6beb6ee6b.jsonl, and confirm that during that session the context was failing to update, that would be helpful. That would let me inspect the timestamps and determine if something changed in the jsonl format that might be impacting this on your system. I'm unable to replicate locally, my context counts properly the entire session for me. The calculations are solely based on that jsonl, so that's likely the key.
@sirmalloc Thanks for ccstatusline and your responsiveness.
Initially with the CC2 launch, my Ctx (u) counter was zeroed out no matter where the context was.
In the past 24 hours, it has started to report values/percentages, but they're way off what the /context slash-command indicates. (At the moment, /context reports I'm at 90%, while ccstatusline is reporting 35.0%.)
Happy to share logs, etc. with you if it would help resolve, but would prefer not to post to GH.
@sirmalloc Thanks for ccstatusline and your responsiveness.
Initially with the CC2 launch, my Ctx (u) counter was zeroed out no matter where the context was.
In the past 24 hours, it has started to report values/percentages, but they're way off what the
/contextslash-command indicates. (At the moment,/contextreports I'm at 90%, while ccstatusline is reporting 35.0%.)Happy to share logs, etc. with you if it would help resolve, but would prefer not to post to GH.
@TimHolahan Can you send a screenshot showing the /context output while the statusline is visible, and send a copy of the ~/.config/ccstatusline/settings.json?
@sirmalloc Emailed.
@sirmalloc whoopsie.
I am pretty always 100% time on thinking on
Thinking on:
Thinking off:
@tdi @TimHolahan I just published v2.0.20 that has a PR related to parsing of the jsonl transcript files, not sure if it's related to this but please test the latest version and let me know if it's still having issues with the context.
@sirmalloc it works after /clear. Thanks !
Closing this as resolved in v2.0.20, please comment if anyone is still experiencing this issue.
Yay - reinstalled to CC2 today and working just as before! thanks for fixing that $$$
This is still broken for me
context calculation is not correct
I'm having the same issue. I don't think the token values are right either.
same here. the token usage that /context shows 122K used whereas ccstatusline shows 75.4K. back of the napkinmath tells me that it might be not counting the "autocompact buffer" of 45K and the MCPtools of 1.3K for me? something doesnt quite add up?