[FEATURE] Expose session/weekly rate limits to statusline script JSON input
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The statusline script receives useful session data via JSON stdin (model, context window usage, cost, etc.), but rate limit information is not included. Users on subscription plans can see their usage limits via /usage, but this data cannot be displayed in custom statuslines or accessed programmatically.
Proposed Solution
Current Behavior:
The statusline JSON input includes:
{
"context_window": {
"used_percentage": 42.5,
},
"cost": {
"total_cost_usd": 0.12,
}
}
Rate limit data shown in /usage is not included.
Proposed Solution:
Add a rate_limits object to the statusline JSON input:
{
"rate_limits": {
"session": {
"used_percentage": 45.2,
"remaining_percentage": 54.8,
"resets_at": "2026-01-19T14:30:00Z",
"resets_in_seconds": 3600
},
"weekly": {
"used_percentage": 23.8,
"remaining_percentage": 76.2,
"resets_at": "2026-01-22T00:00:00Z",
"resets_in_seconds": 216000
}
}
}
This would allow users to create statuslines like:
project | Opus 4.5 | 45% session (resets 1h) | 24% weekly | main
Alternative Solutions
Alternatives Considered:
- OpenTelemetry: Doesn't expose rate limits, only token/cost metrics
- Admin API: Organization-level only, not individual rate limits
- Parsing /usage output: Not possible since it's interactive-only and hooks can't capture it
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
I want to display my session and weekly usage percentages in my statusline so I can monitor how close I am to hitting rate limits without manually running /usage. This would help with:
- Pacing usage throughout the week
- Knowing when limits reset
- Avoiding unexpected rate limit hits mid-task
- When I see I'm approaching limits (e.g., 80% weekly), I can purchase additional usage or upgrade my plan before getting blocked, rather than discovering I'm out of capacity mid feature implementation
Additional Context
This data is already available server-side and displayed in /usage. Exposing it to the statusline script would be a low-lift change that significantly improves the developer experience for users who want to monitor their usage at a glance.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗