claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Feature Request] Expose how much context is left before auto-compact

Open hesreallyhim opened this issue 7 months ago • 3 comments

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(?))

hesreallyhim avatar May 19 '25 03:05 hesreallyhim

I want this badly too.

guidedways avatar May 19 '25 13:05 guidedways

It would be great if Claude had awareness of this as well. Would give it a chance to update memory before it gets brainwashed.

neonconsultingllc avatar May 27 '25 02:05 neonconsultingllc

+1

neokree avatar Jun 26 '25 09:06 neokree

I too, am curious why this information is not available. I need a hook into it to remind claude to perform context recovery.

banagale avatar Jul 14 '25 21:07 banagale

I was planning to open a feature request about this, and here we are.

SheharyarAmin avatar Jul 24 '25 18:07 SheharyarAmin

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.

asgeo1 avatar Jul 28 '25 06:07 asgeo1

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!

banagale avatar Jul 28 '25 19:07 banagale

This would be helpful to have.

federicotdn avatar Aug 08 '25 08:08 federicotdn

+1

vukdavid avatar Aug 13 '25 07:08 vukdavid

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.

sirmalloc avatar Aug 13 '25 08:08 sirmalloc

I need this feature as well

PoyrazTahan avatar Aug 13 '25 12:08 PoyrazTahan

@sirmalloc damn that's an awesome claude code status line for sure

hesreallyhim avatar Aug 13 '25 20:08 hesreallyhim

Hi folks, this is now supported with /context command. It has detailed info about the current context usage.

kushal-thakkar avatar Aug 22 '25 18:08 kushal-thakkar

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.

github-actions[bot] avatar Aug 31 '25 14:08 github-actions[bot]