Claude TokenUsagePercent is out of sync #7235
Replies: 6 comments
-
|
@MelGrubb unfortunately we do not control when claude refreshes the statusline and injects new data. You could add |
Beta Was this translation helpful? Give feedback.
-
|
It's not that simple. I had Claude observe raw numbers and its best guess is that there are two problems. It appears that the gauge is adding InputTokens to OutputTokens and dividing by context size to come up with its value, but Claude's own calculation doesn't count output tokens. It does, however, include things like system prompt size, tools, agents, memory files, and skills, subtracting them as overhead from your overall context size. I don't know if those are visible to you or not, but they play into Claude's internal context usage calculations. So, the gauge and string properties would need to be something more like |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
The docs show "used_percentage" as an option. I think that would put all the math back on Claude's shoulders. It had better be accurate at that point, I would think. |
Beta Was this translation helpful? Give feedback.
-
|
I really think this needs to go back to being a bug. The "out of sync" issue is worse than simply lagging or leading. This is my status line this morning. Obviously the fonts aren't going to work here, but you get the point. Despite multiple compactions and /clears, the token usage percent just keeps climbing forever. Whatever math this segment is doing, it's not working. I think using claude code's own "used_percentage" might be more correct. I can't see what you're seeing under the covers though. |
Beta Was this translation helpful? Give feedback.
-
|
It's fixed now in master. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Code of Conduct
What happened?
I've been working with the Claude Code support for a day or two, and I'm noticing that after issuing a
/clearor restarting Claude Code, the context percentage doesn't seem to update. Calling/contextshows that I'm on a fresh, empty context, but the gauge and text percentage are still showing that I'm at like 80%. I've run several commands in the last half hour, and it's just not catching up.Theme
Stock theme with only minor adjustments to the segment layout.
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output
Beta Was this translation helpful? Give feedback.
All reactions