Add extra usage / billing status fields to status line JSON
Feature Request
Problem
On a Max subscription, users can be charged extra usage costs in two scenarios:
- Extended context (1M) — always billed at extra usage rates
- Rate limit overflow — when daily/weekly subscription limits are exceeded, Claude Code switches to extra usage billing
The status line JSON currently provides context_window.context_window_size which lets scripts detect scenario 1, but there is no field to detect scenario 2. This means status line scripts cannot accurately show cost information only when it's relevant.
Proposed Solution
Add billing/extra usage fields to the status line JSON, for example:
{
"billing": {
"mode": "subscription" | "extra_usage",
"extra_usage_active": true | false,
"reason": "extended_context" | "rate_limit_exceeded" | null,
"rate_limit": {
"daily_remaining": 0.75,
"weekly_remaining": 0.50
}
}
}
At minimum, a simple boolean like billing.extra_usage_active would allow status line scripts to conditionally show cost estimates only when the user is actually being charged.
Use Case
Users on Max subscriptions want to:
- See estimated costs only when extra usage is active (not when usage is included in subscription)
- Know when they've hit rate limits and switched to extra usage billing
- Make informed decisions about continuing expensive operations
Current Workaround
Scripts can check context_window_size >= 1000000 to detect extended context, but there is no workaround for detecting rate limit overflow billing.
---
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗