---
title: "Fork"
url: https://www.daytona.com/definitions/f/fork
---

# Fork

A fork reconstructs the captured state of a sandbox more than once, which branches one sandbox into several copies.

A fork creates new sandboxes from the complete state of an existing one. The state includes the filesystem, the memory, and the running processes. Each copy starts from the exact point where the original was captured. After the fork, the copies run independently and can change in different ways.

A fork uses the same capability as pause, resume, and snapshot. The sandbox runtime captures the complete state of a sandbox to disk and then reconstructs it. A pause and resume reconstructs the state once, in place of the original. A fork reconstructs it more than once, and possibly on a different host. Copy-on-write storage lets the copies share unchanged data, so a fork costs much less than a full copy.

Forking is useful when one prepared state should lead to several different paths. An AI agent can fork a sandbox to try several approaches in parallel and keep the one that works. Test systems can fork a sandbox after an expensive setup step and run each test in its own copy. The idea is similar to the fork system call in Unix, which copies a process. In a sandbox, the whole environment is copied instead of one process.

## Related terms

- [Checkpoint and restore](https://www.daytona.com/definitions/c/checkpoint-and-restore.md)
- [Pause and resume](https://www.daytona.com/definitions/p/pause-and-resume.md)
- [Snapshot](https://www.daytona.com/definitions/s/snapshot.md)
