Expose /usage quota data to statusline scripts
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
When working on complex tasks, I need to monitor my
remaining quota to avoid hitting limits mid-task.
Currently, I must manually run /usage to check this,
which interrupts my workflow.
The quota data already exists internally (displayed by
/usage), but it's not available to statusline scripts.
This means I can't see my remaining quota at a glance
while working.
Proposed Solution
Include usage/quota data in the JSON input provided to
statusline scripts:
{
"usage": {
"session_percent": 100,
"session_reset": "2024-12-01T16:59:00Z",
"weekly_percent": 7,
"weekly_reset": "2024-12-03T11:59:00Z"
}
}
Users could then display quota info with:
/statusline show session and weekly quota percentage
Alternative Solutions
Currently using external tools like ccusage and
ccstatusline that query the Anthropic API separately.
This works but feels redundant since Claude Code already
has this data internally via /usage.
Priority
High - Significant impact on productivity
Feature Category
Performance and speed
Use Case Example
- I start a coding session on a complex task using Opus
4.5
- I want to see "Session: 45% | Week: 12%" in my
statusline
- When session quota gets high, I switch to Sonnet to
preserve quota
- Currently I must run /usage repeatedly, breaking my
flow
- With this feature, I'd see quota in the statusline and
make informed decisions without interruption
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗