How It Works
When you run a command in supervised mode, nono:- Takes a baseline snapshot of all files in tracked directories before the command starts
- Runs the command inside the sandbox
- Takes a final snapshot after the command exits
- Shows an interactive diff of all changes, offering to restore any modified or deleted files
Undo requires
--supervised mode because the parent process needs to remain unsandboxed to write snapshots to ~/.nono/undo/.Snapshot Architecture
Content-Addressable Object Store
Files are stored by their SHA-256 hash, so identical content is never stored twice. On macOS with APFS, nono usesclonefile() for copy-on-write storage - snapshots consume minimal additional disk space when files haven’t changed.
Merkle Tree Integrity
Each snapshot builds a Merkle tree over all tracked files. The root hash provides a cryptographic commitment to the exact filesystem state at that point in time. This allows:- Verifying that no snapshot data has been tampered with
- Detecting corruption in stored objects
- Efficient comparison between snapshots (only recompute changed subtrees)
Session Structure
Sessions are stored in~/.nono/undo/ with the following layout:
YYYYMMDD-HHMMSS-PID (e.g., 20260214-143022-12345).
Exclusion Filters
Not every file needs tracking. The undo system respects:- Profile-defined patterns: Common build artifacts like
node_modules,.next,__pycache__,target - Profile-defined globs: Patterns like
*.tmp.[0-9]*.[0-9]* - gitignore integration: Reads
.gitignorepatterns from the working directory
Commands
nono undo list
List past sessions that have recorded changes.
nono undo show
Inspect the changes made during a session.
nono undo restore
Restore files from a past session to their pre-change state.
nono undo verify
Verify the integrity of a stored session by recomputing Merkle tree hashes and checking all objects in the store.
nono undo cleanup
Remove old sessions to reclaim disk space.
Interactive Post-Exit Flow
When a supervised command exits and file changes are detected, nono presents an interactive review:- Shows a summary of all changes (created, modified, deleted files)
- Offers to show diffs for individual files
- Asks whether to restore some or all files
--no-undo-prompt to suppress the interactive UI while still taking snapshots (useful for scripting).
Storage Management
| Setting | Default | Description |
|---|---|---|
| Max sessions | 10 | Oldest sessions pruned automatically |
| Max storage | 5 GB | Total storage limit for all sessions |
nono undo cleanup for manual management.