- Author(s): @ahmedhesham6
- Champion: @benbrandt
Elevator pitch
What are you proposing to change?Add a standardized
usage_update session notification that lets agents report the current context window utilization and optional cumulative session cost.
This RFD is intentionally scoped to session-level context size and cost. End-turn token accounting is covered separately in the End-Turn Token Usage RFD.
Status quo
How do things work today and what problems does this cause? Why would we change things?ACP currently has no standardized way for agents to communicate:
- Context window status - How much of the model’s context window is being used
- Cost information - Estimated cumulative cost for API usage
- No context management - Clients cannot warn users when a session is approaching context limits or suggest compaction
- No cost transparency - Users cannot track spending or estimate whether a long-running session should continue
- Inconsistent implementations - Each agent reports context and cost differently, if it reports them at all
- Context percentage indicators such as “19%”
- Absolute token details such as “31.4K of 200K tokens”
- Warning thresholds around high context utilization
- Auto-compaction or handoff suggestions near context limits
- Cumulative session cost tracking rather than only per-turn cost breakdowns
What we propose to do about it
What are you proposing to improve the situation?Agents send context window and cost information via
session/update notifications with sessionUpdate: "usage_update":
Context Window Fields
used(number, required) - Tokens currently in contextsize(number, required) - Total context window size in tokens
remaining as size - used and percentage as used / size * 100.
If a model has a dynamic context window, agents should report the current effective limit and send another usage_update if that limit changes. If an agent cannot provide a meaningful context window size, it should not send usage_update; this RFD does not define a null or omitted size state.
Cost Field
cost(object, optional, nullable) - Cumulative session costamount(number, required) - Total cumulative cost for the sessioncurrency(string, required) - ISO 4217 currency code, such as"USD"or"EUR"
- After
session/new, once the session ID exists - After
session/load,session/resume, orsession/forkfor restored sessions - After
session/prompt, when usage data becomes available - Anytime context window state or cumulative cost changes significantly
- Agents that can query current usage without a prompt can send updates immediately after session setup
- Agents that only receive usage data while prompting can send updates after prompt completion
- Agents that cannot calculate cost can still report context window status
Design Principles
- Session state - Context size and cumulative cost describe the session, not one prompt response
- Agent-pushed notifications - Agents proactively send updates when data becomes available, following the same pattern as dynamic session properties such as
available_commands_update,current_mode_update, andsession_info_update - Agent calculates, client can verify - Agents know their model and tokenizer best, but expose raw values so clients can compute derived display values
- Flexible cost reporting - Cost is optional because not all agents track it, and the currency is explicit because agents may bill in different currencies
- Optional but recommended - Context and cost reporting remains optional to preserve compatibility
Shiny future
How will things will play out once this feature exists?For Users:
- Visibility: Users see current context window usage with percentage indicators
- Cost awareness: Users can track cumulative spending at any time
- Better planning: Users know when to start a new session, compact context, or hand off work
- Transparency: Users get a consistent view of resource consumption across agents
- Consistent UI: Clients can show usage through standard progress indicators, detail hovers, and warning states
- Smart warnings: Clients can warn users as sessions approach high context utilization
- Cost controls: Clients can implement budget alerts and session-level spend displays
- Reactive updates: Clients update UI immediately when agents push new data
- No polling needed: Clients do not need a separate status request to keep context displays current
- Standard reporting: Agents get a clear contract for reporting context window and cost state
- Flexibility: Agents can report only the cost information they can calculate
- Model diversity: The shape works across providers and local models
Implementation details and plan
Tell me more about your implementation. What is your detailed implementation plan?
- Add a
UsageUpdatevariant toSessionUpdatewith discriminatorsessionUpdate: "usage_update". - Add a
Costtype withamountandcurrencyfields. - Gate this Rust crate surface behind the
unstable_session_usagefeature. - Document the
session/updatenotification variant in the protocol docs. - Add examples showing when agents should send context window and cost updates.
PromptResponse. That proposal remains in draft in the End-Turn Token Usage RFD.
Frequently asked questions
What questions have arisen over the course of authoring this document or during subsequent discussions?
Why split this from end-turn token usage?
Context window size and cumulative cost are session-level state that clients may need before, during, or after a prompt. Token accounting for a completed turn has different open questions, including whether values should be per-turn or cumulative and how cache metrics should map across providers.How do users know when to hand off or compact context?
Theusage_update notification provides the raw values clients need:
usedandsizegive absolute numbers for precise tracking- Clients can compute
remainingassize - used - Clients can compute
percentageasused / size * 100
| Percentage | Action |
|---|---|
| < 75% | Normal operation |
| 75-90% | Yellow indicator, suggest “Context filling up” |
| 90-95% | Orange indicator, recommend “Start new session or summarize” |
| > 95% | Red indicator, warn “Next prompt may fail - handoff recommended” |
Why is cost in session/update instead of PromptResponse?
Cost is cumulative session state, similar to context window utilization:
- Users usually want total spending, not only per-turn costs
- Both cost and context window are session-level metrics that can change when agents compact, switch models, or restore sessions
- Cost is optional because not all agents track it
Why not assume USD for cost?
Agents may bill in different currencies:- European agents might bill in EUR
- Asian agents might bill in JPY or CNY
- Some agents might use credits or points
- Currency conversion rates change
How does this work with streaming responses?
Agents may sendusage_update notifications during streaming if context state changes and they have reliable current data. They should also send an update after prompt completion when final context size or cost data becomes available.
What about models without fixed context windows?
Agents should report the current effective context window size. For models with dynamic windows, agents should report the current limit and send another update if it changes. If there is no meaningful context window size, agents should not sendusage_update; size is required and non-null.
What about rate limits and quotas?
This RFD focuses on context window utilization and cumulative cost. Rate limits and quotas are separate concerns that could be addressed in a future RFD.Should cached tokens count toward context window usage?
Yes. Cached tokens still occupy context window space even when they are cheaper to process. Context window usage should include all tokens currently in context.Why a notification instead of a request?
Usingsession/update notifications instead of a session/status request provides several benefits:
- Consistency: Follows the same pattern as other dynamic session properties
- Agent flexibility: Agents can send updates when they have data available
- No polling: Clients receive updates reactively
- Real-time updates: Updates flow naturally as part of the session lifecycle
What if the client connects mid-session?
When a client connects to an existing session throughsession/load or session/resume, agents should send a usage_update notification if they have current context window data available. This lets the client UI immediately display accurate context and cost information.
For agents that only provide usage during active prompting, the client UI may not show usage until after the first prompt is sent.
What alternative approaches did you consider, and why did you settle on this one?
Everything inPromptResponse - Simpler, but context window and cost are session state that users may want independently of prompt turns.
Request/response with session/status - Requires clients to poll, and some agents do not have APIs to query current status without a prompt.
Client calculates everything - Rejected because clients do not know the agent’s tokenizer, exact context window size, model routing, or pricing.
Only percentage, no raw tokens - Rejected because users want absolute numbers, clients cannot verify calculations, and it is less transparent.
Revision history
- 2025-12-07: Initial draft
- 2025-12-13: Changed from
session/statusrequest method tosession/updatenotification withsessionUpdate: "context_update". Madecostoptional and removedremainingfield (clients can compute assize - used). This approach provides more flexibility for agents and follows the same pattern as other dynamic session properties. - 2025-12-17: Renamed
reasoning_tokenstothought_tokensfor consistency with ACP terminology. Removedpercentagefield (clients can compute asused / size * 100). - 2025-12-19: Renamed
sessionUpdate: "context_update"tosessionUpdate: "usage_update"to better reflect the payload semantics (includes both context window info and cumulative cost). - 2026-06-02: Split end-turn token accounting into a separate draft RFD.
- 2026-06-03: Moved to Preview.