Skip to main content
Claude Code is Anthropic’s agentic coding tool. E2B provides a pre-built claude template with Claude Code already installed.

CLI

Create a sandbox with the E2B CLI.
Once inside the sandbox, start Claude Code.

Run headless

Use -p for non-interactive mode and --dangerously-skip-permissions to auto-approve all tool calls (safe inside E2B sandboxes).

Example: work on a cloned repository

Structured output

Use --output-format json to get machine-readable responses — useful for building pipelines or extracting specific results.

Streaming output

Use --output-format stream-json to get a real-time JSONL event stream — including tool calls, token usage, and result metadata.

Resume a session

Claude Code persists conversations that can be resumed with follow-up tasks using --resume.

Custom system prompt

Write a CLAUDE.md file into the sandbox for project context or use --system-prompt to provide task-specific instructions.

Connect MCP tools

Claude Code has built-in support for MCP. E2B provides an MCP gateway that gives Claude access to 200+ tools from the Docker MCP Catalog.

Build a custom template

If you need to customize the environment (e.g. pre-install dependencies, add config files), build your own template on top of the pre-built claude template.
Run the build script to create the template.

MCP tools

Connect Claude Code to 200+ MCP tools

Sandbox persistence

Auto-pause, resume, and manage sandbox lifecycle

Git integration

Clone repos, manage branches, and push changes