Skip to content

Conversation

@SteffenDE
Copy link
Contributor

I experimented with https://agentclientprotocol.com/rfds/session-usage (see agentclientprotocol/agent-client-protocol#415), but the Claude Agent SDK does not seem to return the information we need for an accurate context indicator. For example, one request to explore a project returned 500k+ cached read tokens in Claude's result message, while the agent reported 64k tokens used. I can open a PR with those changes for reference once the Typescript SDK is updated.

To allow users to still see the current context usage, allowing to run /context seems to be the second best option. This PR changes the code to handle the <local-command-stdout> message that the SDK generates when sending /context and includes /context as allowed command.

Screenshot from Tidewave with this change:

image

@cla-bot cla-bot bot added the cla-signed label Jan 28, 2026
Copy link
Member

@benbrandt benbrandt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🚀

@benbrandt benbrandt merged commit 11ca660 into zed-industries:main Jan 29, 2026
2 checks passed
@benbrandt benbrandt linked an issue Feb 2, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context command doesn't exist

2 participants