Skip to main content
A snapshot is a saved state that a sandbox boots from. The environment is already set up inside it, so booting skips installation entirely.

Available snapshots

A name resolves to the first entry carrying it, so vsnap-base gives you the 256 MB one. To pin the other, pass its id. Both columns are accepted anywhere a snapshot is named. vsnap-base:latest is the default. Pass any other:
uv is preinstalled in every snapshot, so more Python packages can be added with uv pip install --system <package>. In a browser that reaches PyPI because PyPI sends CORS headers; apk add does not work there, because Alpine’s mirrors do not.

Snapshot API

Where the cache lives

The first Sandbox.create() downloads a snapshot and keeps it: on disk in Node, in origin-private storage in a browser. Later runs boot from the copy. Snapshots are stored compressed, so a 256 MB snapshot occupies well under a hundred megabytes. Still enough to be worth showing people.
clear() returns the number of bytes it freed and keeps suspended sandboxes, which live alongside the snapshots. Pass { instances: true } to drop those too. The next Sandbox.create() downloads again.
In Node the cache directory is shared with the CLI and the Python SDK. clear() removes only what it downloaded itself and leaves anything it could not fetch again, such as a snapshot you built locally. cached() still lists everything that is there, so the two can disagree, and that is deliberate.

Storage in a browser

Origin-private storage is site data rather than the HTTP cache, so the browser’s “clear cached images and files” does not touch it. A browser is also free to evict it when the disk fills up, which costs a re-download and nothing else.
Firefox prompts the user when you request persistence, so call it from something they clicked rather than on page load.