Context Calculation is Inaccurate
i'm throwing in the towel on the context consumption calculation. i've tried a dozen different approaches. none of them are working right. i need to tag someone else in. i have debug logs in place already, they will show the "context calculation" and the "display calculation" in the javascript logs when running npm run dev... if you start a new claude session and start stepping through basic message exchanges you'll see the context window jump up and down and just generally not be accurate. it'll show 100% (or more) when there is clearly plenty of context left. i've read all the docs, tried all the things. i'm just unable to get this working right... here's a collection of screenshots http://pedramamini.com/dropbox/maestro-claude-context-calculation-screenshots.zip
can you take a pause from refactoring and see what you can figure out here on Monday? i'd like for this to be fixed for 0.15.0 it's a pretty critical (and ostensibly simple) feature... i've even compared how we do it to how openclaw does it and still i can't get it working right. just doesn't make sense. if you look at my screenshots you'll see i have simple back and forth exchanges, then i'll ask it to do something like "analyze the FS structure" to force it to fill context. now it seems there's some automatic context clearing or compacting happening as it's not purely a linear growth, but it moves around. at the end of the day i'm getting stuck in situations like this depiction... which is just NOT accurate. and misleading users into wanting to compact conversations well before they need to.
It's wrong in group chat too:
Obviously it can't be more than 100% :-)
You might see how claude-powerline derives this data: https://github.com/Owloops/claude-powerline/blob/main/src/segments/context.ts
or even cc-sessions https://github.com/GWUDCAP/cc-sessions/blob/main/cc_sessions/javascript/statusline.js
Both are accurate enough in my experience.
@PwrBank thank you for this. I took a look at how a few other people implemented it and still am stuck in the mud. Hopefully @reachraza can shake something loose. In hindsight I'm wondering if my HMR disabling wasn't working meaning that as I was testing modifications were being taken in and adding confusion.
Merged from #246 (Context calculation incorrect in v0.15.0-rc)
Reported by @PwrBank:
Trying out the RC for v0.15 and now the calculations for the context are completely broken. After a single prompt and response context is showing full. Also seeing previous sessions that were not context 100% now showing 100% as well.
Closing #246 as a duplicate of this issue.
Closing as duplicate of #246 — debug context, screenshots, and community references have been merged into that issue (the original report).
@dmaynor need to close this.