Sub-agents

Spawn specialized sub-agents with chains, parallel execution, TUI clarification, and async support.

What it does

Sub-agents lets Pi spawn isolated child agents that each run in their own context. You can run agents in sequence (chaining), in parallel, or asynchronously — the orchestrator waits on results and assembles them however you specify.

Each agent gets a focused system prompt and a specific task. This keeps individual context windows small and targeted, which tends to produce better results than asking a single agent to hold too much state at once.

Pi-subagents ships seven built-in specialists: scout (codebase exploration), planner (task decomposition), worker (implementation), reviewer (code review), context-builder (context gathering), researcher (information lookup), and delegate (general-purpose forwarding). You can override any of them or add your own via agent frontmatter.

Why it's included

Complex tasks benefit from decomposition. A single monolithic agent working through a large refactor will lose track of things that a coordinated set of specialists handles cleanly. Sub-agents makes Pi's architecture match the way hard problems are actually structured — break it down, parallelize what you can, and review the result.

Commands

CommandWhat it does
/agents Open the agent management TUI — browse agents, view configs, press e to edit overrides

The primary interface is the subagent tool, which Pi invokes directly. Most interaction happens naturally through conversation rather than explicit slash commands.