claude-code - 💡(How to fix) Fix Statusline hook payload no longer includes `rate_limits` field (v2.1.138) [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#60612Fetched 2026-05-20 03:54:01
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×6commented ×1subscribed ×1

The JSON payload piped to the statusline hook command no longer contains the rate_limits field as of Claude Code 2.1.138. Any statusline script that reads .rate_limits.five_hour or .rate_limits.seven_day now reads empty. Downstream tools (e.g. abtop) that depend on the statusline hook to track usage have stopped working.

Root Cause

  • Third-party tools depending on the statusline hook to expose Claude Code usage (abtop and similar) have silently stopped updating.
  • No alternate on-disk surface for the current 5h / 7d / weekly limits exists; the only source remaining is the claude.ai web UI at /settings/usage, which isn't scriptable.
  • Hook scripts that conditionally write a quota file on if rate_limits appear to "fail silently" because the field is missing rather than empty.

Code Example

#!/bin/bash
   input=$(cat)
   echo "$input" > /tmp/statusline-payload.json
   printf '%b' "ok"

---

{
  "session_id": "...",
  "transcript_path": "...",
  "cwd": "...",
  "effort": {"level": "high"},
  "session_name": "...",
  "model": {"id": "claude-opus-4-7[1m]", "display_name": "Opus 4.7 (1M context)"},
  "workspace": {...},
  "version": "2.1.138",
  "output_style": {...},
  "cost": {...},
  "context_window": {...},
  "exceeds_200k_tokens": true,
  "fast_mode": false,
  "thinking": {"enabled": true}
}

---

"rate_limits": {
  "five_hour": {"used_percentage": <0-100>, "resets_at": <unix-epoch>},
  "seven_day": {"used_percentage": <0-100>, "resets_at": <unix-epoch>}
}
RAW_BUFFERClick to expand / collapse

Summary

The JSON payload piped to the statusline hook command no longer contains the rate_limits field as of Claude Code 2.1.138. Any statusline script that reads .rate_limits.five_hour or .rate_limits.seven_day now reads empty. Downstream tools (e.g. abtop) that depend on the statusline hook to track usage have stopped working.

Environment

  • Claude Code: 2.1.138
  • OS: macOS 26.5 (Build 25F71)
  • Statusline configured via ~/.claude/settings.jsonstatusLine.command

Repro

  1. Configure a statusline command that dumps stdin to a file:

    #!/bin/bash
    input=$(cat)
    echo "$input" > /tmp/statusline-payload.json
    printf '%b' "ok"
  2. Trigger any statusline refresh in an active Claude Code session.

  3. Inspect /tmp/statusline-payload.json.

Actual payload (v2.1.138)

{
  "session_id": "...",
  "transcript_path": "...",
  "cwd": "...",
  "effort": {"level": "high"},
  "session_name": "...",
  "model": {"id": "claude-opus-4-7[1m]", "display_name": "Opus 4.7 (1M context)"},
  "workspace": {...},
  "version": "2.1.138",
  "output_style": {...},
  "cost": {...},
  "context_window": {...},
  "exceeds_200k_tokens": true,
  "fast_mode": false,
  "thinking": {"enabled": true}
}

Note the absence of any rate_limits key.

Expected payload (prior versions)

The payload used to include a rate_limits envelope with at least:

"rate_limits": {
  "five_hour": {"used_percentage": <0-100>, "resets_at": <unix-epoch>},
  "seven_day": {"used_percentage": <0-100>, "resets_at": <unix-epoch>}
}

This is what tools like abtop read via its --setup-installed statusline wrapper. With the field gone, the tool's quota panel shows stale or empty data with no way to recover.

Impact

  • Third-party tools depending on the statusline hook to expose Claude Code usage (abtop and similar) have silently stopped updating.
  • No alternate on-disk surface for the current 5h / 7d / weekly limits exists; the only source remaining is the claude.ai web UI at /settings/usage, which isn't scriptable.
  • Hook scripts that conditionally write a quota file on if rate_limits appear to "fail silently" because the field is missing rather than empty.

Asks

  1. Restore rate_limits in the statusline hook payload, ideally with the same shape as prior versions to avoid breaking existing third-party tools.
  2. Consider extending the field to surface the newer claude.ai metrics (weekly Opus cap, weekly total cap) that currently only appear in the web UI - these are increasingly load-bearing for users managing higher-tier subscriptions across teams.
  3. Document the statusline payload schema if it's intended to be a stable contract, since third-party tooling now depends on it.

Happy to provide additional payload samples or repro on different versions if helpful.

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 Statusline hook payload no longer includes `rate_limits` field (v2.1.138) [1 comments, 2 participants]