Skip to content

Claude Code Error & Failover Playbook

Fix Claude Code 529 Overloaded & 429 Rate Limit Errors in 30 Seconds

Understand HTTP 529 overloaded_error vs 429 ITPM ramp limits & 5-hour Pro/Max caps in Claude Code, and add a zero-touch cc-relay shell alias to resume coding without logging out.

529 vs 429 vs 5-Hour Cap: Exact Root Cause & Fix

529 vs 429 vs 5-Hour Cap: Exact Root Cause & Fix
Error / SymptomLayerWhat Actually HappenedImmediate Mitigation
HTTP 529 · overloaded_errorUpstream clusterGlobal capacity saturation on the primary Anthropic region—not your account quota.Launch cc-relay (routes to /anthropic on claude-sonnet-5-5 or glm-5.3) to bypass congested queues.
HTTP 429 · rate_limit_error (ITPM / OTPM)API org tierUncached input/output tokens per minute or sudden vertical ramp burst exceeded tier cap.Keep repo context stable so cached tokens bypass ITPM limits, or offload fast loops to deepseek-v4.1-flash.
5-hour session / weekly usage limitClaude Pro / Max OAuthRolling subscription window exhausted mid-sprint; hard cooldown until window resets.Run cc-relay --continue in the same directory—resumes the local session on prepaid USD ($5 min, 0% fee) without touching OAuth.
Unexpected cache-write cost spikePrompt cache TTLMutating system prompts or hopping across random upstream accounts invalidates prefix cache.Use deterministic sticky /anthropic routing ($0.05/1M Sonnet cache read, -50% vs official USD).

30-Second Non-Destructive Failover (macOS / Linux zsh & bash)

Editing ~/.claude/settings.json globally overrides your Claude Pro or Max subscription even after your 5-hour window resets. Instead, define a shell function cc-relay: normal `claude` keeps using your subscription login, while `cc-relay --continue` resumes your exact conversation over ProxyStacks Relay (/anthropic) whenever 529 or 429 strikes.

~/.zshrc · ~/.bashrc (cc-relay)
# ~/.zshrc or ~/.bashrc — keeps default `claude` on your Pro/Max OAuth login!
# Run `cc-relay` only when Claude Code hits HTTP 529 overloaded_error or 429 / 5-hour limits:
export RELAY_API_KEY="sk-relay-your-key"

cc-relay() {
  ANTHROPIC_BASE_URL="https://proxystacks.com/anthropic" \
  ANTHROPIC_AUTH_TOKEN="$RELAY_API_KEY" \
  ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5-5" \
  ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-5-5" \
  ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-5-5" \
  ANTHROPIC_SMALL_FAST_MODEL="deepseek-v4.1-flash" \
  claude "$@"
}

Windows PowerShell Scoped Failover Function

$PROFILE (PowerShell cc-relay)
# Windows PowerShell ($PROFILE) — non-destructive `cc-relay` failover command
$env:RELAY_API_KEY = "sk-relay-your-key"

function cc-relay {
  $prevUrl = $env:ANTHROPIC_BASE_URL
  $prevToken = $env:ANTHROPIC_AUTH_TOKEN
  try {
    $env:ANTHROPIC_BASE_URL = "https://proxystacks.com/anthropic"
    $env:ANTHROPIC_AUTH_TOKEN = $env:RELAY_API_KEY
    $env:ANTHROPIC_DEFAULT_SONNET_MODEL = "claude-sonnet-5-5"
    $env:ANTHROPIC_SMALL_FAST_MODEL = "deepseek-v4.1-flash"
    claude @args
  } finally {
    $env:ANTHROPIC_BASE_URL = $prevUrl
    $env:ANTHROPIC_AUTH_TOKEN = $prevToken
  }
}

Why Cached Tokens Prevent Both 429 Throttling & Bill Shock

In Claude Code, 85%–92% of every turn is repeated repository and tool context. On Anthropic-compatible architectures, cache-read tokens are exempt from standard Input Tokens Per Minute (ITPM) rate limits and cost 90% less than fresh input ($0.05/1M on claude-sonnet-5-5 via Relay vs $1.00/1M uncached). Offloading ANTHROPIC_SMALL_FAST_MODEL to deepseek-v4.1-flash ($0.18/1M peak, $0.0895/1M off-peak) further cuts background file-indexing bursts.

Common questions

Will running cc-relay log me out of my Claude Pro or Claude Max subscription?

No. Passing ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN inline inside the cc-relay shell function scopes those environment variables strictly to that process. Your ~/.claude.json OAuth token remains intact for standard `claude` sessions.

Can cc-relay --continue resume a conversation stalled by a 529 or 5-hour limit?

Yes. Claude Code persists conversation transcripts locally on disk per project directory. Running `cc-relay --continue` (or `cc-relay --resume`) picks up the exact local thread immediately against your prepaid Relay balance (from US$5, 0% top-up fee, non-expiring).

What if Anthropic models themselves are globally degraded during a major outage?

Because ProxyStacks Relay exposes all 21 models on the native /anthropic wire protocol, you can pass `ANTHROPIC_MODEL=glm-5.3 cc-relay` or `ANTHROPIC_MODEL=gpt-6.1-sol cc-relay` inside Claude Code without installing any format-translation proxy.