Quick Start
Simple Usage
Enable change tracking on an autonomous agent —
full_auto turns on snapshots automatically:How It Works
| Component | Role |
|---|---|
| Shadow git | Hidden repo under ~/.praison/snapshots/ — never affects your project git |
track() | Commits current file state; returns SnapshotInfo with hash |
diff() | Compares two snapshots or snapshot vs working tree |
restore() | Checks out files from a snapshot; optional file list for partial restore |
| Agent helpers | agent.undo(), agent.redo(), agent.diff() when track_changes=True |
Git must be available on
PATH. If shadow-repo init fails, tracking is skipped silently and undo() returns False.Common Patterns
Selective restore
List recent snapshots
Best Practices
Prefer agent undo for autonomous runs
Prefer agent undo for autonomous runs
When using
autonomy="full_auto", call agent.undo() rather than manual restore() — the agent maintains an undo/redo stack across iterations.Snapshot before risky edits
Snapshot before risky edits
Call
track(message=...) (or run the agent once) before bulk refactors so you have a named rollback point.Respects .gitignore
Respects .gitignore
The shadow repo honours
.gitignore patterns — build artefacts and secrets ignored by git are not snapshotted.Clean up when finished
Clean up when finished
Call
snapshot.cleanup() to remove the shadow repository if you no longer need history for a project.Related
File Editing
Safe find-and-replace tools agents use before snapshots capture the result
Autonomy Loop
Configure
track_changes and autonomous file-editing levels
