Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

GitCheckpoints

⚡ 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.

Installation

pi install git:github.com/<your-org>/gitcheckpoints@v1

Or from a local path:

pi install /path/to/gitcheckpoints

How It Works

On 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.

What gets saved

  • 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

Commands

/checkpoint-now [message]

Save the current working tree as a checkpoint with an optional label.

/checkpoint-now before refactoring auth

/checkpoints [limit=30]

List recent checkpoints showing short hash, tree hash, and commit message. Marks the entry matching your current working tree with ← current.

/checkpoints 20

/rollback <short-hash>

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

/checkpoint-diff <hash1> [hash2]

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

/checkpoint-prune [hash...|pattern]

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

Project-level configuration

You can add exclusions by editing .pi-checkpoints.git/info/exclude in your project:

# Add custom exclude patterns
*.secret
.env.local

Why this instead of...

  • 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.

About

gitcheckpoints for pi.dev

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages