Follow-up from #19807, split out as suggested there (thanks @JustYannicc). #19820 covers hub reads; this is the native Claude provider with one login and no CLIProxyAPI hub.
Setup: one Mac, one Claude login, T3 Code Nightly 0.1.6-nightly.20261030.3917, Claude Code 2.1.314.
What happens: every capability probe starts a fresh Claude Code process, and that process reads /api/oauth/usage. Anthropic rate-limits this endpoint per account, so the probes 429 everything else on the same login, including OpenUsage. Data is in my comment on #19807: with probes kept off the endpoint, 113 fresh reads and 0 429s; with probes allowed, a 429 within a minute.
What the code does now (per the triage on #19807, main 6fc9144a60):
ClaudeDriver.ts caches a probe with fresh usage for 5 minutes, but a failed read caches for zero time, so the next refresh probes again at once with no back-off.
refreshUsage, workspace scans and model refreshes all drop the cache before probing.
- On failure the provider reports "unavailable" instead of the last good reading.
- Workspace probes call it with usage off, but the CLI still seems to read the endpoint on startup unless
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 is set.
Asks:
- Back off after a failed usage read (honour
Retry-After) and keep that across probe processes.
- Keep showing the last good reading while rate-limited.
- One throttle shared by every refresh route.
- Set
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 for probes that don't need usage (workspace/model scans).
- Optionally, during active sessions, use
rate_limit_event data instead of polling.
Workaround for anyone hitting this: point the Claude binaryPath at a wrapper that sets CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 for probe launches. The Limits panel then shows "unavailable", but nothing 429s.
Written by Claude Opus 5.5 (Claude Code) on behalf of @jamesembling.
Still reproducible on the current stable release. Same root cause as described above, plus some details from the installed bundle.
Environment
Symptom Usage → Limits shows Codex normally. Claude has no bars, only "Could not read limits." The cached Claude provider snapshot has:
What the endpoint returns A single direct
GET https://api.anthropic.com/api/oauth/usagewith the local OAuth token (anthropic-beta: oauth-2025-04-20) returns:The token is valid and has the
user:profilescope. Inference keeps working normally. Only the usage endpoint is throttled.Why it never recovers
Each capability probe (
probeClaudeCapabilities) spawns a fresh Claude Code process and callsusage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET(), which hits/api/oauth/usage. This runs on the 5-minute provider refresh, andrefreshUsagealso invalidatescapabilitiesProbeCachebefore probing.Claude Code 2.1.332 does honour
Retry-After("429 remembered for this bearer; not asking again for Ns"), but that hold lives in process memory only. Every new probe process starts without it and asks again, so the account stays rate-limited.The CLI's persisted fallback (
cachedUsageUtilizationin~/.claude.json) is only used as a seed when it is under 1 hour old. Mine was last written about 15 hours earlier, at the last successful read. Soget_usagereturnsrate_limits_available: true, rate_limits: null, andclaudeUsageResponseToLimitsmaps that toprobeFailed.The streamed fallback doesn't help either (#30310). Active Claude sessions emit events like this one, from my own session:
In 0.1.13,
claudeRateLimitEventToUpdatestill returns early when there is no top-levelutilization, so these numbers are dropped and the panel stays empty even while Claude is in use.Suggestions (in line with the original request)
Retry-Afteracross probe processes, and skip the usage call while it is active. Today nothing stops the next probe from asking again.refreshUsagewhile a back-off is active.rate_limit_info.unifiedWindows(#28869 / #31135). The bars would then fill from live sessions without polling the endpoint at all.