Three-Layer Snapshots
offrig eliminates cold container rebuilds by splitting filesystem state into three copy-on-write layers.
Layer 0: Base Snapshot
Section titled “Layer 0: Base Snapshot”A content-addressed Snapshot of your Environment:
- Base OS image (curated Ubuntu 24.04 by default, or
[env].image/[env].dockerfileon Docker-backed Providers) - System packages (
[env].packages) misetoolchains detected frommise.toml/.tool-versions- One-time setup commands (
[env].setup)
Base Snapshots are keyed by (environment_hash, target_arch) and shared across every repository that resolves to the same Environment.
Layer 1: Deps Snapshot
Section titled “Layer 1: Deps Snapshot”A content-addressed Snapshot forked from the Base Snapshot and keyed by repository lockfiles (Cargo.lock, pnpm-lock.yaml, package-lock.json, uv.lock, go.sum, etc.):
- Populates Remote-only paths (
node_modules/,/target,.venv/,.turbo/) and warm off-repo package caches inside the Rig. - Shared across every Worktree of the repository—opening a new git Worktree skips dependency installation completely when lockfiles match.
- Configure lockfile tracking or custom install commands under
[deps]inoffrig.toml(enabled,auto_update,lockfiles,command).
Layer 2: Persistent Sandbox & Saved Snapshots
Section titled “Layer 2: Persistent Sandbox & Saved Snapshots”Your Worktree’s writable Sandbox forks from the Deps Snapshot (or Base Snapshot if [deps].enabled = false).
At any time you can capture an immutable user-named Saved Snapshot of the current Sandbox:
offrig snap save golden-dbBefore committing a Deps Snapshot, Saved Snapshot, or Cloudflare Layer-2 Snapshot, the Worker runs a pre-snapshot ctime secret scan against the injected secrets and ephemeral git tokens tracked in RAM (raw and alignment-invariant Base64 forms) and aborts capture if any value was written to disk. Deps Snapshots cannot skip the scan; only offrig snap save --allow-secrets bypasses it with an explicit warning.
Managing Snapshots
Section titled “Managing Snapshots”# List Snapshots for the current repo (or --all across repos)offrig snap lsoffrig snap ls --kind saved --all
# Explicitly build Base and/or Deps layers ahead of timeoffrig snap build baseoffrig snap build depsoffrig snap build all --force
# Inspect metadata or roll back a Worktree's Sandboxoffrig snap inspect golden-dboffrig snap rollback golden-db
# Reclaim storage while protecting active Sandboxes and Saved Snapshotsoffrig snap prune --keep 2 --older-than 7d --dry-runoffrig snap prune --keep 2