Claude Code Rate Limits: What to Do When You Hit Them

Why Claude Code gets rate limited, what the error messages mean, and five strategies to keep working when you hit the wall. Updated July 2026.

Direct Answer

When Claude Code shows a rate limit or overload error, first check status.anthropic.com to rule out a service-wide outage. If Anthropic is healthy, you have hit your plan’s credit pool (Max subscription) or your per-minute token cap (API key). The fastest fix is to switch to a different runtime — Codex CLI or Gemini CLI can handle the same coding tasks and draw from completely separate quota pools. amux supports all three runtimes from one dashboard so you can continue without interruption.

What Triggers Claude Code Rate Limits

Claude Code uses the Claude API under the hood. The rate limits you encounter depend on which access model you are using — a Max subscription plan or direct API keys.

Claude Code Max Subscription Plans

Claude Code Max plans replace per-token billing with a monthly credit pool. When the pool is exhausted, Claude Code stops accepting requests until the next billing cycle. There are two tiers:

The critical difference from API key billing: there is no per-minute cap, but once your monthly credits are gone, you are locked out for the rest of the period regardless of how much time remains. Running ten parallel agents on Max 5x exhausts credits ten times faster than running one.

Direct API Keys (Pay-As-You-Go)

If you supply an Anthropic API key directly to Claude Code instead of using a Max plan, rate limits are enforced differently — as per-minute and per-day token counts rather than a monthly pool. These limits are visible in the Anthropic Console under Usage & Limits. You can request higher limits through Anthropic support once your account has established usage history.

API key limits are typically more granular — a burst of many short requests in a short window can hit the per-minute cap even if your overall daily usage is low. This is the most common cause of rate limit errors for developers running automated agent loops.

Service-Wide Overload

Anthropic occasionally experiences high demand that affects all accounts simultaneously. These show up as “overloaded” errors that are unrelated to your plan or usage level. Always check status.anthropic.com first — if there is an active incident, waiting it out (or switching runtimes) is the only option.

Error Messages and What They Mean

Claude Code surfaces several distinct error messages when limits are hit. Each one points to a different root cause and a different fix.

Error Message Root Cause What to Do
“Claude AI is currently experiencing high demand. Please wait a moment and try again.” Service-wide overload or your API rate limit was hit Check status.anthropic.com; if healthy, wait 60–120 seconds or switch to Codex/Gemini CLI
“overloaded” API returned HTTP 529 — server capacity issue Check status.anthropic.com; usually resolves within minutes; switch runtimes if time-sensitive
“prompt too long” Context window exceeded — accumulated context is larger than the model’s limit Start a new session; enable context compaction; use /compact command in Claude Code
“rate_limit_error” (API key users) Per-minute or per-day token cap reached on your API key Wait for the per-minute window to reset (usually 60s); reduce parallel sessions; request higher limits in Anthropic Console

The “prompt too long” error is technically not a rate limit — it is a context size constraint. But it appears alongside rate limit errors when sessions run long, because large contexts also make each API call more expensive and can push you toward per-minute token caps faster.

5 Strategies to Avoid and Handle Rate Limits

1. Multi-Runtime Fallback

The most effective immediate fix: when Claude is rate-limited, switch to Codex CLI (OpenAI) or Gemini CLI (Google). These runtimes are fully capable of handling the same coding tasks — reading files, editing code, running tests — and they pull from completely separate quota pools. If Claude hits its wall at 2 AM during an overnight run, your agent fleet does not have to stop.

amux supports all three runtimes (Claude Code, Codex, and Gemini CLI, also known as Antigravity CLI) from the same dashboard. You can reassign sessions to a different runtime without changing your task prompts or losing context from the board.

2. Context Compaction

Shorter context means fewer tokens per API call. Fewer tokens per call means lower rate-limit pressure — especially on per-minute caps for API key users. Claude Code can automatically compact (summarize) the conversation when context grows large; you can also trigger this manually with /compact.

amux auto-compacts context for sessions it manages. Beyond compaction, keeping sessions scoped to one task rather than one long multi-task session significantly reduces how much context accumulates before the task is done.

3. Stagger Session Starts

When running many agents in parallel on a Max subscription, starting them all simultaneously creates a burst of API calls in the same minute. This can push API key users past per-minute limits and causes Max plan credits to drain unevenly. Staggering session starts by 30–60 seconds spreads the load and reduces burst-related limit hits.

# amux stagger example — start sessions 30s apart
# Start first session
amux session start auth-refactor --runtime claude

# Wait 30 seconds before starting the next
# (amux scheduler can automate this spacing)
amux session start docs-update --runtime codex

4. Model Routing

Not every task requires Claude’s full capability. Routing lower-stakes work to Codex or Gemini CLI not only preserves Claude credits for tasks that genuinely need Claude’s strengths — it also reduces your total rate-limit exposure because quota pools are independent.

A practical split:

5. Max Plan Upgrade

If you regularly exhaust Max 5x credits before the end of the month, the arithmetic usually favors upgrading to Max 20x rather than throttling your workflow. At $200/month for 20x usage, the per-unit credit cost is lower, and you eliminate the interruptions caused by hitting the credit wall mid-project.

Before upgrading, use amux’s Cost tab to verify that you are actually exhausting subscription credits rather than hitting a per-minute API burst limit — the fix for those two problems is different.

How amux Helps

amux is an open-source control plane for AI agent teams. It addresses rate limits at three levels: visibility, resilience, and multi-runtime routing.

Cost Tab: Real-Time Token Spend per Session

The amux dashboard’s Cost tab shows real-time token spend broken down by session. For Max plan users who have no built-in credit meter, this is the only way to see which agent is consuming the most budget before you hit the limit. For API key users, it surfaces per-session usage so you can identify which session is driving you toward the per-minute cap.

# Programmatic per-session token breakdown
curl -sk $AMUX_URL/api/observability | python3 -c "
import json, sys
data = json.load(sys.stdin)
for s in data.get('sessions', []):
    print(s['name'], '|', s.get('total_tokens', 0), 'tokens', '|', s.get('total_cost_usd', 0), 'USD')
"

Multi-Runtime Support

amux treats Claude Code, Codex CLI, and Gemini CLI as interchangeable runtimes. Sessions can be assigned to any runtime; the board, CRM, kanban, and email integrations work the same regardless of which model is driving the agent. When Claude is rate-limited, you switch the affected sessions to Codex or Gemini from the dashboard — no reconfiguration required.

Self-Healing Watchdog

amux runs a watchdog that monitors each session for overload and rate-limit errors. When a session gets an overload response, the watchdog can automatically retry after a backoff delay or mark the session for manual review on the board. This prevents silent failures where an agent appears to be running but has actually been blocked by a rate limit for hours.

Context Auto-Compaction

amux monitors context size across sessions and triggers compaction before context grows large enough to cause “prompt too long” errors or push per-call token costs up toward rate-limit thresholds. This is especially useful for overnight runs where no developer is watching the sessions.

amux — multi-runtime fallback when Claude hits rate limits (307★ GitHub)
Switch from Claude Code to Codex or Gemini CLI mid-session. Self-healing watchdog retries on overload. Cost tab tracks token spend per session in real time.
View on GitHub ★

Max 5x vs Max 20x vs API Keys: Rate Limit Behavior

Plan Cost Rate Limit Type What Happens When You Hit It Best For
Claude Code Max 5x $100/month Monthly credit pool (5× Pro) Claude Code stops working until next billing cycle Individual developers, moderate parallel usage (1–5 sessions)
Claude Code Max 20x $200/month Monthly credit pool (20× Pro) Same — locked out until next cycle, but much harder to exhaust Teams, heavy agent fleets, 10+ parallel sessions
Anthropic API Key Pay-per-token (no monthly cap) Per-minute and per-day token counts Requests fail with 429 until the per-minute window resets (60s); no monthly lockout Variable workloads, cost transparency, usage above Max plan limits

Key trade-off: Max plans give predictable monthly costs but risk a hard stop if you over-run your credits. API keys have no monthly ceiling but expose you to burst-rate limits that are easy to hit with many parallel agents. Many teams use a hybrid — Max plan for primary sessions, API key accounts for overflow agents routed through Codex or Gemini CLI.

FAQ

Why is Claude Code saying rate limit exceeded?

Claude Code rate limits come from two sources. If you are on a Claude Code Max subscription (Max 5x at $100/month or Max 20x at $200/month), you have a fixed monthly credit pool — hitting the limit means your credits are exhausted for the period. If you are using a direct Anthropic API key, rate limits are per-minute and per-day token caps enforced by the API; you can view your current limits in the Anthropic Console at console.anthropic.com. Service-wide outages also produce “overloaded” errors — check status.anthropic.com to rule that out.

How do I fix Claude Code ‘overloaded’ errors?

First, check status.anthropic.com to see if there is a service-wide outage. If Anthropic is healthy, the overloaded message means your account or plan hit a rate limit. For subscription plans: reduce parallel sessions, wait for your credit window to reset, or upgrade to a higher Max tier. For API keys: slow down request volume, reduce context size, or request a rate limit increase from Anthropic support. As a faster alternative, switch to a different runtime (Codex CLI or Gemini CLI) mid-session — amux supports all three from the same dashboard so you can continue work without interruption.

What is the difference between Claude Code Max 5x and Max 20x?

Both plans are subscription-based with a monthly credit pool rather than per-token billing. Max 5x ($100/month) gives five times the usage of Claude Code Pro, making it suitable for developers running a moderate number of concurrent sessions. Max 20x ($200/month) provides twenty times the Pro usage, designed for teams or individuals running large agent fleets with many parallel sessions. When the monthly credit pool is exhausted, Claude Code will show rate limit errors until the next billing cycle. Using the Anthropic API with direct API keys bypasses these subscription caps but subjects you to per-minute and per-day token rate limits instead.

Can I run multiple Claude Code agents without hitting rate limits faster?

Yes, but each parallel agent consumes credits or API quota independently. On a Max subscription, running five agents in parallel exhausts your credit pool five times faster than running one. Strategies to reduce rate-limit pressure when running multiple agents: (1) stagger session starts so they do not all make API calls simultaneously, (2) use context compaction to keep each session’s token footprint small, (3) route lower-priority tasks to Codex CLI or Gemini CLI instead of Claude Code — both support the same coding tasks and draw from separate quota pools, (4) upgrade to Max 20x if you regularly hit Max 5x limits. amux’s multi-runtime support lets you split work across Claude, Codex, and Gemini from one dashboard.

How do I monitor Claude Code token usage to avoid hitting limits?

For API key users, the Anthropic Console (console.anthropic.com) shows per-day token usage against your rate limit cap. For Max plan users, there is no real-time credit meter in Claude Code itself — you discover the limit when you hit it. amux’s Cost tab tracks real-time token spend per session, so you can see which agent is consuming the most budget before you hit the wall. The /api/observability endpoint returns machine-readable per-session token counts you can feed into your own alerting.