Cloudflare 403 blocks parallel subagent dispatch

Resolved 💬 3 comments Opened Mar 3, 2026 by bemental Closed Mar 7, 2026

Description

When running multiple subagents in parallel (via the Agent tool with run_in_background: true), Cloudflare's WAF on api.anthropic.com returns 403 responses with a JavaScript challenge page instead of routing to the API. This effectively kills agents mid-task with no recovery path.

Reproduction

  1. Launch Claude Code with a project that uses an orchestrator agent
  2. Dispatch 8-11+ subagents in parallel (e.g., test-writers in worktree isolation)
  3. After ~2-5 minutes, some agents begin receiving 403 responses from Cloudflare
  4. The 403 body is a Cloudflare JS challenge (Just a moment... page), not an Anthropic API error

Error

API Error: 403 <!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title>
...
window._cf_chl_opt = {cvId: '3', cZone: 'api.anthropic.com', cType: 'managed', ...}

Expected behavior

Parallel subagent API calls should succeed when the account is within its rate limits. Cloudflare should not be blocking legitimate Claude Code traffic from Anthropic's own CLI tool.

Environment

  • Claude Code v2.1.63
  • Model: claude-opus-4-6 (main) + claude-sonnet-4-6 (subagents)
  • macOS Darwin 24.5.0
  • ~8-11 concurrent subagents via Agent tool
  • Account is well within API usage limits

Workaround

Capping parallelism to ~4-5 concurrent agents reduces the frequency but doesn't eliminate the issue entirely.

Notes

Parallel subagent dispatch is a designed feature of Claude Code (Agent tool + run_in_background). The orchestrator pattern — where a coordinator dispatches specialized agents for parallel work — is a core workflow. Cloudflare's bot protection should be tuned to allow this traffic pattern from authenticated API clients.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗