Skip to main content
When you upgrade SmolVM, the new release pulls a fresh set of pre-built sandbox images. The images from older releases stay on disk under ~/.smolvm/images/ and slowly add up. The smolvm prune command finds those leftover image folders and deletes them so you get the space back. Run it any time after an upgrade. It only touches caches that belong to versions you’re no longer using, so your current sandboxes keep working.
smolvm prune is an alias of smolvm image prune — same implementation, same flags. Either name works. The image group is the canonical home; the top-level smolvm prune is kept for backward compatibility.

Synopsis

Options

flag
default:"false"
Show what would be deleted without removing anything. Useful for previewing the targets before you commit.
path
Cache location to prune. Overrides SMOLVM_IMAGE_DIR and the default ~/.smolvm/images/.
flag
default:"false"
Print results as JSON instead of a formatted table. Useful for scripts and automation.

Examples

Preview before deleting

Always safe to run first — it never deletes:
Example output:

Reclaim disk space

Delete the stale caches:
Example output:

JSON output for automation

Get a machine-readable report:
The --json flag emits a structured object listing the cache directories that were considered, which were removed, and the total bytes reclaimed. Pipe into jq to extract specific fields, or combine with --dry-run to inspect targets without deleting:

What gets deleted

smolvm prune only removes cached image folders for SmolVM versions other than the one currently installed. The current version’s cache is preserved. It does not touch:
  • Running sandboxes or their state
  • Custom images you built with ImageBuilder
  • Snapshots stored under ~/.smolvm/snapshots/
  • SSH keys under ~/.smolvm/keys/
If you upgrade SmolVM frequently, run smolvm prune periodically to keep your cache footprint small. Each release ships a fresh set of pre-built rootfs and kernel artifacts.

Exit codes

Last modified on July 24, 2026