Feature request: Expose rate limit usage in statusLine JSON input
Feature Request
Add rate limit usage information to the JSON input provided to custom statusLine commands.
Current Behavior
The statusLine JSON input includes context window usage (context_window.current_usage), which tracks tokens used in the current conversation. However, it does not include rate limit quota information.
Desired Behavior
Include rate limit data in the statusLine JSON, such as:
- Current usage percentage (e.g., 99%)
- Time until reset
- Tokens used / tokens allowed in the current window
Example addition to the JSON:
{
"rate_limit": {
"usage_percent": 99,
"tokens_used": 450000,
"tokens_limit": 500000,
"resets_at": "2026-01-16T20:00:00Z"
}
}
Use Case
Users want to display their rate limit status in the statusline to know when they're approaching their quota limit. Currently, the CLI shows warnings like "You've hit your limit · resets 3pm" but this information isn't available to custom statusline scripts.
The context window percentage (how full the current conversation is) is useful but serves a different purpose than the rate limit (how much API quota remains). Both are valuable to monitor.
Environment
- Claude Code CLI
- Custom statusLine command configured in settings.json
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗