You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Keep and expose Claude's per-session rate_limit_event (5h/7d utilization) instead of dropping it #35497
Orca on macOS running Claude Code native chats with several managed Claude accounts (own subscriptions). An external tool moves the active account when a usage window nears its limit (Orca's own accounts.selectClaude is not used, because running sessions would stall).
Problem
Every Claude Code response already carries the account's 5-hour and 7-day utilization, and Claude Code prints it to Orca as a rate_limit_event frame on its stream-json stdout (rate_limit_info.unifiedWindows.{five_hour,seven_day}.{utilization,resetsAt}, present after the first response of a subscription session). Orca reads the frame (src/main/claude/claude-usage-limits.ts, observe()) but keeps only a rejected flag per window to word a failure row; the frame is classified status-chrome and is not journaled. So the freshest usage signal a host can have is dropped, and anything that wants it has to poll /api/oauth/usage, which 429-locks at a few calls an hour per token.
Request
Keep the last rate_limit_event per session and expose it, either:
in the session record / journal (for example the last unifiedWindows with the frame's receive time), or
on the local socket (accounts.list already has a rateLimits object; per-session or per-account windows fed from the frame would make it accurate for active accounts without any request), or
No request to Anthropic is needed for any of these: the data is already in the stream Orca receives.
Why it matters
With dozens of sessions running, usage moves faster than any polling interval. A host-side switch or a pause decision made from the frame happens within one turn; from polling it happens minutes later, after sessions have already hit the limit.
+1 — adding a Windows / claude setup-token case where this frame is the only usage source available.
Setup: Orca 1.4.261, Windows 11, Claude Code 2.1.326, Max plan. Auth is a claude setup-token token in CLAUDE_CODE_OAUTH_TOKEN (to avoid recurring re-logins). ~/.claude/.credentials.json only holds an ended login (accessToken: "", loginEnded: "time_limit").
What happens:
The status bar shows no Claude usage. From the shipped bundle, the win32 usage path only reads .credentials.json (no keychain); with an empty access token and no refresh token under system provenance it returns unavailable ("No subscription plan — API key billing") without any fallback.
Claude Code itself does show the windows for this sign-in — /usage: "Current session 55% used / Current week (all models) 25% used — Other limits and usage credits aren't shown for this sign-in." So 5h/7d data reaches the client on normal responses.
Feeding the status bar (and accounts.listrateLimits) from the last rate_limit_event would turn "nothing" into accurate 5h/7d bars for setup-token users, with no extra requests. Possible order: OAuth usage API when a full-scope token exists → last rate_limit_event otherwise.
Activity
feat(native-chat): feed Claude chat rate_limit_event usage into the l…
feat(native-chat): include Fable's weekly window from chat rate_limit…
william7211 commentedon Nov 17, 2026
+1 — adding a Windows /
claude setup-tokencase where this frame is the only usage source available.Setup: Orca 1.4.261, Windows 11, Claude Code 2.1.326, Max plan. Auth is a
claude setup-tokentoken inCLAUDE_CODE_OAUTH_TOKEN(to avoid recurring re-logins).~/.claude/.credentials.jsononly holds an ended login (accessToken: "",loginEnded: "time_limit").What happens:
.credentials.json(no keychain); with an empty access token and no refresh token undersystemprovenance it returnsunavailable("No subscription plan — API key billing") without any fallback.CLAUDE_CODE_OAUTH_TOKENisn't consulted by that path, and a setup token only hasuser:inferenceanyway, so/api/oauth/usagecan't serve it (see [Feature]: Supportclaude setup-tokenfor managed Claude accounts #12002)./usage: "Current session 55% used / Current week (all models) 25% used — Other limits and usage credits aren't shown for this sign-in." So 5h/7d data reaches the client on normal responses.Feeding the status bar (and
accounts.listrateLimits) from the lastrate_limit_eventwould turn "nothing" into accurate 5h/7d bars for setup-token users, with no extra requests. Possible order: OAuth usage API when a full-scope token exists → lastrate_limit_eventotherwise.Related: #12002