Status line: include rate_limits.model_scoped and rate_limits.extra_usage in the payload
What
The status-line payload carries rate_limits.five_hour and rate_limits.seven_day.
Please also project rate_limits.model_scoped[] and rate_limits.extra_usage, which
the CLI already has in hand at that point.
Why
There is no way to show per-model usage in a status line today. With Fable, Opus and
Sonnet metered separately, the two aggregate windows no longer answer "how much of the
model I'm actually using is left" — which is the question a status line exists to answer.
The data is already there
In v2.1.228 the payload builder projects exactly two of the buckets it holds:
A = { ...C.five_hour && {five_hour: {...}}, ...C.seven_day && {seven_day: {...}} }
...(A.five_hour || A.seven_day) && { rate_limits: A }
C is the full rate-limit state. The known bucket list is
["five_hour","seven_day","seven_day_oauth_apps","seven_day_opus",
"seven_day_sonnet","cinder_cove","extra_usage","limits"]
and the schema for the wider object already defines exactly the shape that would be
wanted, including the label:
model_scoped: array({
display_name: string().describe("Server-supplied label for the model bucket (e.g. 'Fable')."),
utilization: number().nullable(),
resets_at: string().nullable(),
}).optional().describe("Per-model weekly windows from the server limits[] array, filtered by
the overage-included models allowlist. Additive — present only when
the server emits them.")
extra_usage: { is_enabled, monthly_limit, used_credits, utilization, currency }
Both are already documented as additive/optional, so consumers that don't know about
them are unaffected.
The workaround is one nobody should take
The only way to get these numbers into a status line right now is to read the user's
OAuth token from ~/.claude/.credentials.json or the macOS keychain and callapi.anthropic.com/api/oauth/usage. Status-line scripts genuinely do this. Widening
the projection removes the incentive — the CLI has already fetched the data, and
handing it over costs a few more keys in a JSON object it is emitting anyway.
Consistency note
If you do add them, it would help to match the shape the status line already receives —used_percentage (0..100) and resets_at as epoch seconds — rather than passingutilization (0..1) and an ISO string straight through, so a consumer doesn't have to
branch on which bucket it's reading.
Version
claude-code 2.1.228, macOS (darwin arm64).
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗