You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: expose current context window usage in agent state #9889
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
My goal is to optimize my workflow by operating within the 'smart zone'—which I define as keeping context window usage between 0-40%.
Currently, staying in this zone requires me to manually monitor the agent and halt execution if it exceeds 40%.
Ideally, it would be awesome to have a way to retrieve the agent's current state, specifically the context window usage percentage. This would allow me to automate my workflow and prevent the agent from crossing this threshold.
Why would you possibly want this on your workflow?
Let's say you are using some sorta of Ralph-like workflow for development, your workflow would get lots of benefits to add this new feature to the loop.
Your prompt could add instructions to pool information about the context window. If it is too close to 40% (or any percentage you want), you would ask to halt its own execution, sync your progress file and create a new session to keep working.
Activity
github-actions commentedon Mar 28, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.