-
Notifications
You must be signed in to change notification settings - Fork 48
Snapshot Management
Snapshots capture the complete state of a container at a point in time. Use them to checkpoint before a risky operation, roll back to a known-good state, or branch into experimental work from the same starting point.
Stateless snapshots (default) capture the filesystem — installed packages, configuration changes, and any state written to the container's disk. They are fast and sufficient for most use cases.
Stateful snapshots (--stateful) additionally capture process memory, allowing you to restore a running session exactly mid-execution. Stateful snapshots are slower to create and require the container to be running at snapshot time; stateless snapshots can be taken from a stopped or running container.
Note: Restore Requires a Stopped Container Before restoring any snapshot, stop the container with
coi container stop <name>. Restoring into a running container is not supported.
# 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# 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 jsonNote: 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 specific snapshot
coi snapshot delete checkpoint-1
# Delete all (with confirmation)
coi snapshot delete --all
# Delete all without confirmation
coi snapshot delete --all -f# Text output
coi snapshot info checkpoint-1
# JSON output
coi snapshot info checkpoint-1 --format jsonWhen you don't specify a container, COI resolves it in this order:
- Uses
--containerflag if provided - Falls back to
COI_CONTAINERenvironment variable - Auto-resolves from current workspace if exactly one container exists
- Error if multiple containers found (use
--containerto specify)
-
Restore requires stopped container - Run
coi container stop <name>first -
Destructive operations require confirmation - Skip with
--forceflag - Complete state capture - Snapshots include container state and session data
- Stateful snapshots - Include process memory for live state preservation
- 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
-
Snapshot before risky operations - Create a checkpoint before applying large refactors, running migrations, or letting the AI make sweeping changes across many files
-
Prefer stateless unless you need exact process state - Stateless snapshots are significantly faster and smaller; use
--statefulonly when you need to resume a specific mid-execution process state -
Use descriptive names - Auto-named snapshots (
snap-20260526-143022) are hard to distinguish; prefer names likebefore-db-migrationorclean-deps -
Clean up regularly - Snapshots consume Incus storage pool space. Use
coi snapshot delete --allorcoi image cleanupto prevent accumulation -
Snapshots are not a substitute for git - Snapshots capture container state, not just workspace files. For code changes, commit to git; use snapshots for environment state (installed tools, build caches)
- Container Lifecycle and Sessions - How snapshots fit into session persistence
- Container Operations - Related container management commands
- Configuration - Persistence mode and snapshot settings
Getting Started
Setup
Configuration & Usage
- Best Practices
- Configuration
- Profiles
- Supported Tools
- Container Lifecycle & Sessions
- Container Operations
- Snapshot Management
- File Transfer
- Tmux Automation
- Image Management
- Resource & Time Limits
Security
Maintenance
Help & Reference