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

v1.7.1

Published

Subagents for pi with no fuss: one Markdown file per agent, one tool call to run it, overrides to fit your workflow.

Readme

pi-simple-agents

Subagents for pi with no fuss: one Markdown file per agent, one tool call to run it, and overrides to fit your workflow.

npm version License: MIT XERJ Corpus Hub contributor

Install

pi install npm:pi-simple-agents

Needs pi 1.0.4 or later. Per-tool durations in the peek window and precise abort labeling (an externally aborted run settling as failed instead of completed) need pi 1.1.0 or later; on older hosts both degrade gracefully to the previous behavior.

Define an agent

Put a Markdown file in ~/.pi/agent/agents/. The frontmatter sets the name and the tools; the body is the system prompt. A trusted project's own .pi/agents is discovered too, from the working directory up to the repository root.

---
name: scout
description: Codebase explorer
tools: read, grep, find, ls
---
Explore the codebase and report findings, compressed and read-only.

Override an agent

settings.json changes any agent field without touching its .md file. The user file is ~/.pi/agent/settings.json, the project file is {project}/.pi/settings.json, and the project wins:

{
  "pi-simple-agents": {
    "agentOverrides": {
      "scout": { "model": "openrouter/anthropic/claude-sonnet-4-20250514", "thinking": "high" }
    }
  }
}

subagents.agentOverrides works as an alias for the same key. Values merge field by field, so a field left out keeps its frontmatter value. model takes a provider/modelId reference or "inherit". docs/REFERENCE.md lists the precedence rules and the accepted fields.

Use it

Ask for it in plain words:

Use the agent scout to find all the functions that use fetch in src

Or call the tool directly:

subagent agent: "scout", task: "Find all functions that use fetch() in src/"

Each call starts its own background job, so running several at once just means calling subagent once per task:

subagent agent: "scout", task: "List all .ts files in src/"
subagent agent: "web-scout", task: "Find the latest version of the API docs"

The call answers at once with a job id, and the result arrives later as its own message. Jobs are managed with /subagents: docs/REFERENCE.md covers the lifecycle, and the next section lists every subcommand.

A subagent can also stop and ask. When a decision needs context only you have, it calls subagent_callback, the question arrives as a message of its own, and answering it with subagent_job (steer or followUp) sends that text back into the same run, which then carries on from where it stopped. The wait always ends — the child's own timeout included — so an unanswered question never hangs a job. docs/REFERENCE.md has the mechanism, and how to switch the capability off.

A call can override model, tools, skills, thinking, maxTurns and timeoutMs for that run only:

subagent agent: "scout", task: "Find the latest version of the API docs", model: "anthropic/claude-opus-4-8", thinking: "high", maxTurns: 5

Omit them all by default: the agent's own frontmatter/settings resolution is what runs, and an override belongs in the call only when the user asks for it by name.

The /subagents command

Bare /subagents (or /subagents help) prints the man page: one line per subcommand with its argument shape. /subagents list shows the jobs: running and recently finished, newest first. Each entry's header (id, status, elapsed) is followed by the model the run uses (provider/modelId) on a line of its own, and a finished job adds a usage footer; status and peek show the same model line.

  • /subagents status [id] details one job: the model it runs, the current activity, the last tool calls of the run, and usage so far.
  • /subagents peek [id] opens a live window over one job: a live view rendered per entry, so each text block, each thinking block and each tool call with its full result shows as it happens; it opens fullscreen, Esc or q closes it, Ctrl+O toggles tool output expansion, Ctrl+T toggles thinking for that window only (seeded from your thinking setting and never saved), and scrolling to the top pages older history in from the run's persisted session file. Needs an interactive TUI session; other modes get a warning.
  • /subagents cancel [id] stops a running job.
  • /subagents steer <id> <message> injects a message into a running job's live session. It lands after the current turn's tool calls finish, before the next model call, so the agent reads it and adjusts the work still pending.
  • /subagents followUp <id> <message> queues a message for the end of the run. It extends the run: the job settles only after the follow-up is processed, and the run can still hit its timeoutMs or maxTurns along the way.
  • /subagents retry [id] re-dispatches a settled run as a NEW job: the same agent, the same task, a run id of its own. It relaunches with the original call's per-call overrides when the launch recorded them, and with the agent's own defaults otherwise; the output says which.
  • /subagents continue [id] brings back a run that died mid-run from its persisted child session: the new job branches from the interrupted one and the agent is first told to re-verify half-done work. When a run failed by hitting maxTurns or timeoutMs, continue is usually the better choice: the forked history keeps the partial work, while a retry re-does it from zero.
  • /subagents clear drops finished jobs from the list.
  • /subagents session reports the session's combined subagent spend in three blocks: Main Session (the parent session's own tokens and cost), Subagents (token totals with a cache hit rate, cost per model, and one line per agent, like scout: 3 runs, 1.2M tokens, $0.980), and Total (Main + Subagents). Main comes from the live session entries; Subagents comes from the child runs persisted on disk. It needs a persisted session; otherwise it warns and exits. pi's native /session command and footer count only the main session, so this command is the only place the combined total is visible.

Without an id, most subcommands pick the single active job on their own; several actives ask for one, and status falls back to the newest finished one. A settled job can no longer be cancelled, steered, or followed up, but it can be retried or continued.

MCP tools

Subagents use pi's built-in MCP (~/.pi/agent/mcp.json). pi-mcp-adapter is not supported.

If the agent has a tools list, name each MCP tool exactly as pi registers it, mcp__<server>__<tool>. mcp__<server>__* brings in every tool of that server. A tool left off the list doesn't exist for that agent, not even through tool_search or codemode:

subagent agent: "worker", task: "Compile the project", tools: ["read", "mcp__mde-build__mvn"]

A server with "exposure": "deferred" also needs tool_search in the list, and one with the default codemode exposure needs codemode. An agent with no tools list gets every tool the session has. pi connects MCP servers in the background at session start; the subagent waits up to 10 s for the requested tools (names or patterns) to register before starting, and fails naming whatever never appeared. docs/REFERENCE.md has the details.

More

  • docs/REFERENCE.md: frontmatter fields, per-call overrides, settings.json overrides, Claude Code compatibility, limits.
  • DEVELOPER.md: internals and tests.
  • agents-examples/ ships two sample agents, scout and web-scout.
  • The bundled invoking-subagents skill teaches the model how to call the tool (/skill:invoking-subagents).

License

MIT