rate_limit_event: include utilization in "allowed" status
When using the Agent SDK (sdk.query()), rate_limit_event messages are emitted on every API response, which is great. However, the utilization field is only populated when status is allowed_warning or rejected.
For status: "allowed", the event looks like:
{
"type": "rate_limit_event",
"rate_limit_info": {
"status": "allowed",
"resetsAt": 1774918800,
"rateLimitType": "five_hour",
"isUsingOverage": false
}
}
The utilization field is missing, even though the underlying HTTP response headers (anthropic-ratelimit-unified-5h-utilization, anthropic-ratelimit-unified-7d-utilization) contain this data on every response.
Internally, QX4() reads these headers into Yf8, but cX4() drops utilization when constructing the event for allowed status (it only preserves it when Ln9() triggers a warning).
Use case: We're building a Claude Code web UI (Clay) and want to show users their current 5h/7d usage at all times, not just when they're close to a limit. The resetsAt timestamp is available, but without utilization we can't show actual usage percentage.
Request: Always include utilization (and ideally both five_hour + seven_day windows) in rate_limit_event, regardless of status.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗