Skip to content

Snapshot Management

Maciej Mensfeld edited this page Feb 9, 2026 · 1 revision

Create container snapshots for checkpointing, rollback, and branching workflows.

Commands

Create Snapshots

# Auto-named snapshot (snap-YYYYMMDD-HHMMSS)
coi snapshot create

# Named snapshot
coi snapshot create checkpoint-1

# Include process memory state
coi snapshot create --stateful live

# Specific container
coi snapshot create -c coi-abc-1 backup

List Snapshots

# Current workspace container
coi snapshot list

# Specific container
coi snapshot list -c coi-abc-1

# All COI containers
coi snapshot list --all

# JSON output
coi snapshot list --format json

Restore from Snapshot

Note: Requires container to be stopped first (coi container stop <name>)

# Restore with confirmation
coi snapshot restore checkpoint-1

# Skip confirmation
coi snapshot restore checkpoint-1 -f

# Restore with process state
coi snapshot restore checkpoint-1 --stateful

Delete Snapshots

# Delete specific snapshot
coi snapshot delete checkpoint-1

# Delete all (with confirmation)
coi snapshot delete --all

# Delete all without confirmation
coi snapshot delete --all -f

Show Snapshot Details

# Text output
coi snapshot info checkpoint-1

# JSON output
coi snapshot info checkpoint-1 --format json

Container Resolution

When you don't specify a container, COI resolves it in this order:

  1. Uses --container flag if provided
  2. Falls back to COI_CONTAINER environment variable
  3. Auto-resolves from current workspace if exactly one container exists
  4. Error if multiple containers found (use --container to specify)

Safety Features

  • Restore requires stopped container - Run coi container stop <name> first
  • Destructive operations require confirmation - Skip with --force flag
  • Complete state capture - Snapshots include container state and session data
  • Stateful snapshots - Include process memory for live state preservation

Use Cases

  • Checkpointing - Save state before risky operations
  • Rollback - Restore to previous working state
  • Branching experiments - Try different approaches from same starting point
  • Backup - Preserve container state before major changes

Clone this wiki locally