Deploy to Cloudflare Sandboxes
The backends/cloudflare/ directory implements the same execution contract as the local compose stack, running on Cloudflare Sandboxes (GA since April 2026). Sessions become Durable Object instances; the same ant beta:worker poll runs inside each one.
One-click deploy
Section titled “One-click deploy”Cloudflare Sandboxes require a Workers Paid plan with Containers enabled. Click the button to clone the repository into your connected GitHub or GitLab account, provide the required secrets, and deploy the backend.
Manual deploy with wrangler
Section titled “Manual deploy with wrangler”-
Authenticate and install dependencies.
Terminal window cd backends/cloudflarebun installbunx wrangler login -
Add the required Worker secrets. These must be secrets, not plaintext vars — agent tool calls can read the worker environment.
Terminal window bunx wrangler secret put ANTHROPIC_ENVIRONMENT_KEYbunx wrangler secret put ANTHROPIC_ENVIRONMENT_IDbunx wrangler secret put SANDBOX_API_TOKEN -
Deploy.
Terminal window bunx wrangler deployThe
wrangler.jsoncinstance_typedefaults tolite. Raise it to a larger instance type if sessions require more memory or CPU.
Start a session
Section titled “Start a session”Once deployed, start the Anthropic worker inside a sandbox by posting to the session endpoint:
curl -X POST "https://claude-sandbox-cf.<your-subdomain>.workers.dev/sessions/<random-session-id>/ant" \ -H "Authorization: ******"MCP servers running inside the sandbox are reachable through the SDK’s native
cloudflared quick tunnel; see sandbox.tunnels.get(port) in the Worker source.
Relationship to the local compose backend
Section titled “Relationship to the local compose backend”Both backends implement the same contract. See the architecture explanation for a comparison.