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

v0.1.0

Published

Minimal subagent extension for pi — one tool, one prompt, orchestrator-driven concurrency

Readme

pi-spawn

Minimal subagent extension for the pi coding agent — isolated in-process tasks with a fresh context window.

Install

pi install npm:pi-spawn

What it does

pi-spawn adds a single spawn tool. Each call creates an isolated, in-process subagent session that runs one focused task and returns structured results. The subagent gets a completely fresh context window — it has zero access to your parent conversation history, so every file path, pattern, and requirement must be stated in the prompt.

There is no batching API and no concurrency parameter. The orchestrator (you, the calling model) controls concurrency naturally through your tool call pattern. Fire one spawn for a single task, fire several in one turn for parallel work, or chain them sequentially when steps depend on each other. pi's execution engine handles the rest.

Concurrency model

| Pattern | When to use it | How | |---------|---------------|-----| | Single | One focused task | Call spawn once | | Parallel | Independent tasks | Fire multiple spawn calls in one turn | | Serial | Step B needs Step A's output | Call spawn, wait for result, then call again | | Mixed | Scout then build | Parallel scouts → parent merges findings → serial implementation |

Rule: if spawn A's output feeds spawn B, use serial. Never fire both in one turn and hope A finishes first.

When to spawn vs when NOT to spawn

Spawn when a task has a different focus than the parent and benefits from isolation: fresh code review, parallel reconnaissance across a codebase, research, validation, or non-trivial code generation where you do not already know the exact implementation.

Do NOT spawn if you know the exact implementation — write the file directly instead.

Empty-shell test: If removing the inline code from your prompt leaves an empty prompt, you are just dictating variable names line-by-line. Write the file directly.

Security model

  • Tool inheritance: The child inherits the parent's currently active built-in tool subset. If the parent is in a restricted mode (for example read-only plan mode), the child inherits that restriction.
  • Recursion guard: The spawn extension is explicitly excluded from the subagent's loaded extensions, preventing nested self-spawn.
  • Same permissions: Spawned agents run with the same model credentials and permissions as the parent.

Usage examples

  • "Spawn a subagent to review src/auth.ts for security issues"
  • "Spawn three subagents in parallel: one to find all model definitions, one to find all provider configs, one to find all tool registrations"
  • "Spawn a subagent to research the best retry strategy for fetch, then implement it"
  • "Spawn a subagent to read src/db/schema.ts and validate that all foreign keys have matching indexes"

Configuration

You can optionally override the thinking level for a single subagent via the thinking parameter:

spawn({
  prompt: "Refactor the error handling in src/api/client.ts",
  thinking: "high"
})

If omitted, the subagent defaults to the parent's current thinking level.

License

MIT