Expose rate-limit / plan quota data in statusline JSON stdin

Resolved 💬 4 comments Opened Mar 1, 2026 by DidierMac Closed Apr 16, 2026

Feature Request

Context

The statusline script receives a JSON object via stdin with session-level metrics (cost, context_window, model, etc.). However, the plan usage / rate-limit quotas displayed by the /usage command are not included in this JSON.

What /usage shows (Max plan)

The /usage dialog displays server-side quota information:

  • Current session: X% used (resets at 3am)
  • Current week (all models): X% used (resets weekly)
  • Current week (Sonnet only): X% used (resets weekly)
  • Extra usage: Unlimited / remaining

These are the most useful metrics for Max/Pro subscribers to monitor their consumption at a glance.

What the statusline JSON currently provides

{
  "cost": {
    "total_cost_usd": 2.53,
    "total_duration_ms": 21737673,
    "total_api_duration_ms": 355661,
    "total_lines_added": 132,
    "total_lines_removed": 43
  },
  "context_window": {
    "total_input_tokens": 4238,
    "total_output_tokens": 18467,
    ...
  }
}

No plan quota / rate-limit fields are present.

Proposed addition

Add a usage or quota object to the statusline JSON with the same data /usage displays:

{
  "quota": {
    "session": { "used_percentage": 2, "resets_at": "2026-03-02T02:00:00Z" },
    "week_all_models": { "used_percentage": 9, "resets_at": "2026-03-06T15:00:00Z" },
    "week_sonnet": { "used_percentage": 2, "resets_at": "2026-03-07T11:00:00Z" },
    "extra_usage": "unlimited"
  }
}

Why

The statusline is the ideal place for a Max subscriber to see their plan consumption at a glance — always visible, no need to open /usage. The data already exists server-side (since /usage displays it), it just needs to be forwarded to the statusline JSON.

Environment

  • Claude Code v2.1.63
  • Max plan subscriber
  • macOS (Darwin 25.3.0)

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗