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-session-worktrees

v1.0.3

Published

Pi extension that maps the git worktrees used by the current session, shows them in the footer, and publishes them as JSON for external tools like tmux pickers.

Readme

pi-session-worktrees

A pi extension that maps the git worktrees the current session is working in, shows them in the footer as ⑂ feat/a fix/b, and publishes them as JSON so outside tools (tmux pickers, shell scripts) can offer the same list.

Worktrees are detected automatically: the session cwd, every path in a tool call, and every path in a ! bash command are resolved to their worktree root. Paths that appear only in tool output count only when the directory was created during this session — that catches a worktree the session just made without harvesting every entry a git worktree list prints. Only linked worktrees are mapped — the main checkout is left out because external tools already know it.

Install

pi install npm:pi-session-worktrees

Or add a local checkout to ~/.pi/agent/settings.json:

{
  "extensions": ["/path/to/pi-session-worktrees/src/index.ts"]
}

Usage

  • The footer shows ⑂ ci/d fix/b chore/c +1, newest first, up to 3 entries plus a +n overflow count.
  • /worktrees — pick a worktree from this session and open it in a new tmux window (falls back to showing the path).

External integration

Each session writes ~/.pi/session-worktrees/<session-id>.json:

{
  "session_id": "3f1c...",
  "cwd": "/Users/me/dev/repo",
  "updated_at": "2026-02-01T12:00:00.000Z",
  "worktrees": [
    {
      "branch": "feat/a",
      "path": "/Users/me/dev/repo/_worktrees/feat/a",
      "repo_root": "/Users/me/dev/repo",
      "opened_at": "2026-02-01T11:59:00.000Z"
    }
  ]
}

Entries pointing at deleted directories are dropped on every write, and registry files untouched for 7 days are pruned at session start.

A tmux picker for the session that most recently touched the current repo:

git worktree list --porcelain | awk '/^worktree /{sub("^worktree ","");print}' \
  | jq -Rs 'split("\n") | map(select(length > 0))' > /tmp/paths.json

jq -rs --slurpfile paths /tmp/paths.json '
  map(select(.worktrees | any(.path as $p | $paths[0] | index($p))))
  | sort_by(.updated_at) | last
  | .worktrees[] | "\(.branch)\t\(.path)"
' ~/.pi/session-worktrees/*.json | fzf --with-nth=1 --delimiter='\t'

Development

See CONTRIBUTING.md.