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

Status Fixed / completed
Maintainer reply None cached
Activity 14 comments · opened May 19, 2025 · closed Aug 22, 2025

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

View original on GitHub ↗

14 Comments

guidedways · 1 year ago

I want this badly too.

neonconsultingllc · 1 year ago

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

neokree · 1 year ago

+1

banagale · 1 year ago

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

SheharyarAmin · 1 year ago

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

asgeo1 · 1 year ago

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.

banagale · 1 year ago

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!

federicotdn · 1 year ago

This would be helpful to have.

vukdavid · 1 year ago

+1

sirmalloc · 1 year ago

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.

PoyrazTahan · 1 year ago

I need this feature as well

hesreallyhim · 1 year ago

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

kushal-thakkar · 1 year ago

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

github-actions[bot] · 12 months ago

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.