Expose rate limit data in statusLine JSON
Request
Add the unified rate limit fields to the JSON payload passed to the statusLine command. Claude Code already parses these headers from every API response (DO6() / jC state) — they just aren't included in the hp2() statusLine JSON schema.
Fields requested
{
"rate_limit": {
"7d_utilization": 0.46,
"7d_reset": 1740412740,
"7d_status": "allowed",
"5h_utilization": 0.12,
"5h_reset": 1740350340,
"5h_status": "allowed",
"representative_claim": "seven_day"
}
}
Why
The statusLine hook is the right place for users to build custom status displays. The context window and cost data are already there. Rate limit utilization is the missing piece — it's the data users most want to monitor (weekly/session limits), and it's already parsed client-side from anthropic-ratelimit-unified-* response headers.
Without this, the only workaround is estimating usage from local JSONL files via tools like ccusage — which is a rough proxy based on dollar cost, not the actual server-side utilization metric. It drifts whenever pricing or internal weighting changes.
Current workaround
Using ccusage daily --mode calculate to sum token costs since last Tuesday, divided by a manually calibrated weekly cap (~$1,028). It's close but fundamentally a guess.
Impact
This would be a small change (add fields to the existing JSON object in hp2()) with high user value — anyone with a custom statusLine gets access to accurate rate limit data.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗