Skip to content

Teams

Teams define coordinated multi-agent workflows. A team specifies which agents participate and how they collaborate.

PanCode ships with two built-in team definitions:

Developer writes code, reviewer checks it. Sequential workflow.

dev -> reviewer

The dev agent implements the task, then the reviewer agent analyzes the output for bugs, security issues, and improvements.

Reviewer explores the codebase first, developer implements based on findings. Sequential workflow.

reviewer -> dev

The reviewer agent explores and analyzes relevant code, then the dev agent uses those findings to implement changes with better context.

interface TeamDefinition {
name: string; // Team identifier
description: string; // Human-readable purpose
agents: string[]; // Ordered list of agent names
workflow: "parallel" | "sequential" | "review";
}
TypeBehavior
parallelAll agents run simultaneously on the same task
sequentialAgents run in order. Each agent’s output feeds into the next.
reviewPrimary agent does the work, review agent validates the output.

PanCode provides three dispatch tools that implement team-like coordination:

Dispatch one agent for one task.

dispatch_agent(task: "Review config.ts", agent: "reviewer")

Run multiple tasks simultaneously across agents.

batch_dispatch(tasks: [
{ task: "Review auth module", agent: "reviewer" },
{ task: "Review config module", agent: "reviewer" },
{ task: "Explore test coverage", agent: "scout" }
])

Each task gets its own worker subprocess. PanCode staggers launches to avoid resource contention.

Run a multi-step pipeline where each step builds on the previous.

dispatch_chain(steps: [
{ task: "Analyze the authentication flow", agent: "planner" },
{ task: "Implement the proposed changes", agent: "builder" },
{ task: "Review the implementation", agent: "reviewer" }
])

The chain stops if any step fails. Each step receives the output of the previous step as context.

Team execution respects the current orchestrator mode:

ModeTeam Behavior
PlanDispatch disabled. Use shadow agents for exploration.
BuildFull team execution. All agents available.
ReviewOnly readonly agents can be dispatched.
AdminFull team execution with elevated permissions.

In Review mode, a code-review team would fail on the dev step because dev is not readonly. Use this intentionally to restrict what teams can do in different contexts.

Any dispatch (single, batch, or chain) can use worktree isolation:

dispatch_agent(task: "Refactor config.ts", agent: "builder", isolate: true)

With isolation enabled:

  1. PanCode creates a git worktree for the worker
  2. The worker operates on the isolated copy
  3. On completion, delta patches are merged back to the main workspace
  4. The worktree is cleaned up

This prevents concurrent workers from interfering with each other’s file changes.

/runs View all dispatch history
/batches View batch dispatch history
/cost Per-run cost breakdown
/metrics Aggregate statistics
/stoprun <id> Stop a running dispatch

Team dispatches go through the same admission pipeline as single dispatches:

  1. Safety pre-flight: Checks scope enforcement and loop detection
  2. Budget check: Verifies budget ceiling is not exceeded
  3. Recursion guard: Prevents unbounded subprocess trees (default max depth: 2)
  4. Path validation: Blocks scope violations and warns about missing files