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

@djoeyg/pi-worktree

v0.1.0

Published

/worktree: fork the session into a git worktree and run it in a tab inside pi, in parallel with the main session

Readme

pi-worktree

Tabs inside pi, one per git worktree. /worktree <branch> forks the current conversation into a new worktree and opens it in a tab. The worktree agent runs in parallel with the main session and with every other tab.

 1 main │  2 feat-auth ● │ 3 fix-flaky-test ✓

Commands

  • /worktree <branch> [prompt] creates <repo>.worktrees/<branch> next to the main checkout and opens a tab there. A new branch starts from the current HEAD; an existing branch is checked out. The tab's agent continues the conversation from where the main session is now, on the same model and thinking level. If you give a prompt, it goes to the new agent straight away.
  • /worktree <branch> on a worktree that already exists, for example after restarting pi, continues that worktree's latest session instead of forking again.
  • /worktree with no argument reopens the last tab, or asks for a branch if there are none.
  • /worktree close <branch> stops the tab's agent. The worktree and branch stay.
  • /worktree remove <branch> also runs git worktree remove once you confirm. The branch stays, and uncommitted changes block the removal.

Keys

| Key | Where | Action | | --- | --- | --- | | Alt+W | main | Open the last tab | | Alt+2…9 | anywhere | Go to tab N | | Alt+1 | tab | Back to main | | Alt+W | tab | Next tab; past the last one, back to main | | Enter | tab | Send. While the agent is working, this steers it | | Esc | tab | Abort the run; when idle, back to main | | PgUp / PgDn / wheel | tab | Scroll | | Ctrl+O | tab | Expand or collapse tool output |

On macOS, Alt shortcuts need the terminal to send Option as Alt, e.g. macos-option-as-alt = true in Ghostty.

The footer lists the tabs: ● working, ✓ finished since you last looked, ○ idle, ✗ exited. When a background tab finishes, pi posts a notification.

How it works

Each tab is a headless pi --mode rpc process started in the worktree directory, the same way pi-review runs its reviewer. The worktree's own AGENTS.md, project settings, and project extensions apply, and one agent crashing doesn't take down the others. A new worktree gets --fork <current session>, plus a system-prompt note telling the agent its new working directory, since earlier messages refer to the original checkout. The fork is saved as a normal pi session under the worktree's directory, so pi --continue from inside the worktree resumes it.

The worktree uses the main checkout's project-trust decision, because a fresh path has no saved trust and RPC mode cannot ask. Dialogs from extensions in a tab (confirm, select, input, editor) show up in the main UI, prefixed with the branch name. Notifications go to the main chat.

Tabs survive /reload, /new and /resume. Quitting pi stops every tab's agent.

Limits

  • A tab is a chat with an editor, not pi's whole interface. Extension commands work in a tab. Built-in interactive commands such as /tree, /model and /compact do not.
  • Tools that pi doesn't ship are drawn with the generic renderer, not their extension's own.
  • A worktree starts as a clean checkout: no node_modules and no untracked files such as .env.

Install

pi install npm:@djoeyg/pi-worktree