npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ian-pascoe/pi-git-checkpoints

v0.1.0

Published

Git-backed worktree checkpoints for Pi tree navigation

Readme

Git Checkpoints for Pi

Git Checkpoints records Git-backed Worktree Checkpoints at Pi Model Step boundaries and can Restore affected files when /tree moves backward, forward, or sideways.

It requires Node.js 22.19 or newer and the git executable on PATH. The starting directory does not need to be a Git repository.

Install

pi install npm:@ian-pascoe/pi-git-checkpoints

How it works

  • A Model Step is one model response and its complete tool batch. Git Checkpoints captures before and after every Model Step; parallel tool results share the final checkpoint.
  • In a repository, checkpoints are scoped to Pi's starting directory and seeded from the source index and object database.
  • Outside a repository, Git Checkpoints starts an empty private index scoped to the canonical starting directory. It never creates .git or other checkpoint metadata there.
  • /tree considers only paths changed along the Navigation Transition. Unrelated working files are preserved.
  • In TUI and RPC modes, a change preview offers Restore code and navigate, Keep code and navigate, or Cancel navigation. Print and JSON modes always keep files unchanged.
  • Restore runs only after conversation navigation succeeds. A last-moment capture prevents stale approval from overwriting newer edits.

Git Checkpoints never restores or modifies a source repository's index, HEAD, commits, refs, stash, current branch, or staged state. When the current repository HEAD differs from a checkpoint, the Restore prompt warns but does not switch branches. Standalone mode has no HEAD warning.

User ! and !! changes enter the next Model Step baseline because Pi exposes no composable post-user-bash hook.

Commands

/checkpoint
/checkpoint status
/checkpoint undo

status reports repository, standalone, or disabled state; valid Model Step count; private store path; retention; the last capture failure; and undo availability. Bare /checkpoint adds concise usage.

undo restores the Safety Checkpoint from the most recent successful Restore. If affected paths have changed since that Restore, TUI/RPC asks for confirmation; print and JSON modes refuse the divergent undo. A later successful Restore replaces the previous undo record, and successful undo removes it.

Eligible paths

Repository mode includes tracked files regardless of size and nonignored untracked files up to 2 MiB. Standalone mode initially treats every path as untracked, so the same 2-MiB limit applies on the first successful capture; captured paths then behave as private-index tracked files even after growth.

Regular files, deletions, symbolic links, and executable modes are supported. Ignored paths, oversized untracked paths, submodules, nested repositories, sockets, devices, and unsupported entries remain untouched and are reported as skipped. Git Checkpoints rejects lexical path escapes and destinations whose existing ancestors escape through symbolic links.

Settings

The default retention is seven days:

{
  "gitCheckpoints": {
    "retentionDays": 7
  }
}

retentionDays must be a positive safe integer. A trusted project .pi/settings.json value replaces the global ~/.pi/agent/settings.json value. Invalid or unknown values warn once and fall back to a valid global value or the default. Settings reload only on session start, including /reload.

Each session has an isolated store at:

<agent-dir>/git-checkpoints/<workspace-id>/<session-id>/

Expired inactive stores are removed asynchronously. Cleanup failures never block capture or Restore.

Failure behavior

A capture failure disables checkpointing for the session until /reload or the next session. Restore first records a Safety Checkpoint; if writing fails, Git Checkpoints attempts to recover every affected path and reports exact unrecovered paths. It cannot roll back changes outside the approved Navigation Transition paths.