Expose rate_limits.model_scoped (per-model weekly windows, e.g. Fable) in statusLine stdin

Open 💬 0 comments Opened Jul 15, 2026 by sebyul2

Feature request

Include the model_scoped array in the rate_limits object passed to statusLine scripts via stdin.

Context

Since v2.1.80 the statusLine JSON includes rate_limits.five_hour / rate_limits.seven_day, which made plan-level usage visible to custom statuslines. However, model-scoped weekly windows (e.g. the Fable weekly quota that /usage displays as its own limit) are not included, so statusline tools cannot show how much of a premium-model allocation remains.

Claude Code already has this data. The internal status schema (visible in the bundled binary) defines:

model_scoped: array({
  display_name: string,      // "Server-supplied label for the model bucket (e.g. 'Fable')."
  utilization: number|null,  // 0-1 fraction of the weekly window
  resets_at: string|null,    // ISO-8601
})

and it is already attached to rate_limits on another internal status surface (... rate_limits: i !== undefined && i.length > 0 ? {...n, model_scoped: i} : n ...). The statusLine payload builder, however, assembles only the two generic windows:

k = { ...x.five_hour && {five_hour: {...}}, ...x.seven_day && {seven_day: {...}} }

Proposed change

Extend the statusLine rate_limits assembly to also project model_scoped (same additive semantics as the internal schema: present only when the server returns per-model windows and the list is non-empty):

"rate_limits": {
  "five_hour": { "used_percentage": 33, "resets_at": 1784115000 },
  "seven_day": { "used_percentage": 21, "resets_at": 1784613600 },
  "model_scoped": [
    { "display_name": "Fable", "utilization": 0.38, "resets_at": "2026-07-21T06:00:00Z" }
  ]
}

No new API calls or backend work — the projection already exists in-process; this is serializing it into one more consumer's payload.

Why it matters

  • Users on Claude 5 plans have a separate weekly Fable allocation; today the only way to see it is opening /usage interactively.
  • Statusline tools currently have no safe way to get this: the only alternative is reading the Claude Code OAuth token from the credential store and calling the usage API out-of-band, which is the wrong trust boundary for a statusline script and not portable across platforms. Exposing the field via stdin removes any incentive for that pattern.
  • This is additive and backwards-compatible — existing consumers ignore unknown fields.

Environment

  • Claude Code v2.1.205 / v2.1.210 (macOS arm64) — verified model_scoped absent from statusLine stdin on both, while the internal schema and projection exist in the binary.

View original on GitHub ↗