[Feature Request] Expose how much context is left before auto-compact
Description
At some point, Claude Code starts to warn you about the context getting too long and how much percentage is left before auto-compact. It would be nice to be able to have a command that exposes that percentage on command. (Maybe add it to the /cost response or something(?))
I want this badly too.
It would be great if Claude had awareness of this as well. Would give it a chance to update memory before it gets brainwashed.
+1
I too, am curious why this information is not available. I need a hook into it to remind claude to perform context recovery.
I was planning to open a feature request about this, and here we are.
Gemini counts down the context from the very start, starting from 100% context left, and goes downwards from there.
I wish Claude Code also did something like this, particularly because it's hard to tell how much context the various CLAUDE.md etc files are taking up, when you first start up. It would help identify whether I'm putting too much content into those files, and should potentially move some of that content out into separate commands or sub-agents.
I’ve changed my view on this.
I think it’s now possible to capture enough session information on a regular enough basis to avoid much loss of context.
And because sub agents cause the main line context to run out much less often, the problem of compact has been reduced by half in my workflows.
Would still be a nice to have but fwiw if CC team think something else is more important, do that!
This would be helpful to have.
+1
I've implemented this in https://github.com/sirmalloc/ccstatusline, it'll show context usage in total tokens, context usage percentage (out of 200k), and "usable" context percentage, which basically is how full the context is accounting for auto compact at 80%, as well as a lot of other features.
I need this feature as well
@sirmalloc damn that's an awesome claude code status line for sure
Hi folks, this is now supported with /context command. It has detailed info about the current context usage.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.