Claude Code utilities: auto-switching subscription proxy + system tray usage monitor.
Claude Code --> claudeUtils proxy (localhost:3456) --> api.anthropic.com
|
+-- account A rate-limited? --> try account B
+-- all base exhausted? --> escalate to extra-usage tier
+-- all exhausted? --> return 429 with reset time
The tray app sits in your system tray, shows live rate-limit usage, and manages the proxy -- start/stop, view logs, see active account. The proxy runs invisibly as a subprocess.
cd ~/ClaudeSwitcher
pip install -r requirements.txt
# Import your current subscription
node src/index.js add --from-credentials --label my-max
# Wire Claude Code to use the proxy
node src/index.js setup
# Launch the tray app (starts proxy automatically)
pythonw tray/tray_app.pyCreate a shortcut to pythonw tray/tray_app.py and drop it in shell:startup.
Right-click the tray icon for:
- Show Usage -- popup with 5-hour, weekly, and Sonnet rate limit bars
- Refresh Now -- re-scrape claude.ai for fresh usage data
- Poll Frequency -- how often to auto-scrape (30s to 10m)
- Proxy submenu:
- Active account label (dynamic)
- Start/Stop Proxy
- Open Logs -- opens
data/proxy.login your editor
Left-click opens the usage popup. On quit, the proxy is stopped automatically.
Import from active Claude Code session:
node src/index.js add --from-credentials --label personal-max --priority 0Add a pay-as-you-go API key:
node src/index.js add --type apikey --label backup-key --priority 2Add as extra-usage tier (only used after all base accounts are exhausted):
node src/index.js add --from-credentials --label my-max-extra --priority 10 --extra- Claude Code sends a request to the proxy (via
ANTHROPIC_BASE_URL) - Proxy injects the active account's credentials and forwards to Anthropic
- If Anthropic returns 429 (rate limited):
- Marks that account as rate-limited
- Picks the next available account by priority
- Retries the request -- Claude Code never sees the 429
- If all base accounts are rate-limited, auto-escalates to extra-usage tier
- If everything is exhausted, returns 429 with the earliest reset time
Responses stream through immediately (no buffering) -- SSE works correctly.
Accounts have a tier (base or extra). The proxy exhausts all base-tier accounts before touching extra-tier ones. Burn through included quotas first, fall back to paid extra usage only when necessary.
node src/index.js tier my-max-extra extra| Command | Description |
|---|---|
start |
Start the proxy (default port 3456) |
add --from-credentials |
Import current .credentials.json |
add --type apikey |
Add an API key |
list |
Show all accounts with status |
status |
Proxy health, active account, rate limits |
remove <label|id> |
Remove an account |
priority <label|id> <n> |
Change priority (0 = tried first) |
tier <label|id> <base|extra> |
Change account tier |
enable / disable <label|id> |
Toggle an account |
setup |
Wire Claude Code to use the proxy |
teardown |
Disconnect Claude Code from proxy |
bypass |
Emergency: disable proxy, restore direct connection |
restore |
Re-enable proxy after bypass |
All commands: node src/index.js <command>
If the proxy breaks or causes issues, bypass it instantly:
node src/index.js bypass
# Or via PowerShell (works even if Node is broken)
powershell -File scripts/bypass.ps1This removes ANTHROPIC_BASE_URL from Claude Code's settings. New sessions go straight to Anthropic. Reverse with node src/index.js restore or scripts/restore.ps1.
src/ # Node.js proxy
tray/ # Python tray app + usage monitor
tray_app.py # entry point (run with pythonw)
proxy_manager.py # manages proxy subprocess
popup_window.py # usage popup UI
scraper.py # claude.ai usage scraper
scripts/ # PowerShell bypass/restore
data/ # runtime data (gitignored)
accounts.json # credential store
state.json # rate-limit tracking
proxy.log # log file (rotates at 5 MB)
- Node.js >= 18 (proxy, zero npm dependencies)
- Python >= 3.11 (tray app)
pip install -r requirements.txt