--setup runs that step, saves the prepared sandbox as a snapshot on the host, and later runs start from it and skip the step:
node_modules already there. It works with ephemera dev too.
When a snapshot is reused
A snapshot is tied to:- the project,
- the setup command,
- the sandbox size,
- the project’s dependency files, at the top of the worktree, when they’re there:
package.json,package-lock.json,npm-shrinkwrap.json,yarn.lock,pnpm-lock.yaml,bun.lock,bun.lockb,requirements.txt,requirements-dev.txt,pyproject.toml,poetry.lock,Pipfile.lock,uv.lock,go.mod,go.sum,Cargo.toml,Cargo.lock,Gemfile,Gemfile.lock,composer.json,composer.lock.
--json, a snapshot event says whether a snapshot was used, and why not when it wasn’t.
Where snapshots live
On the host that made them, in/var/lib/ephemera/snapshots. A snapshot holds your code and its dependencies, so the host keeps it only encrypted, with AES-256-GCM:
- The key is made on your laptop, one per project, and stays in your config folder (
snapshot-keys/). - It goes straight to the host when a snapshot is saved or loaded, never through the central server.
- The host decrypts a snapshot only into the folder of the sandbox using it, which is deleted with the sandbox.
--max-snapshot-bytes). A snapshot made on one host isn’t used on another: the first run on each host makes its own.
Secrets stay out
Setup runs before your secrets arrive:- Files sent with
--include, such as.env.local, are added after setup finishes and the snapshot is saved. --envvalues go to the main command only.