Skip to content
ArticleIntermediate

Build a coding agent runner

Build a Worker that clones a GitHub repository into a Linux sandbox, runs Claude Code on a task in the background, and returns its changes as a diff.

Last updated
Oct 22, 2026
Read the original

You send a prompt, a coding agent edits a GitHub repository inside an isolated Linux sandbox, and you read its changes back as a diff. The runner uses Claude Code, which calls Anthropic models through AI Gateway; the Worker injects the gateway token so the sandbox never holds it.

What you’ll learn

  • Create a Sandbox SDK project
  • Restrict the sandbox’s outbound traffic to AI Gateway and GitHub
  • Run Claude Code in the background and route requests to it
  • Deploy the runner and run a task end to end

Cloudflare products used

Sandbox SDK, Workers, AI Gateway.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

Keep learning