Quick Use
- Have a Daytona sandbox configured (
pip install daytona-sdk) - Set up the base state with
sandbox.process.exec(...), then callsandbox.snapshot(name="...") - Spawn branches with
daytona.create_from_snapshot(snapshot_id)
Intro
Daytona Snapshots freeze a complete sandbox state — files, installed packages, environment variables, and even running processes (where supported) — into an immutable image. Spin up new sandboxes from a snapshot in milliseconds. Best for: agent tree-search algorithms, reproducible benchmark fixtures, branching exploration where multiple agents try different approaches from the same starting state. Works with: Daytona Python / TypeScript SDK. Setup time: 1 minute.
Take a snapshot
from daytona import Daytona
daytona = Daytona()
# Set up a base environment
sandbox = daytona.create()
sandbox.process.exec("apt-get install -y postgresql")
sandbox.process.exec("git clone https://github.com/example/app /work")
sandbox.process.exec("cd /work && npm install")
# Freeze the state — fast restore for downstream tasks
snapshot_id = sandbox.snapshot(name="app-base-2026-05-07")Spin up many sandboxes from one snapshot
# Each sandbox starts at the snapshot state — no re-install, no clone
sb_lint = daytona.create_from_snapshot(snapshot_id)
sb_test = daytona.create_from_snapshot(snapshot_id)
sb_e2e = daytona.create_from_snapshot(snapshot_id)
# Run different things in parallel
sb_lint.process.exec("npm run lint")
sb_test.process.exec("npm test")
sb_e2e.process.exec("npx playwright test")Tree search for agents
def explore(snapshot, depth=0, max_depth=3):
if depth >= max_depth:
return evaluate(snapshot)
candidates = generate_next_actions(snapshot)
best_score = -float("inf")
best_action = None
for action in candidates:
sb = daytona.create_from_snapshot(snapshot)
sb.process.exec(action.command)
new_snapshot = sb.snapshot()
score = explore(new_snapshot, depth + 1, max_depth)
if score > best_score:
best_score, best_action = score, action
return best_scoreEach branch is a real sandbox with real state — agents can run tests, observe failures, and decide based on actual outcomes rather than hallucinated predictions.
Reproducible benchmarks
# Bench fixture — frozen state for SWE-Bench / HumanEval / etc
fixture = daytona.create_from_snapshot("swebench-django-3.2.fixture")
# Apply the agent's patch
fixture.fs.upload_file("/repo/patch.diff", patch_text)
fixture.process.exec("cd /repo && git apply patch.diff")
# Run the test suite
result = fixture.process.exec("cd /repo && pytest tests/django/")
score(result)Same fixture for every model run — no flaky environment differences.
FAQ
Q: Are snapshots free? A: Snapshots count toward your Daytona storage quota. Free tier includes some snapshot storage; production usage is metered per-GB-month. Check daytona.io/pricing for current rates.
Q: How big can a snapshot be? A: Snapshots can be tens of GBs (full Linux + dependencies + data). Daytona uses copy-on-write under the hood — creating a sandbox from a snapshot doesn't duplicate the data, so spawning many branches from one snapshot is cheap.
Q: Are snapshots cross-account-shareable? A: Yes — snapshots can be made public or shared within an organization. Useful for distributing benchmark fixtures or starter environments across a team.
Source & Thanks
Built by Daytona. Apache-2.0 (core).
daytona.io/docs — Snapshots documentation