Add rate limit data to statusline JSON input
Feature Request
Add plan rate limit information to the statusline command's JSON input.
Problem
The statusline script receives a fixed JSON input that includes context_window data (per-conversation context usage), but does not include plan-level rate limit information (the 5-hour rolling window usage).
This data is available internally — the /usage command displays it:
Current session
██████████████████████████████ 50% used
Resets 6:59pm (Europe/Paris)
However, there is no way to access this from the statusline script, hooks, or any external mechanism.
Proposed Solution
Add a rate_limit (or plan_usage) object to the statusline JSON input:
{
"rate_limit": {
"used_percentage": 50,
"remaining_percentage": 50,
"tokens_limit": 1000000,
"tokens_remaining": 500000,
"reset_at": "2026-02-11T17:59:00Z"
}
}
These values come from the Anthropic API response headers that Claude Code already receives:
anthropic-ratelimit-tokens-limitanthropic-ratelimit-tokens-remaininganthropic-ratelimit-tokens-reset
Why
Users who customize their statusline want to monitor their plan usage at a glance — especially on Max plans where the 5-hour window matters. Currently, the only way to check is to run /usage manually or visit https://claude.ai/settings/usage.
Current Workarounds Explored (none viable)
- Hooks (
PostToolUse, etc.): don't expose API response headers - Transcript/debug logs: don't contain rate limit headers
- ccusage blocks: estimates synthetic 5h blocks that don't match the actual API rate limit window
- OAuth token + direct API call: token is in macOS Keychain, not easily accessible from scripts
- Proxy via
ANTHROPIC_BASE_URL: fragile and complex
Environment
- Claude Code v2.1.39
- macOS, Max $100/month plan
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗