Agent Architecture/Subagents & Agent Teams
Advanced11 min

/batch — 5 to 30 Parallel Agents, Each Opening a PR

/batch takes a single instruction and fans it out into a swarm of independent parallel agents — each in its own worktree, each opening its own PR. It is purpose-built for large-scale parallelizable changes that do not require inter-agent coordination.

Quick Reference

  • /batch spawns 5–30 agents simultaneously, each in an isolated git worktree
  • Each agent opens its own PR — you review and merge individually
  • Shipped February 27-28, 2026 — available in all current Claude Code versions
  • Best for: bulk migrations, applying a pattern across N files, parallel feature scaffolding
  • Each agent gets branch: claude/batch-{id}
  • /batch uses worktree isolation (not agent teams) — no inter-agent communication
  • Calculate cost before running large batches: N agents × per-task cost
  • When /batch beats agent teams: work is truly independent, file-level changes, individual PR review needed

What /batch Does

Three Phases

/batch has three phases: (1) Research & Plan — Claude explores what needs to change and decomposes work into independent units; (2) Parallel Execution — one background agent per unit, all launched simultaneously; (3) Progress Tracking — a status table with PR URLs from each agent.

/batch is not an agent team. It does not use the Shared Task List or peer communication. Each agent is fully independent — it receives a task, works on it in its own worktree, opens a PR, and exits. The agents never talk to each other.

/batchAgent Teams
Inter-agent communicationNoneShared Task List + direct messaging
Work typeIndependent unitsSequential or collaborative
OutputN separate PRsOne synthesized result
Coordination overheadMinimalSignificant
Best forBulk changes, migrations, parallel scaffoldingSequential handoffs, specialization, peer review loops