claude-code - 💡(How to fix) Fix [BUG] rate_limits absent from statusLine JSON for Claude Max plan (v2.1.156, Windows)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Likely root cause

Per community analysis (jarrodwatts/claude-hud#348): Claude Code builds the rate_limits object from anthropic-ratelimit-unified-5h-* / -7d-* response headers, and only includes it in stdin when at least one window has data. For Max-tier accounts those unified headers don't appear to be returned, so the internal cache stays empty and rate_limits never reaches the statusLine payload.

Code Example

session_id, transcript_path, cwd, effort, model, workspace, version,
output_style, cost, context_window, exceeds_200k_tokens, fast_mode, thinking

---

{
  "five_hour": { "utilization": 9, "resets_at": "..." },
  "seven_day": { "utilization": 5, "resets_at": "..." }
}
RAW_BUFFERClick to expand / collapse

Following up on #40094 (auto-closed for inactivity; the bot invited a fresh referencing issue). The bug still reproduces on the latest CLI.

Setup

  • Claude Code 2.1.156
  • Windows 11
  • Claude Max subscription (firstParty/OAuth)

Repro

Captured the raw statusLine stdin across multiple renders during an active session. Top-level keys observed:

session_id, transcript_path, cwd, effort, model, workspace, version,
output_style, cost, context_window, exceeds_200k_tokens, fast_mode, thinking

rate_limits is never present — not once.

The data exists server-side

GET https://api.anthropic.com/api/oauth/usage (header anthropic-beta: oauth-2025-04-20, bearer token from ~/.claude/.credentials.json) returns:

{
  "five_hour": { "utilization": 9, "resets_at": "..." },
  "seven_day": { "utilization": 5, "resets_at": "..." }
}

So the quota data is available — it simply isn't surfaced in the documented statusLine rate_limits field.

Likely root cause

Per community analysis (jarrodwatts/claude-hud#348): Claude Code builds the rate_limits object from anthropic-ratelimit-unified-5h-* / -7d-* response headers, and only includes it in stdin when at least one window has data. For Max-tier accounts those unified headers don't appear to be returned, so the internal cache stays empty and rate_limits never reaches the statusLine payload.

This breaks third-party statuslines (e.g. ClaudeHUD) which — per the documented contract — now rely solely on stdin rate_limits and intentionally dropped the OAuth fallback for compliance reasons.

Ask

Ensure rate_limits is populated in the statusLine stdin for Max-tier subscribers, consistent with the v2.1.80 changelog and the documented statusLine contract.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] rate_limits absent from statusLine JSON for Claude Max plan (v2.1.156, Windows)