pi-subagents README

README проекта с github.com/nicobailon/pi-subagents. Одним файлом markdown: 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

What's new in 0.91

https://github.com/user-attachments/assets/859acad5-2fc0-4d10-b915-77c184de5c12

The tool descriptions and skill are gone, replaced by one self-teaching subagent tool: its first call returns a guide, and each feature's first use comes back with a tip. It takes about 5x less context than 0.90 once your agent delegates, with every feature kept. In an interactive session, background runs without a timeoutMs no longer stop at 30 minutes; your agent gets a check-in instead. If your instructions load the pi-subagents skill, use subagent({action:"guide"}) instead. See the changelog for everything else.

Install

pi install npm:pi-subagents

That is the only required step. pi-subagents needs Pi 1.2.0 or newer. Background children use the host's SDK: npm Pi keeps its detached Node runner; the official Pi 1.2.0 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. Every session declares one small subagent tool that never changes during the session, plus contact_supervisor. It is light on context: about 300 tokens per request before a session delegates and about 1,600 after (measured on Claude). Its first reply is the guide: the agents you have, the launch fields, and the actions; a launch made before that is held once. Later replies explain each new thing once, when it first happens. In a test with no skills or project instructions, a fresh agent asked to fix three bugs with subagents launched all three fixes in parallel on its first try, in every run (how it was measured). Waiting (action: "wait") and answering a child's question (action: "reply") are actions of the same tool. When to delegate is up to you and your project instructions; the tool only says what it does.

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 Read-only code review 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, extension-api, and council.

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 Single-model selection and launch, defaults, per-role overrides, recommended tiering, 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 The one small subagent tool (one declared field, args, the same on every model; its first reply is the guide), every parameter, management actions, status/control actions including wait and reply, 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)

Ищем в базе…

Что это такое?Расширение для Pi — агента для работы с кодом, — которое позволяет Pi передавать задачи дочерним агентам, каждый из которых занимается своей узкой задачей. Это полезно для проверки кода, разведки, реализации задач, параллельных аудитов, сохранённых сценариев работы и фоновых задач.
То есть это отдельное приложение или дополнение к Pi?Это расширение для Pi, а не самостоятельное приложение. Pi остаётся родительской сессией, а каждый субагент — это отдельная дочерняя сессия Pi со своим конкретным заданием: Pi запускает дочернюю сессию, передаёт ей задачу и возвращает результат обратно.
Как его запустить?Установите расширение через npm — это единственный обязательный шаг. Дальше просто просите Pi обычным языком: не нужно создавать агентов, писать конфиги или учить слэш-команды, потому что Pi сам решает, когда делегировать задачу и какого агента выбрать.
Нужно ли что-то дополнительно ставить для фоновых агентов или поиска в интернете?Фоновые дочерние агенты используют SDK хоста: у Pi на базе npm остаётся свой отсоединённый раннер Node, а официальный отдельный релиз Pi 0.85.1 Linux x64 подгружает его через встроенный SDK — ничего отдельно ставить не нужно. Агентам researcher и evidence-auditor дополнительно требуется pi-web-access в дочерней сессии.
После установки он начнёт сам проверять мой код?Нет — установка лишь даёт Pi инструмент делегирования и ничего не запускает в фоне. Если хотите, чтобы каждое изменение кода проверялось, скажите об этом в своём промпте или в инструкциях проекта.
Какие субагенты в него входят?Семь встроенных: scout (быстрая разведка локальной кодовой базы), researcher (поиск в интернете со ссылками на источники; требует pi-web-access), evidence-auditor (проверяет, подтверждаются ли выводы исследования их источниками), worker (реализация и проверка), reviewer (проверка кода с небольшими исправлениями), oracle (второе мнение, которое подвергает сомнению допущения, но ничего не меняет) и delegate (лёгкий универсальный агент, работающий максимально близко к родительской сессии).
Как лучше выстроить их в цепочку для работы над кодом?Рекомендуемый цикл: сначала clarify, затем scout, затем worker, затем свежие reviewers и снова worker. Встроенные шорткаты вроде /parallel-review и /review-loop делают типовые схемы повторяемыми — например, запуск reviewers для проверки корректности, тестов и чистоты кода, или /council с советниками на разных моделях для обсуждения важного решения.
Как следить за фоновыми агентами, пока они работают?В обычном режиме прогресс виден прямо в диалоге; фоновые задачи продолжают работать после того, как управление вернулось к вам. В TUI под редактором есть постоянная панель FleetView с активными задачами, а команда /subagents-fleet открывает живой инспектор, где можно смотреть дочерние сессии, читать их логи, подсказывать работающему агенту или останавливать задачу. Можно и просто попросить Pi показать текущие фоновые задачи.
Можно ли добавить своих агентов помимо встроенных?Да. Документ Agents описывает собственные агенты с примером frontmatter, переопределение встроенных, назначение инструментов, расширений и скиллов, а также память для каждого агента. Выбор модели для каждой роли, запасные модели и уровни рассуждения описаны в документе Models.
Какие есть похожие проекты?pi-shadow-mind, evenfire, claude-code, foreman, oh-my-subagents, gentle-shell, kimi-code, claude_codex_bridge
Автор
nicobailon
Размер
24 MB
Звёзды
4.2K
Возраст
10 мес
Коммиты · 90 дней