claude-code - 💡(How to fix) Fix rate_limits (seven_day, five_hour) missing from statusLine JSON input [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#45133Fetched 2026-04-09 08:12:28
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1subscribed ×1

The statusLine command input JSON no longer includes the rate_limits object. Specifically, rate_limits.seven_day and rate_limits.five_hour (with used_percentage and resets_at fields) are absent from the JSON piped to custom statusLine commands.

Root Cause

For Max subscribers, the 7-day and 5-hour rate limit pacing is the single most useful statusLine metric. I display it as 7d:used%/elapsed% to see at a glance whether I'm ahead of or behind my weekly budget. Without it, there's no way to monitor quota usage from the status bar.

The cost object was added (which is nice), but it doesn't replace rate limit visibility — cost in USD doesn't help when the constraint is a percentage-based rolling window.

Code Example

"rate_limits": {
  "five_hour": {
    "used_percentage": 23.5,
    "resets_at": 1738425600
  },
  "seven_day": {
    "used_percentage": 41.2,
    "resets_at": 1738857600
  }
}

---

# In settings.json:
"statusLine": {
  "type": "command",
  "command": "bash /path/to/script.sh"
}

# In script.sh:
input=$(cat)
echo "$input" | jq '.rate_limits'  # → null
RAW_BUFFERClick to expand / collapse

Description

The statusLine command input JSON no longer includes the rate_limits object. Specifically, rate_limits.seven_day and rate_limits.five_hour (with used_percentage and resets_at fields) are absent from the JSON piped to custom statusLine commands.

Expected behavior

The statusLine JSON should include:

"rate_limits": {
  "five_hour": {
    "used_percentage": 23.5,
    "resets_at": 1738425600
  },
  "seven_day": {
    "used_percentage": 41.2,
    "resets_at": 1738857600
  }
}

Actual behavior

The JSON payload contains session_id, transcript_path, cwd, model, workspace, version, output_style, cost, context_window, and exceeds_200k_tokens — but no rate_limits object at all.

Why this matters

For Max subscribers, the 7-day and 5-hour rate limit pacing is the single most useful statusLine metric. I display it as 7d:used%/elapsed% to see at a glance whether I'm ahead of or behind my weekly budget. Without it, there's no way to monitor quota usage from the status bar.

The cost object was added (which is nice), but it doesn't replace rate limit visibility — cost in USD doesn't help when the constraint is a percentage-based rolling window.

Environment

  • Claude Code v2.1.96
  • Claude Max subscription
  • Linux (Ubuntu)
  • Custom statusLine command (bash script reading JSON from stdin)

Reproduction

Set a custom statusLine command and inspect the JSON input — rate_limits is missing:

# In settings.json:
"statusLine": {
  "type": "command",
  "command": "bash /path/to/script.sh"
}

# In script.sh:
input=$(cat)
echo "$input" | jq '.rate_limits'  # → null

extent analysis

TL;DR

The rate_limits object is missing from the statusLine command input JSON, and a potential fix involves verifying the version compatibility and configuration of the Claude Code and custom statusLine command.

Guidance

  • Check the documentation for Claude Code v2.1.96 to confirm if the rate_limits object is supposed to be included in the statusLine command input JSON.
  • Verify that the custom statusLine command is correctly configured to receive and parse the rate_limits object from the JSON input.
  • Inspect the JSON input in the script.sh to ensure it is correctly parsing the input and not accidentally removing the rate_limits object.
  • Consider reaching out to the Claude Code support team to confirm if this is a known issue or a configuration problem.

Example

No code snippet is provided as it is not clearly supported by the issue, but the example in the issue body shows how to inspect the JSON input in the script.sh:

input=$(cat)
echo "$input" | jq '.rate_limits'  # → null

This can be used as a starting point to debug the issue.

Notes

The issue may be specific to the Claude Code version or the custom statusLine command configuration. Without more information, it is difficult to provide a definitive solution.

Recommendation

Apply workaround: Reach out to the Claude Code support team to confirm if this is a known issue or a configuration problem, and consider modifying the custom statusLine command to handle the missing rate_limits object.

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…

FAQ

Expected behavior

The statusLine JSON should include:

"rate_limits": {
  "five_hour": {
    "used_percentage": 23.5,
    "resets_at": 1738425600
  },
  "seven_day": {
    "used_percentage": 41.2,
    "resets_at": 1738857600
  }
}

Still need to ship something?

×6

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

Back to top recommendations

TRENDING