Statusline usage data unavailable with multiple concurrent sessions (OAuth rate limit exhausted)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Running 3+ concurrent Claude Code sessions on Max/Team plans causes the built-in statusline to permanently show -% (-) for usage data.
Each session's internal polling consumes the shared OAuth API rate limit. With 5 sessions, the rate limit is exhausted before any external statusLine.command can make a single successful call — every request returns HTTP 429.
This means there's no way to monitor 5-hour block usage or weekly limits, which is critical for managing work across sessions and avoiding unexpected rate limits mid-task.
Proposed Solution
The statusline could fall back to the claude.ai web API (GET /api/organizations/{orgId}/usage) when the OAuth API is rate-limited. This endpoint returns the same usage data but uses a separate rate limit bucket that doesn't compete with Claude Code sessions.
Ideally, Claude Code could:
- Detect repeated 429s on the OAuth endpoint
- Fall back to the web API using Claude Desktop's session cookies (already available on macOS via Keychain)
- Cache responses across sessions (file-based, 30s TTL) so only one session makes the API call
Alternative Solutions
I built a community workaround: claude-web-usage (npm package, MIT licensed).
It works as a drop-in statusLine.command replacement that:
Decrypts Claude Desktop's Chromium cookies (AES-128-CBC via macOS Keychain)
Calls the web usage API in-process (child processes get blocked by Cloudflare)
Caches responses for 30s with file-based locking across all sessions
Install: npm install -g claude-web-usage
GitHub: https://github.com/skibidiskib/claude-web-usage
This works but ideally the fix would be built into Claude Code natively.
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
I open 5 Claude Code sessions across different projects
I need to monitor my 5-hour block usage to pace my work
The statusline shows -% (-) because all OAuth API calls return 429
I have no visibility into whether I'm at 20% or 90% of my limit
I hit the rate limit unexpectedly and all sessions slow down
With this fix, the statusline would fall back to the web API and show accurate usage data like 36% (1h 34m left)
Additional Context
Technical notes:
- The web API endpoint is GET https://claude.ai/api/organizations/{orgId}/usage
- Returns five_hour.utilization, five_hour.resets_at, seven_day.utilization
- Chromium v10 cookie encryption: PBKDF2(keychain_password, "saltysalt", 1003, 16, SHA1) → AES-128-CBC
- Decrypted cookies have a 32-byte binary prefix before the actual value
- HTTPS must be called in-process — Cloudflare blocks child process requests even with cf_clearance
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗