Worktrees & Sandboxes
offrig separates where you edit (your local Worktree) from where heavy compute runs (a Sandbox on a Rig).
One Sandbox per Worktree
Section titled “One Sandbox per Worktree”Each local git Worktree (or standalone non-git directory) maps deterministically to one persistent Layer-2 Sandbox per Rig:
- Running two coding agents simultaneously in two linked git Worktrees (
git worktree add ../feat-aandgit worktree add ../feat-b) automatically gives each Worktree its own isolated Sandbox forked via Copy-on-Write from the same shared Base Snapshot and Deps Snapshot. - Build caches and Remote-only paths (
target/,node_modules/,.venv/) never collide between branches.
Ephemeral --isolated and --recreate
Section titled “Ephemeral --isolated and --recreate”offrig --isolated <cmd>: Forks a fresh ephemeral Sandbox from the current Deps Snapshot (or Base Snapshot), executes the Run, applies Write-back, and deletes the ephemeral Sandbox on exit. Ideal for one-off release checks or parallel test shards inside a single Worktree.offrig --recreate <cmd>: Discards the Worktree’s persistent Sandbox and re-forks cleanly from the current Base / Deps Snapshot before running. (You can also runoffrig sandbox resetexplicitly.)
Lifecycle, Idle Timeout, and Hold Cap
Section titled “Lifecycle, Idle Timeout, and Hold Cap”To keep remote compute costs predictable without slowing down back-to-back commands:
- Idle timeout (
idle_minutes): After a Sandbox finishes its last active Run or shell, the Rig stops it once idle foridle_minutes. Defaults vary by Provider (30min forlocal,15min for remotessh/daytona/boat/e2b,5min formodal,2min forcloudflare, automatic scale-to-zero sleep with a15sdaemon pool TTL onsprites). - Hold cap (
hold_cap_minutes): Active port forwards (offrig sandbox forward) or background holds keep a Sandbox alive at mosthold_cap_minutes(default60minutes) without an active Run or shell before idle shutdown triggers.
Manage persistent Sandboxes directly with offrig sandbox:
offrig sandbox ls --alloffrig sandbox statusoffrig sandbox stopoffrig sandbox resize --cpu 8 --memory 16384offrig sandbox rmThe Local daemon
Section titled “The Local daemon”offrig daemon is a lazily auto-started per-user background process on your laptop. It holds warm connections to active Rigs, watches active Worktrees, and coordinates -p/-R TCP port forwards over yamux.
- You never need to start it manually; the first Run starts it automatically.
- Pass
--no-daemonon any Run,shell, orsandbox forwardto execute in-process. - Inspect or stop it anytime with
offrig daemon statusoroffrig daemon stop.