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

pi-tree-graph

v0.1.0

Published

Session tree visualization with git snapshot integration for pi coding agent (/tg + auto checkpoints)

Readme

pi-tree-graph

Session tree visualization with git snapshot integration for the pi coding agent.

  • /tg (alias /tree-graph) — time-ordered session tree (newest on top, git log --graph style), with branch tracks, merged repeated messages (继续 ×4), and git snapshot badges.
  • Auto checkpoints — every write/edit takes a "before edit" snapshot; every session start takes a snapshot. Broken code is one keypress away from recovery.
  • Press g on any snapshot row/badge to restore code to that moment (with confirmation).

Snapshots live in shadow repos under ~/.pi/agent/checkpoints/ — your project's own .git is never touched and your commit history stays clean.

Install

pi install npm:pi-tree-graph

Or try without installing:

pi -e npm:pi-tree-graph

Requirements: git on PATH. Snapshots cover projects under ~/code/ (first-level directory = project root) plus ~/.pi/agent itself.

Usage

| Command | What | |---|---| | /tg | Open the time-ordered tree. ↑↓/jk move, PgUp/PgDn or ctrl-b/ctrl-f page, mouse wheel scrolls, click selects, f cycles filter (user / no-tools / full), enter jumps to node, g restores snapshot, esc closes | | /checkpoints | List recent snapshots per protected target | | /checkpoint-restore <hash> | Restore worktree files to a snapshot (tracked files overwritten; files created after the snapshot are kept) | | /checkpoint-prune | Prune snapshots older than retention (archives to bundles first, restorable) |

Filters: user (default — user messages + anchors: checkpoints, compactions, branch summaries; assistant thinking hidden), no-tools, full.

Snapshot retention

Old snapshots are pruned automatically on session start (archived to archive-*.bundle first; restore falls back to bundles transparently). Tune with env vars:

| Var | Default | Meaning | |---|---|---| | PI_CHECKPOINT_RETENTION_DAYS | 30 | Only prune commits older than this | | PI_CHECKPOINT_MIN_KEEP | 50 | Always keep the newest N commits | | PI_CHECKPOINT_HARD_CAP | 1000 | Hard cap on total snapshots (runaway protection) | | PI_CHECKPOINT_PRUNE | 1 | Set to 0 to disable auto-prune (/checkpoint-prune still works) |

Excluded from snapshots: node_modules, dist, build, __pycache__, .venv, *.log, etc. Files changed via bash (not write/edit) are captured by the next snapshot, not beforehand.

Layout

 Session Tree  session  ·  5 nodes
────────────────────────────────────────
│ ❯ latest message                            18:18
│ ❯ earlier message         ⎇76e216b(+3)      18:12
│ ❯ repeated message ×4                       18:08
│ /  ← branch merge line
❯ ❯ oldest message                            18:01

License

MIT

Troubleshooting

Slash commands sent as plain messages (/tg ignored): another copy of these extensions is loading at the same time (e.g. dev files under ~/.pi/agent/extensions/ plus this installed package). Duplicate command registration disables both copies. Keep only one: remove the dev files or run pi remove npm:pi-tree-graph.