Templates
A template is the environment a sandbox starts from: a Debian image with runtimes and tools installed, captured as a snapshot so sandboxes are restored rather than booted. It also sets the sandbox's CPU and memory.
Built-in templates#
| Template | vCPU | Memory | Forkable | Includes |
|---|---|---|---|---|
claude-code | 2 | 2 GiB | yes | Claude Code CLI, Node.js 22, Rust, Python 3 with uv |
python | 2 | 512 MiB | yes | Python 3 with pip, venv and uv |
nodejs | 2 | 512 MiB | yes | Node.js 22 with npm |
ci-runner | 2 | 2 GiB | no | Node.js 22, Rust, uv and native build tools |
minimal | 1 | 512 MiB | no | Just the basics |
Every template is based on Debian 12 and includes git, curl and CA certificates. Pass the name to client.sandbox(template=…).
claude-code#
Everything Claude Code needs, plus the common toolchains it reaches for.
- Claude Code CLI (
@anthropic-ai/claude-code) - Node.js 22, Rust (stable), Python 3 with pip, venv and uv
build-essential,jq,ripgrep,fd-find,openssh-client
with client.sandbox(template="claude-code") as sb:
print(sb.exec(["claude", "--version"]).stdout)python#
A small Python environment. Use uv to manage projects and dependencies.
with client.sandbox(template="python") as sb:
sb.exec(["sh", "-c", "uv init demo && cd demo && uv add pandas"])
print(sb.exec(["sh", "-c", "cd demo && uv run python -c 'import pandas; print(pandas.__version__)'"]).stdout)nodejs#
Node.js 22 and npm.
with client.sandbox(template="nodejs") as sb:
sb.exec(["sh", "-c", "npm init -y && npm install express"])ci-runner#
For building and testing code: Node.js 22, Rust, uv, build-essential, pkg-config, libssl-dev, libclang-dev and jq.
minimal#
One vCPU with git, curl and jq. The lightest environment, for quick commands.
Custom templates#
Build your own template from a Dockerfile, then use it by name like a built-in one.
client.create_template("data-science", dockerfile="""
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-venv git curl ca-certificates
RUN python3 -m venv /opt/venv && /opt/venv/bin/pip install pandas numpy scikit-learn
ENV PATH="/opt/venv/bin:$PATH"
""")
with client.sandbox(template="data-science") as sb:
print(sb.exec(["python", "-c", "import sklearn; print(sklearn.__version__)"]).stdout)Manage your templates with client.list_templates(), client.get_template(name) and client.delete_template(name).
How templates are stored#
A template is built once and captured as a snapshot. Sandboxes started from it share its disk blocks, which are stored by content, and each sandbox writes to its own private layer on top:
Identical blocks across templates are stored once, so a custom template only adds what is different about it.