statusLine rate_limits.five_hour.used_percentage drifts across concurrently open terminals
Title
statusLine rate_limits.five_hour.used_percentage drifts across concurrently open terminals
Body
Summary
When multiple Claude Code terminal sessions are open at the same time against the same account, the rate_limits.five_hour.used_percentage field passed to a custom statusLine command shows different values in each terminal (e.g. one terminal reports 54%, another reports 58%, at the same wall-clock moment).
Why this happens (as far as I can tell)
The value appears to reflect the rate-limit state attached to that specific session's last actual API response, not a live re-check. Since each terminal's most recent turn happened at a different point in time, and the underlying 5-hour quota is account-wide (shared across all concurrent sessions), each terminal is showing a stale snapshot from a different moment — not the current true usage.
Running /usage inside a given terminal does trigger a fresh, authoritative check for that session, but there's no equivalent lightweight way to get that fresh number without sending a real prompt/command in that specific session.
Impact
For anyone running several Claude Code sessions in parallel (multiple terminals/worktrees), the statusLine's session-usage percentage can't be trusted as "current" — it's only as fresh as that terminal's last turn, which makes it easy to accidentally run past the actual 5-hour limit in a terminal that hasn't rendered a fresh number in a while.
Request
Either of these would resolve it:
- Have Claude Code refresh
rate_limitson a short interval (independent of whether the session made an API call), similar to how/usageperforms a fresh check — so statusLine reflects current usage rather than last-turn usage. - Expose a lightweight, non-billable "check current rate limit" call (CLI subcommand or documented endpoint) that a statusLine script could poll on its own cadence without needing full Admin/Console API access — subscription (Pro/Max, OAuth) users currently have no path to this data outside of the CLI's own internal session state.
Environment
- Claude Code version: 2.1.202
- Auth: subscription (OAuth), not API-console billing
- statusLine JSON sample (relevant fields):
"rate_limits": {
"five_hour": { "used_percentage": 63, "resets_at": 1783458600 },
"seven_day": { "used_percentage": 15, "resets_at": 1783936800 }
}