pi-subagents README

The project's README from github.com/nicobailon/pi-subagents. As one markdown file: README.md.

pi-subagents

pi-subagents

pi-subagents lets Pi delegate work to focused child agents. Use it for code review, scouting, implementation, parallel audits, saved workflows, background jobs, and anything else that benefits from a second or third set of model eyes.

https://github.com/user-attachments/assets/702554ec-faaf-4635-80aa-fb5d6e292fd1

Install

pi install npm:pi-subagents

That is the only required step. Background children use the host's SDK: npm Pi keeps its detached Node runner; the official Pi 0.85.1 Linux x64 standalone release loads the same runner through Pi's embedded SDK, without a separate SDK install. See Standalone background execution for the supported boundary and validation gate.

Try this first

You do not need to create agents, write config, or learn slash commands. After installing, ask Pi in plain language:

Use reviewer to review this diff.
Ask oracle for a second opinion on my current plan. Challenge assumptions and tell me what I might be missing.
Use scout to understand this code based on our discussion, then ask me clarification questions.
Run parallel reviewers: one for correctness, one for tests, and one for unnecessary complexity.

That is enough to start. Pi decides whether to call the subagent tool, which agent to use, and how to compose the work.

How it works

Pi is the parent session. A subagent is a focused child Pi session with its own job.

When you ask for a subagent, Pi starts the child, gives it the task, and brings the result back. Foreground children run as sessions inside the parent Pi process and stream in the conversation. Background children run as sessions inside a detached runner process that keeps working and can be checked later.

Installing the extension does not start an automatic reviewer in the background. It gives Pi a delegation tool. If you want every implementation reviewed, say so in your prompt or project instructions:

When you finish implementing, run a reviewer subagent before summarizing.

Builtin agents

The extension ships with agents you can use immediately:

Agent Use it when you want...
scout Fast local codebase recon: relevant files, entry points, data flow, risks.
researcher Web/docs research with sources and a concise research brief. Requires pi-web-access in the child.
evidence-auditor Independently checks whether important research claims are supported by their sources. Requires pi-web-access in the child.
worker Implementation work. Edits files, validates, escalates unapproved decisions instead of guessing.
reviewer Code review and small fixes against the task/plan, tests, edge cases, and simplicity.
oracle A second opinion before acting. Challenges assumptions without editing.
delegate A lightweight general delegate that behaves close to the parent session.

Rule of thumb: scout before you understand the code, researcher before you trust external facts, evidence-auditor before you rely on important research, worker to implement, reviewer to check, and oracle when the decision itself feels risky.

Common workflows

The package includes /council and council-mode, plus documented model-based council-* profile examples that you add in your own agent directory.

Want Ask naturally
Get a second opinion "Ask oracle to review this plan and challenge assumptions."
Solve a hard problem "Use oracle to investigate this bug before we edit."
Review a diff "Use reviewer to review this diff."
Run parallel reviewers "Run reviewers for correctness, tests, and cleanup."
Debate a material decision "Use /council with model-based advisors to compare this decision."
Implement then review "Implement this, then review it."
Review until clean "Run a review loop on this change with a max of 3 rounds."
Execute a plan carefully "Have worker implement this approved plan, then run reviewers and apply the feedback."
Scout before planning "Use scout to inspect the auth flow before planning."
Run in the background "Run this in the background."
Use a saved workflow "Run the review chain on this branch."
Browse agents "Show me the available subagents."
See running work "Show active async runs." or "Show the subagent fleet."
Check setup "Check whether subagents are configured correctly."

For implementation work, the recommended loop is clarify → scout → worker → fresh reviewers → worker. Packaged prompt shortcuts like /parallel-review and /review-loop make these patterns repeatable — see Workflows.

Where running work shows up

Foreground runs stream progress in the conversation. Background runs keep working after control returns to you.

In the TUI, a persistent FleetView below the editor keeps active work visible. /subagents-fleet opens a live inspector where you can browse children, read transcripts, steer a running child, or stop a run. You can also just ask: "Show me the current async runs."

Details, keybindings, and the machine-readable run artifacts are in Observability.

For bounded orchestration, maxSubagentSpawnsPerRun limits cumulative logical children in one run tree. It defaults to 64 and stays separate from active concurrency and the session-wide cumulative spawn budget. See Configuration.

If something feels off

/subagents-doctor

or ask: "Check whether subagents and intercom are set up correctly."

For installed-version help, use /subagents-guide [topic] or subagent({ action: "guide", topic: "workflows" }). The default topic is overview; available topics are overview, workflows, agents, missions, observability, tool-reference, configuration, models, watchdog, and extension-api.

Documentation

The full reference lives in docs/:

Doc What's in it
Agents Custom agents, frontmatter reference, overriding builtins, tools, extensions, skills, per-agent memory.
Models Default models, per-role overrides, recommended tiering, fallbacks, thinking levels, model scope enforcement, profiles.
Workflows Orchestration patterns, prompt shortcuts, scripted workflows, worktree isolation, child-to-parent coordination, the recursion guard.
Watchdog The opt-in adversarial change reviewer, scope monitoring, LSP checks, and child tool permissions.
Tool reference Every subagent parameter, management actions, status/control actions, acceptance gates, external CLI runners.
Observability FleetView, the fleet inspector, lifecycle artifacts, events, logs, session sharing.
Missions and schedules Durable mission records, delivery receipts, timed and recurring runs.
Configuration Every config.json key and environment variable.
Extension API The RPC, delegation API, preflight, capability ceilings, trusted workflow resources, background-work providers, Herdr integration.

pi-subagents (nicobailon/pi-subagents)

Searching Database…

这是什么东西?这是 Pi(一个编程智能体)的扩展,让 Pi 能把工作交给专注的子智能体去做——适合代码审查、前期摸底、功能实现、并行审计、保存常用流程,以及后台任务。
那它是一个独立的软件,还是接在 Pi 上的?它是以扩展的形式接入 Pi 的,不是独立软件。Pi 始终是父会话,每个子智能体都是一个各司其职的子 Pi 会话:Pi 负责启动子会话、把任务交给它,再把结果带回来。
怎么把它跑起来?用 npm 安装这个扩展——这是唯一必须的步骤。然后直接用大白话吩咐 Pi 就行:你不需要创建智能体、写配置,也不用学斜杠命令,因为什么时候派活、用哪个智能体,都由 Pi 自己决定。
后台智能体或联网查资料需要额外安装什么吗?后台子会话会复用宿主的 SDK:基于 npm 的 Pi 自带脱离主进程运行的 Node runner,官方 Pi 0.85.1 Linux x64 独立版则通过 Pi 内嵌的 SDK 加载它,无需单独安装。researcher 和 evidence-auditor 这两个智能体还要求在子会话里装好 pi-web-access。
装好之后它会自动开始审查我的代码吗?不会——安装只是给 Pi 提供了一个派活工具,后台什么都不会自动启动。如果你希望每次实现都经过审查,直接在提示词或项目说明里写明即可。
它自带哪些子智能体?内置七个:scout(快速摸清本地代码库)、researcher(带来源的联网调研,需要 pi-web-access)、evidence-auditor(核对调研结论是否真有来源支撑)、worker(负责实现和验证)、reviewer(代码审查并做小修小补)、oracle(提供第二意见,敢于质疑前提但不改动代码),以及 delegate(贴近父会话的轻量通用派活员)。
做功能实现时,推荐怎么把它们串起来用?推荐的流程是:先 clarify,再 scout,接着 worker,然后换一批全新的 reviewer,最后再回到 worker。自带的快捷方式比如 /parallel-review 和 /review-loop 能让套路一键复用——例如分别安排 reviewer 检查正确性、测试和清理,或者用 /council 让基于不同模型的多位顾问围绕重大决策展开辩论。
后台智能体运行时,我怎么盯着它们?前台任务会在对话里实时显示进度;后台任务则在控制权交还给你之后继续干活。在 TUI 里,编辑器下方有一个常驻的 FleetView 显示进行中的工作,输入 /subagents-fleet 可以打开实时检查器,浏览各个子会话、查看对话记录、中途调整某个正在运行的子会话,或者直接停掉一次运行。你也可以直接让 Pi 展示当前的后台任务。
除了内置的,我能添加自己的智能体吗?可以。Agents 文档介绍了如何用 frontmatter 定义自定义智能体、覆盖内置智能体、为其分配工具、扩展和技能,以及每个智能体各自的记忆。按角色选模型、回退策略和思考等级则见 Models 文档。
Creator
nicobailon
Size
21.8 MB
Stars
4K
Age
9mo
Commits · 90 Days