Skip to main content
For a complete guide on running Claude Code in E2B sandboxes — including working with repositories, streaming output, and connecting MCP tools — see the Agents in Sandbox: Claude Code guide.
Put the three files in one directory, set E2B_API_KEY and ANTHROPIC_API_KEY in your environment, build the template once, then run sandbox.ts (sandbox.py). The TypeScript files use top-level await, so run them in an ES module project (npm init -y && npm pkg set type=module && npm install e2b && npm install -D tsx, then npx tsx build.ts). For Python, pip install e2b, then python build.py.