Skip to content

Manage snapshots

List, forget, and prune the snapshots that cf-orbs keeps.

Updated

cf-orbs keeps a snapshot of each paused orb’s disk, plus Amp project snapshots (a disk with a repo already set up, which new threads start from). See Orb lifecycle.

See what exists

npx cf-orbs status

The snapshots: line shows the number and size of retained snapshots, and a prunable: N (X GB) line shows old data that nothing uses.

npx cf-orbs snapshots list

The table has these columns: AMP SNAPSHOT, CF SNAPSHOT, SIZE, SOURCE ORB, CREATED, LAST USED, EXPIRES. Below it, the snapshot index summary shows the count, size, and next expiry.

Forget a project snapshot mapping

Forget drops only the mapping from Amp’s snapshot id to the Cloudflare snapshot. The next thread on that project boots the image, and Amp runs setup again.

npx cf-orbs snapshots forget <ampSnapshotId>
npx cf-orbs snapshots forget --all-project

--all-project asks first. Add --yes (or -y) to skip the question; in a non-interactive run it fails without --yes.

Forget doesn’t delete data. Cloudflare keeps the snapshot data until its 30-day limit.

Amp keeps its own cache, so after an image change, clear that too:

Amp caches one project snapshot for each provider for 72 hours. After an image or setup change, new threads can still start from a disk made with the old image. To avoid that, clear both caches:

  1. In Amp, delete the cached snapshot in Orb Settings → Snapshots, or run amp projects snapshots delete <owner/repo> --resource <size>.

  2. In cf-orbs, run:

    npx cf-orbs snapshots forget --all-project

Do the same after a change to a repo’s .agents/setup.

Prune old snapshot data

prune finds snapshots that no orb and no project mapping uses, and that have gone unused for 7 days by default.

npx cf-orbs snapshots prune

This is a dry run. It prints a table (CF SNAPSHOT, ORB, SIZE, LAST USED) and a summary, then says Would delete N snapshot(s), X; rerun with --yes.

To delete:

npx cf-orbs snapshots prune --yes

Options:

Option Meaning
--older-than <age> Minimum age since last use. A number and a unit: 7d, 36h, or 90m. Default 7d
--all No age limit. Snapshots in a project mapping and orb disks stay. Do not combine with --older-than
--yes Delete the snapshots

With --yes, cf-orbs runs wrangler containers images delete <repo>:rootfs-snapshot-<sha256 of id> --skip-confirmation for each one. This way of deleting works, but Cloudflare doesn’t document it. A failure on one snapshot is reported and skipped, and Cloudflare drops that snapshot at its 30-day limit. cf-orbs then removes the deleted ids from the Registry index.

Type to search…

↑↓ navigate↵ selectEsc close