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-worktree-tui-status

v0.2.0

Published

TUI-only worktree and experiment status indicator for Pi; detects agent tool paths without managing them

Downloads

430

Readme

pi-worktree-tui-status

A TUI-only worktree and experiment status indicator for Pi.

It shows which git worktree or disposable experiment the agent is touching when the agent edits or runs commands against long paths like:

runs/agents/worktrees/<slug>/...
runs/experiments/<product-or-app>/<slug>/...

It does not create, switch, remove, prune, checkout, merge, promote, or otherwise manage worktrees or experiments.

🌳 issue-1234-fix-camera | 🌿 1234-fix-camera | dirty +3
🧪 bistro-beacon/camera-spike | experiment

Why this exists

Some workflows keep Pi's current working directory on the main repository, while the agent works in an isolated git worktree by using explicit long paths:

git worktree add runs/agents/worktrees/my-task my-branch
git -C runs/agents/worktrees/my-task status --short

Statusline extensions that inspect only ctx.cwd will still show the original checkout. This extension watches Pi tool calls and user shell commands, detects worktree or experiment paths, and updates a small TUI status item.

Install

pi install npm:pi-worktree-tui-status

Try without installing:

pi -e npm:pi-worktree-tui-status

Local development:

git clone https://github.com/arpagon/pi-worktree-tui-status.git
cd pi-worktree-tui-status
pi -e ./index.ts

If Pi is already running, use /reload after installing.

What it detects

Tool paths

It watches path-like arguments from Pi tool calls, including:

  • read
  • write
  • edit
  • grep
  • find
  • ls
  • any tool with path, cwd, file, directory, or target string fields

Examples:

{
  "path": "runs/agents/worktrees/my-task/src/index.ts"
}
{
  "path": "runs/experiments/bistro-beacon/camera-spike/report.md"
}

Bash commands

It also watches bash commands and user ! shell commands for:

git -C runs/agents/worktrees/my-task status --short
npm --prefix runs/agents/worktrees/my-task/app test
python runs/experiments/bistro-beacon/camera-spike/run.py

Display

The extension writes one Pi status segment:

🌳 <slug> | 🌿 <branch> | <clean | dirty +N | dirty ?>
🧪 <product-or-app>/<slug> | experiment

Examples:

🌳 issue-workflow-fix | 🌿 1943-improve-issue-workflow | clean
🌳 roi-camera-plan | 🌿 2110-roi-camera-plan | dirty +4
🧪 bistro-beacon/camera-spike | experiment

Non-goals

This package is intentionally narrow:

  • No /worktree command
  • No git worktree creation
  • No checkout/switch behavior
  • No path redirection
  • No shell sandboxing
  • No cleanup or deletion
  • No PR or merge automation
  • No experiment creation, promotion, cleanup, or archival

Use a worktree management extension if you want those behaviors. Use this package only when you want a visual TUI indicator.

Project workflow compatibility

This is designed for workflows like:

gh issue develop <issue> --base main --name <branch>
git fetch origin <branch>
git worktree add -b <branch> runs/agents/worktrees/<slug> origin/<branch>
git -C runs/agents/worktrees/<slug> status --short

The agent can keep Pi's cwd in the original repo and still get a visible indication of which worktree is being touched. Disposable exploration under runs/experiments/<product-or-app>/<slug> is shown as experiment mode.

Development

npm test
npm run typecheck
npm run pack:dry
npm run validate

Package contents

The npm package includes only:

index.ts
README.md
CHANGELOG.md
LICENSE
AGENTS.md

Security

Pi extensions run with your user permissions. This extension does not execute arbitrary user-provided shell commands. Experiment detection only parses paths. For worktrees, it runs read-only git commands against detected worktree roots:

git -C <worktree> branch --show-current
git -C <worktree> status --porcelain --untracked-files=normal

It never writes files and never mutates git state.

License

MIT