⚡ Automatic git snapshots for every pi prompt — never lose work again.
A pi extension that creates a lightweight sidecar git repository (.pi-checkpoints.git/) in your project directory and auto-snapshots your files before every prompt. Think of it as Ctrl+Z for your entire coding session.
pi install git:github.com/<your-org>/gitcheckpoints@v1Or from a local path:
pi install /path/to/gitcheckpointsOn every prompt you send, GitCheckpoints runs git add -A && git commit into a separate git repo hidden inside your project:
your-project/
├── src/
├── .pi-checkpoints.git/ ← sidecar git repo (no conflicts with your project's git)
└── ...
The sidecar repo ignores common noise (node_modules, venv, build/, etc.) so your snapshots stay lean and meaningful.
- Auto-snapshots: Every prompt triggers a checkpoint with the prompt text as the commit message
- Manual snapshots: Save a named checkpoint anytime with
/checkpoint-now my message - Pre-rollback snapshots: Before restoring an old checkpoint, your current state is saved so you can always go back
Save the current working tree as a checkpoint with an optional label.
/checkpoint-now before refactoring auth
List recent checkpoints showing short hash, tree hash, and commit message. Marks the entry matching your current working tree with ← current.
/checkpoints 20
Restore the working tree to a previous checkpoint. Your current state is auto-saved as a checkpoint first so you can always return.
/rollback a1b2c3d
Show a summary of changes between two checkpoints. With one argument, shows changes from the previous checkpoint. With two, shows the diff between them.
/checkpoint-diff a1b2c3d
/checkpoint-diff a1b2c3d e4f5g6h
Remove unwanted checkpoints by hash prefix(es) or by regex pattern against the commit message. Rewrites sidecar history.
/checkpoint-prune a1b2c3d e4f5g6h
/checkpoint-prune ^pre-rollback
If no arguments are given, it defaults to removing all pre-rollback checkpoints.
/checkpoint-prune
You can add exclusions by editing .pi-checkpoints.git/info/exclude in your project:
# Add custom exclude patterns
*.secret
.env.local
- Your project git? Because you don't want 100 "wip" commits cluttering your real git history.
- Undo in editor? Because it snapshots your whole project, not just the open file.
- git stash? Because stash only tracks one state; checkpoints build a searchable timeline.