← Catalog

@lwlee2608/pi-subagent

Persistent Pi subagents with live progress and explicit task controls.

Extension

Install

Install with PiG

pig install npm:@lwlee2608/pi-subagent

Install with Pi

pi install npm:@lwlee2608/pi-subagent
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Video

Declared by the package manifest. Open the file ↗

Pi manifest JSON

The pi field of package.json.

{
  "image": "https://raw.githubusercontent.com/lwlee2608/pi-extensions/main/packages/subagent/media/inspector.png",
  "video": "https://raw.githubusercontent.com/lwlee2608/pi-extensions/main/packages/subagent/media/inspector.mp4",
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.3.3 (README.md). PiG does not review it.

Pi subagent

Let Pi delegate tasks to helper agents. Each one runs as a separate Pi process with its own fresh context. Run reviewers in parallel, keep a worker around for follow-up tasks, and answer its questions while it works.

Install

pi install npm:@lwlee2608/pi-subagent

Run /reload if Pi is already open. Requires Node.js 22.19+ and Pi 1.x on Linux or macOS. Windows is not supported.

Don't install it alongside another extension that provides a subagent tool. Only one can load at a time.

Use

Ask Pi in plain language:

Use a reviewer to review the local diff.
Run three reviewers in parallel: one for correctness, one for tests, one for security.
Start a worker in ../my-worktree to implement the plan, then keep it around for review feedback.

Pi starts the workers, waits for them, and brings their results back. A compact panel above the editor shows progress while they run.

Subagent panel showing a phased build with worker and reviewer rounds

Things to know:

  • Each worker starts with fresh context. It does not see your conversation, only the task Pi gives it.
  • A worker can ask Pi a question mid-task. Pi answers it, or you can answer from the inspector.
  • By default a worker exits after one task. Ask Pi to keep it if you want to send follow-up tasks.
  • Stopping a worker never deletes its edits or transcript.
  • Worktrees and Git are up to you (or Pi). This extension never creates or removes them.

Bundled agents

AgentToolsUse it for
workerread, bash, edit, write, grep, find, lsImplementing and checking a focused task.
reviewerread, bash, grep, find, lsReviewing changes without editing files.

Both use your current model and thinking level unless you set one.

Custom agents

Add Markdown files to ~/.pi/agent/agents/. A file with the same name as a bundled agent replaces it.

---
name: reviewer
description: Reviews changes without modifying files
tools: read, bash, grep, find, ls
model: provider/model:high
---
System prompt for the agent.
FieldMeaning
nameName Pi uses to start the agent.
descriptionWhat the agent is for.
toolsAllowed tools. Defaults to all built-in tools.
modelprovider/model, with optional :effort suffix. Defaults to your current model.
effortThinking level: off, minimal, low, medium, high, xhigh, max.
extensionsNames from extensions in config.json to load in the child. Defaults to all of them.

A model or effort Pi passes for one task overrides the agent file.

Project agents in .pi/agents/ are ignored unless the project root is listed in trustedProjectRoots (see below).

Not a sandbox: tool lists are instructions, not OS isolation. An agent with bash can still modify files.

Configuration

Optional. Create ~/.pi/agent/pi-subagent/config.json:

{
  "extensions": { "provider": "/absolute/path/to/provider-extension.ts" },
  "trustedProjectRoots": ["/absolute/path/to/project"],
  "maxActive": 4,
  "maxWorkers": 16
}
KeyDefaultMeaning
extensionsInherit yoursExtensions children load. Replaces inheritance; {} loads none.
trustedProjectRoots[]Projects allowed to supply agents from .pi/agents/.
maxActive4Workers running at once. Extra tasks queue.
maxWorkers16Live workers, including idle ones kept for follow-ups.

Inspector

Press ↓ on an empty prompt while the panel is showing, or run /subagents, to open a live view: workers on the left, grouped with the reviewers nested under them, and the selected worker's transcript on the right.

Subagent inspector showing the worker tree and a live transcript

KeyAction
↑/↓Select worker
PgUp/PgDn, EndScroll transcript, follow live output
iShow model, folder, PID, session file and IDs
mSend a task, or steer a running worker
rReply to a question
sStop (confirm with y)
cRecover a closed worker
EscClose

Storage

Sessions and results are saved under ~/.pi/agent/pi-subagent/, readable only by you. Quitting Pi or running /reload closes all workers. Workers kept for follow-ups can be recovered later from the same Pi session.

License

MIT