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-tmux-branch

v0.1.1

Published

Pi extension for branching the current session into a new tmux pane.

Readme

Tmux Branch Pi extension

A Pi coding agent extension that branches the current Pi session into a new tmux pane.

The extension creates an independent branch of the current persisted Pi session, then opens that branch in a new tmux split by running:

pi --session <branched-session-file>

Install

Install from GitHub:

pi install git:github.com/andrii-k6a/pi-tmux-branch

Try it without installing:

pi -e git:github.com/andrii-k6a/pi-tmux-branch

For regular use, install the extension. Temporary -e packages may be resolved again in each branched Pi process, so installation is faster and more reliable.

When Pi is started with temporary extension flags, the extension passes the common forms through to branched panes: -e <spec>, --extension <spec>, and --extension=<spec>. Repeated flags are preserved in order. For example, a session started with:

pi -e git:github.com/andrii-k6a/pi-tmux-branch

branches into a pane that runs an equivalent command:

pi -e git:github.com/andrii-k6a/pi-tmux-branch --session <branched-session-file>

Only explicit temporary extension flags from the current process are copied. Installed global/project extensions are discovered by Pi as usual, and short-option clusters such as -ex are not expanded.

Requirements

  • tmux

Usage

Run one of the /tmux-branch-* commands or use a shortcut. The extension branches the current Pi session and opens the branch in a new tmux pane.

If the current Pi conversation has not been persisted yet, such as immediately after starting Pi before the first assistant response, the extension opens a fresh Pi conversation in the requested tmux pane instead of branching. If the current Pi process was started with --no-session, the fresh pane also uses --no-session.

Command handlers wait until Pi is idle before branching. Shortcut handlers require Pi to already be idle; if Pi is busy, the extension displays an error notification.

How it works

  1. Verifies Pi is running with an interactive UI inside tmux.
  2. If the current session is persisted and has a leaf, opens it with SessionManager.open(...), creates a branched session using createBranchedSession(leafId), and starts Pi with --session <branched-session-file>.
  3. Runs tmux split-window with the requested direction.

The extension intentionally creates the branched session directly instead of using ctx.fork(), because ctx.fork() would replace the current runtime/pane. This also means Pi's normal fork lifecycle events are not emitted in the original pane: session_before_fork, session_shutdown, and session_start do not run for this branch operation.

Controls

Commands

| Command | Behavior | | --- | --- | | /tmux-branch-right | Branch the current Pi session into a new tmux pane on the right | | /tmux-branch-left | Branch the current Pi session into a new tmux pane on the left | | /tmux-branch-down | Branch the current Pi session into a new tmux pane below | | /tmux-branch-up | Branch the current Pi session into a new tmux pane above |

Default shortcuts

By default, Vim-style shortcuts mirror tmux pane navigation: h/j/k/l = left/down/up/right.

| Shortcut | Behavior | | --- | --- | | Ctrl+Shift+L | Branch the current Pi session into a new tmux pane on the right | | Ctrl+Shift+H | Branch the current Pi session into a new tmux pane on the left | | Ctrl+Shift+J | Branch the current Pi session into a new tmux pane below | | Ctrl+Shift+K | Branch the current Pi session into a new tmux pane above |

Note: your terminal and tmux configuration must pass Ctrl+Shift+<letter> key combinations through to Pi distinctly for the shortcuts to work.

Configuration

Slash commands are always registered. Shortcuts are configured with settings.json under the extension's Pi config directory:

  • global: ~/.pi/agent/pi-tmux-branch/settings.json
  • project-local: <project>/.pi/pi-tmux-branch/settings.json

Project-local configuration uses whole-file precedence over global configuration. If a project-local settings file exists, the global settings file is ignored; settings are not deep-merged.

Commands only

Disable shortcut registration while keeping slash commands available:

{
  "shortcutsEnabled": false
}

Default Vim-style shortcuts

This is the default when no configuration file exists. To be explicit:

{
  "shortcutsEnabled": true
}

Custom shortcut bindings

Use an object to override one or more directions. Missing directions keep their default Vim-style shortcut. Set a direction to false or null to leave that direction command-only.

{
  "shortcuts": {
    "right": "ctrl+alt+l",
    "left": "ctrl+alt+h",
    "down": "ctrl+alt+j",
    "up": "ctrl+alt+k"
  }
}

Development

From this repository:

npm install
npm run typecheck
pi -e .