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-stop

v1.3.0

Published

ALWAYS stops the current pi.dev agent — keyboard shortcut, /stop command, and standalone kill script

Downloads

148

Readme

pi-stop

ALWAYS stops the current pi.dev coding agent — aborts streaming, kills running tool calls, stops subagents, and reloads your last message for resending.

Three independent stop mechanisms, each covering failure modes of the others:

| # | Mechanism | Scope | When it works | |---|-----------|-------|--------------| | 1 | /stop command | Inside pi | Agent is responsive to keyboard input | | 2 | Ctrl+Shift+X | Inside pi | Agent is streaming, even if thinking/tool-calling | | 3 | pi-stop.sh | Any terminal | Agent is stuck, hung, or in a broken state |

Install

pi install npm:pi-stop

Or from a local checkout:

pi install /path/to/pi-stop

Usage

Inside pi — /stop command

Type /stop and press Enter anytime — even while the agent is mid-response:

/stop

What happens:

  1. ctx.abort() fires immediately — stops streaming, tool calls, subagents
  2. Waits up to 15 seconds for the agent to fully settle
  3. If the agent doesn't stop in time, escalates to SIGINT → SIGTERM → SIGKILL
  4. Your last user message is loaded into the editor for editing and resending

Inside pi — Ctrl+Shift+X shortcut

Press Ctrl+Shift+X at any time — same as /stop but faster, works even while the agent is streaming mid-thought.

Can be customised in ~/.pi/agent/keybindings.json:

{
  "Ctrl+Shift+Z": "stop"
}

Outside pi — pi-stop.sh

When pi itself is frozen, hung, or unresponsive:

./pi-stop.sh           # graceful stop
./pi-stop.sh -f        # force kill (skip SIGINT)
./pi-stop.sh -d        # verbose debug output

This script:

  1. Finds all pi-coding-agent processes via pgrep
  2. Sends SIGINT (graceful abort, skip with -f)
  3. Waits 3 seconds, then SIGTERM if alive
  4. Waits 2 seconds, then SIGKILL if still alive
  5. Also kills orphan child shell processes (bash/sh/zsh)

How it ALWAYS stops

The escalation chain guarantees termination:

ctx.abort()  →  ctx.waitForIdle()  →  SIGINT  →  SIGTERM  →  SIGKILL
   (API)           (15s timeout)      (3s)       (2s)      (nuclear)

Each layer covers the failure modes of the layer above it:

  • abort() fails if the abort signal is already consumed or the agent is in a bad state
  • waitForIdle() hangs if the agent never emits agent_end (e.g., subagent stuck in a loop)
  • SIGINT is ignored if the process is in an uninterruptible sleep
  • SIGTERM is caught but ignored by some misbehaving processes
  • SIGKILL cannot be caught or ignored — always terminates

File layout

pi-stop/
├── extensions/
│   └── stop.ts        # Pi extension: /stop command + Ctrl+Shift+X shortcut
├── test/
│   └── stop.test.ts   # Tests for the extension
├── pi-stop.sh          # Standalone kill script (works outside pi)
├── package.json
└── README.md

License

MIT