Checkpoints & Rollback
MonoClaw creates automatic checkpoints before destructive operations. If something goes wrong, you can roll back to a known-good state.
What gets checkpointed
Before any destructive file operation (edit, delete, move), Mona:
- Creates a git commit in a shadow repository
- Stores the pre-operation state
- Proceeds with the operation
Shadow git repos
MonoClaw maintains a shadow git repo inside ~/.monoclaw/checkpoints/ for each project you work on. These repos:
- Mirror your project's file structure
- Store full history of changes
- Are independent of your project's own git history
Automatic snapshots
In addition to operation-level checkpoints, MonoClaw takes periodic snapshots:
- Every 5 minutes during active sessions
- Before gateway restarts
- Before updates
- On demand:
/snapshotin chat
Snapshots are stored as compressed archives in ~/.monoclaw/snapshots/.
Rolling back
Roll back the last operation
monoclaw checkpoint rollback
This restores files to their state before the most recent destructive operation.
Roll back to a specific snapshot
monoclaw snapshot list
monoclaw snapshot restore <snapshot-id>
Roll back in chat
/rollback
Mona will restore the project to its pre-operation state and explain what was reverted.
Manual checkpoints
Create a checkpoint on demand:
monoclaw checkpoint create "Before refactoring auth"
Or in chat:
/checkpoint
Snapshot management
List snapshots
monoclaw snapshot list
Output:
2026-05-10 14:32:01 before-gateway-restart
2026-05-10 14:28:15 auto-snapshot
2026-05-10 14:23:00 before-update
2026-05-10 14:15:42 auto-snapshot
Export a snapshot
monoclaw snapshot export <id> > snapshot.tar.gz
Clean up old snapshots
monoclaw snapshot prune --keep-last 20
monoclaw snapshot prune --older-than 7d
Integration with project git
If your project is already a git repo, Mona will:
- Prefer your project's git history for rollback
- Fall back to shadow repos for untracked files
- Never modify your project's git history without explicit consent
Best practices
- Commit frequently in your own git repo — Mona respects existing commits
- Use
/checkpointbefore asking Mona to make large changes - Review before rollback — use
monoclaw snapshot show <id>to inspect - Clean up snapshots — Old snapshots consume disk space
Troubleshooting
| Problem | Fix |
|---|---|
| "No checkpoint found" | Checkpoints are only created for destructive operations |
| "Rollback failed" | The file may have been modified since the checkpoint |
| Large disk usage | Run monoclaw snapshot prune --older-than 3d |
| Shadow repo corrupt | Delete ~/.monoclaw/checkpoints/<project> — history is lost but Mona will recreate it |