Skip to content

[FEATURE]: expose current context window usage in agent state #9889

Closed

Description

@HicaroD

Feature hasn't been suggested before.

  • 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

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 21, 2026
  2. github-actions commented on Mar 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions