[DOCS] Status line docs missing `rate_limits` field for Claude.ai usage windows

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Mar 19, 2026 · closed Mar 20, 2026

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/statusline

Section/Topic

"Available data" table and "Full JSON schema" example

Current Documentation

The "Available data" table lists all top-level fields passed to statusline scripts via stdin: session, model, account, system, currentCost, and tool. The full JSON schema accordion shows a complete example payload. Neither the table nor the schema include a rate_limits field.

No documentation currently exists for the rate_limits statusline field, its sub-fields (used_percentage, resets_at), or the 5-hour and 7-day usage windows it exposes.

What's Wrong or Missing?

Changelog v2.1.80 added a rate_limits field to statusline scripts for displaying Claude.ai rate limit usage (5-hour and 7-day windows with used_percentage and resets_at). This field is not documented in the statusline page's "Available data" table or the full JSON schema example.

Users writing custom statusline scripts have no way to discover this field exists, what structure it contains, or how to use it to display rate limit information.

Suggested Improvement

Add a rate_limits row to the "Available data" table:

| Field | Description |
|-------|-------------|
| rate_limits | Claude.ai rate limit usage for 5-hour and 7-day windows, including used_percentage and resets_at for each window |

Update the full JSON schema example to include the rate_limits object with its nested structure showing both usage windows and their sub-fields.

Note: This field may be null or absent for non-Claude.ai authentication methods (e.g., API key, Bedrock, Vertex). Document null-handling behavior if applicable.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

| Page | Context |
|------|---------|
| https://code.claude.com/docs/en/statusline | "Available data" table and full JSON schema example |

Total scope: 1 page affected

Source: Changelog v2.1.80

Added rate_limits field to statusline scripts for displaying Claude.ai rate limit usage (5-hour and 7-day windows with used_percentage and resets_at)

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/36064
  2. https://github.com/anthropics/claude-code/issues/34737
  3. https://github.com/anthropics/claude-code/issues/20636

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Astro-Han · 6 months ago

I've been consuming the rate_limits field in a statusline script since v2.1.80 landed. A few things I found that would be good to document:

  • used_percentage is a float (e.g. 7.000000000000001), needs flooring before display
  • resets_at is a Unix timestamp, not ISO 8601 like the API endpoint returns
  • The field is absent until the first API response in a session, so scripts need a null guard
  • Not present for API-key users, only Claude.ai subscribers

For reference, here's a working implementation that uses it for real-time 5h/7d quota display with pace tracking: https://github.com/Astro-Han/claude-lens

coygeek · 6 months ago

Issue #36383 Verification

Title: [DOCS] Status line docs missing rate_limits field for Claude.ai usage windows
Issue Date: 2026-03-19
Verification Date: 2026-03-20
Status: RESOLVED

---

Issue Summary

This issue reports that the statusline documentation page is missing the rate_limits field (added in changelog v2.1.80) from both the "Available data" table and the "Full JSON schema" example. The reporter notes that users writing custom statusline scripts have no way to discover the rate_limits field, its sub-fields (used_percentage, resets_at), or the 5-hour and 7-day usage windows it exposes.

---

Verification Results

Claim 1: "Available data" table missing rate_limits field

Status: RESOLVED

At https://code.claude.com/docs/en/statusline, the "Available data" table now includes two rows for rate limits:

rate_limits.five_hour.used_percentage, rate_limits.seven_day.used_percentage — Percentage of the 5-hour or 7-day rate limit consumed, from 0 to 100 rate_limits.five_hour.resets_at, rate_limits.seven_day.resets_at — Unix epoch seconds when the 5-hour or 7-day rate limit window resets

Verdict: The rate_limits field and all its sub-fields are now documented in the "Available data" table with clear descriptions.

---

Claim 2: Full JSON schema example missing rate_limits object

Status: RESOLVED

At https://code.claude.com/docs/en/statusline, the "Full JSON schema" accordion now includes the complete rate_limits object with nested structure:

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

Verdict: The JSON schema example now shows the full rate_limits structure with both usage windows and their sub-fields.

---

Claim 3: No documentation for null/absence handling of rate_limits

Status: RESOLVED

At https://code.claude.com/docs/en/statusline, the "Fields that may be absent" section within the JSON schema accordion now documents:

rate_limits: appears only for Claude.ai subscribers (Pro/Max) after the first API response in the session. Each window (five_hour, seven_day) may be independently absent. Use jq -r '.rate_limits.five_hour.used_percentage // empty' to handle absence gracefully.

Additionally, a dedicated "Rate limit usage" example section provides complete Bash, Python, and Node.js scripts demonstrating how to display rate limit information with graceful handling of absent fields.

Verdict: Null/absence behavior is documented, and practical usage examples are provided.

---

Current State

| Claim | Status |
|-------|--------|
| "Available data" table missing rate_limits | RESOLVED |
| Full JSON schema missing rate_limits object | RESOLVED |
| No documentation for null/absence handling | RESOLVED |

---

Suggested Fix

N/A - issue has been resolved.

---

References

  • URL: https://code.claude.com/docs/en/statusline
  • Lines 162-163: rate_limits fields in "Available data" table
  • Lines 217-226: rate_limits object in Full JSON schema example
  • Lines 243-248: Documentation of rate_limits absence behavior
  • Lines 697-761: Dedicated "Rate limit usage" example section with Bash, Python, and Node.js scripts

---

Conclusion & Recommendation

Primary Concern: The statusline documentation was missing the rate_limits field from the "Available data" table and JSON schema example, leaving users unable to discover rate limit information for custom statusline scripts.

Resolution Status: RESOLVED

Recommendation: CLOSE

All three aspects of the reported issue have been addressed: the rate_limits field is now in the "Available data" table with descriptions of all sub-fields, the full JSON schema example includes the complete nested structure, and absence/null handling is documented with a dedicated usage example section.

---

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.