# pi-agent-teams An experimental [Pi](https://pi.dev) extension that brings [Claude Code agent teams](https://code.claude.com/docs/en/agent-teams) to Pi. Spawn teammates, share a task list, and coordinate work across multiple Pi sessions. > **Status:** MVP (command-driven + status widget). See [`docs/claude-parity.md`](docs/claude-parity.md) for the full roadmap. ## Features Core agent-teams primitives, matching Claude's design: - **Shared task list** — file-per-task on disk with three states (pending / in-progress / completed) and dependency tracking so blocked tasks stay blocked until their prerequisites finish. - **Auto-claim** — idle teammates automatically pick up the next unassigned, unblocked task. No manual dispatching required (disable with `PI_TEAMS_DEFAULT_AUTO_CLAIM=0`). - **Direct messages and broadcast** — send a message to one teammate or all of them at once, via file-based mailboxes. Urgent messages can interrupt active turns via steering. - **Graceful lifecycle** — spawn, stop, shutdown (with handshake), or kill teammates. The leader tracks who's online, idle, or streaming. - **LLM-callable teams tool** — the model can spawn teammates, delegate tasks, mutate task assignment/status/dependencies, message teammates, and run lifecycle actions in tool calls (no slash commands needed). - **Team done + cleanup** — `/team done` ends a run (stops teammates, hides the widget, notifies with a summary); the widget auto-detects when all tasks are complete and shows a hint. `/team cleanup` tears down artifacts afterward. Additional Pi-specific capabilities: - **Git worktrees** — optionally give each teammate its own worktree so they work on isolated branches without conflicting edits. - **Session branching** — clone the leader's conversation context into a teammate so it starts with full awareness of the work so far, instead of from scratch. - **Completion notifications** — when a teammate finishes or fails a task, the leader LLM receives a structured `[Team]` message with task ID, subject, result summary, and progress counters so it can orchestrate autonomously without human intervention. When quality-gate hooks are active, the message warns that task states may still change. - **Hooks / quality gates** — optional leader-side hooks on idle / task completion to run scripts (opt-in). ## UI style (terminology + naming) Built-in styles: - **normal** (default): "Team leader" + "Teammate " (spawn requires explicit name) - **soviet**: "Chairman" + "Comrade " (spawn can auto-pick names) - **pirate**: "Captain" + "Matey " (spawn can auto-pick names) Configure via: - env: `PI_TEAMS_STYLE=` - command: `/team style ` (see: `/team style list`) ### Custom styles You can add your own styles by creating JSON files under: - `~/.pi/agent/teams/_styles/