Kagex/Guides
0.5 s RestoreSpeed & Workflows · 4 min read

Golden Snapshots, Pause-to-Disk & Sub-Second Agent Restores

Stop paying cold apt/npm/pip install time every session: snapshot your configured environment once and restore it repeatedly in half a second.

Golden restore
0.5–0.6 s incl. sync
Pause / resume
0.5–0.7 s to/from disk
Ctrl-C behavior
Safely pauses active sandboxes
Pause, checkpoint, and restore sandbox state
sandboxctl pause "$ID"
sandboxctl resume "$ID"
sandboxctl snapshot "$ID" --name clean-deps
sandboxctl restore "$ID" clean-deps

Key Engineering Points · One-Way Workspace Sync, 3-Way Apply & Undo

All 10 key points →
  • 1Host folders are never shared or mounted into guest microVMs — virtio-fs and 9p mounts are intentionally disabled.
  • 2Workspace synchronization moves strictly one way (host -> VM) over explicit AF_VSOCK tar streams checked by guest/files.
  • 3Running rm -rf /workspace inside a sandbox has zero effect on the developer's repository on disk.
  • 4Before every sandbox_exec, incremental host file changes delta-sync automatically into guest /workspace.
  • 5Diff previews compare VM edits cleanly against repository git HEAD without mutating host git refs, index, or checked-out branches.
  • 6Applying approved patches uses temporary git merge-file 3-way merges rather than blind file overwrites.

Pause on Shutdown & Crash Recovery

Stopping sandboxd cleanly with Ctrl-C pauses running microVMs to disk. If the host reboots unexpectedly, internal/service/recover.go restores consistent database and artifact states safely.

Automatic Template Layering

Repo setup commands invoked via --setup build cached project layers automatically so teams reuse warm dependencies across branches.

Inspect this architecture live in 3D

Step through MCP ingress, Ghost Secrets, CoW blades, and run sandboxctl commands interactively in your browser.

Frequently Asked Questions

Active sandboxes gracefully pause to disk so you can resume without losing in-progress VM work.