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-agents-pool

v0.2.0

Published

Codex-style multi-agent orchestration for pi — spawn, communicate with, and coordinate sub-agents via LLM tool calls

Readme

pi-subagents

Codex-style multi-agent orchestration for pi. Spawn, communicate with, and coordinate sub-agents via LLM tool calls.

Sub-agents are invisible child pi --mode rpc processes. No terminal multiplexer required, no TUI overlay. The LLM orchestrates everything through 5 tools.

Install

pi install npm:pi-agents-pool

Or from git:

pi install git:github.com/minghinmatthewlam/pi-subagents

Tools

| Tool | Description | |------|-------------| | spawn_agent | Spawn a sub-agent with a task. Returns immediately with an agent ID; the agent runs in the background and notifies the main session when done. | | send_input | Send a follow-up message to an existing agent. Supports interrupt to redirect work. | | wait_agent | Block until one or more agents finish. Use only when the main session is blocked on the result right now. | | close_agent | Shut down an agent. Can be resumed later. | | resume_agent | Resume a previously closed agent from its saved session. |

How It Works

Recommended flow:

1. LLM calls spawn_agent("Analyze the auth module")  -> returns agent ID immediately
2. LLM calls spawn_agent("Analyze the DB module")    -> returns another agent ID
3. LLM keeps doing local non-overlapping work
4. Finished agents steer results back automatically via <subagent_notification>
5. LLM reads results, integrates, continues

wait_agent is the exception path, not the default path. Use it only when the main session is blocked on a result and must pause.

When an agent finishes, the extension injects a <subagent_notification>...</subagent_notification> message and triggers a new turn automatically. That notification is an agent result, not a user message.

Each agent is a persistent pi --mode rpc child process with full bidirectional communication. The LLM can send follow-up messages, interrupt ongoing work, and reuse agents for related questions.

A widget above the input shows live progress:

2 agents (2 running)
├─ Analyze the auth module (explorer) · 3 tool uses · 12.4k tokens · 0:23
│  └ Read: src/auth/index.ts
├─ Analyze the DB module (explorer) · 1 tool use · 4.1k tokens · 0:15
│  └ thinking…

Agent Types

Agent types are purely advisory — they guide the LLM on when and how to use each role. There is no mechanical difference between types.

| Type | Guidance | |------|----------| | explorer | Fast codebase questions. Spawn multiple in parallel for independent questions. Trust results. Reuse via send_input. | | worker | Implementation tasks. Assign explicit file ownership. Tell workers they are not alone in the codebase. |

spawn_agent({ message: "What does the auth module do?", agent_type: "explorer" })
spawn_agent({ message: "Implement the login endpoint", agent_type: "worker" })

Depth Limiting

Sub-agents can themselves spawn further sub-agents, limited by depth:

  • PI_SUBAGENT_MAX_DEPTH (default: 2) — maximum nesting depth
  • Main session (depth 0) can spawn agents (depth 1), which can spawn sub-agents (depth 2), which cannot spawn further

Override:

export PI_SUBAGENT_MAX_DEPTH=3   # allow deeper nesting
export PI_SUBAGENT_MAX_DEPTH=1   # only one level of agents

Parameters

spawn_agent

| Param | Type | Required | Description | |-------|------|----------|-------------| | message | string | yes | Task prompt for the agent | | agent_type | string | no | Role hint: "explorer" or "worker" | | model | string | no | Override model (e.g. "anthropic/claude-haiku-4-5") |

send_input

| Param | Type | Required | Description | |-------|------|----------|-------------| | id | string | yes | Agent ID from spawn_agent | | message | string | yes | Message to send | | interrupt | boolean | no | Abort current work before sending |

wait_agent

Use only when you are blocked on a dependency and need to pause the main session until an agent finishes. On timeout, the agents keep running in the background.

| Param | Type | Required | Description | |-------|------|----------|-------------| | ids | string[] | yes | Agent IDs to wait for | | timeout_ms | number | no | Timeout (default: 30s, min: 10s, max: 1h) |

close_agent / resume_agent

| Param | Type | Required | Description | |-------|------|----------|-------------| | id | string | yes | Agent ID |

License

MIT