Batch
Officialby Anthropic
One command decomposes a codebase-wide migration into 25 parallel pull requests -- each tested, code-reviewed, and ready to merge before you finish your coffee. That is not an exaggeration. /batch is a bundled Claude Code skill that analyzes large-scale changes, breaks them into 5 to 30 independent units, spawns one background agent per unit inside isolated git worktrees, and orchestrates the full operation from plan approval to merged PRs without requiring you to babysit any of it. Before /batch, codebase-wide changes were a multi-day grind. Migrating 40 files from React to Vue meant opening each one, making the change, running tests, committing, and moving on -- miss a file and the build breaks three days later. With /batch, you type a single instruction like `/batch migrate src/ from React to Vue` and the skill takes over. An Explore agent researches your codebase, identifies every affected file, and produces a decomposition plan where each unit is independently implementable and mergeable without depending on any other unit landing first. You review the plan, approve it, and workers launch simultaneously. Each worker agent runs in its own git worktree -- complete filesystem isolation means zero merge conflicts during execution. Every worker implements its assigned unit, automatically runs /simplify (a three-agent code review covering reuse, quality, and efficiency), executes your test suite, commits, pushes, and opens a pull request via gh. A real-time status table tracks progress across all units, and when the operation finishes, you see something like '22/24 units landed as PRs' with direct links to review each one. The practical speed gain is dramatic. Operations that took a developer days of tedious, repetitive file-by-file changes now complete in the time it takes all agents to run in parallel -- typically minutes for small units, under an hour for complex migrations. Because each PR is independently reviewable and mergeable, your team can divide review work or merge units incrementally without blocking on a single massive diff. Requires a git repository and the gh CLI for PR creation. Works best when changes decompose naturally into independent units: framework migrations, API contract updates, naming convention enforcement, dependency replacements, adding type annotations, or generating tests for untested modules. Not suited for tightly coupled changes where one unit depends on another unit's output.
Installation
Key Features
- ✓Decomposes codebase-wide changes into 5-30 independent units, each self-contained and mergeable without depending on other units landing first
- ✓Spawns one background agent per unit running in parallel inside isolated git worktrees -- zero merge conflicts, zero cross-contamination between workers
- ✓Each worker automatically runs /simplify (three-agent code review for reuse, quality, and efficiency) before committing, so every PR arrives pre-reviewed
- ✓Real-time status table tracks progress across all parallel workers, showing completion state and PR URLs as they land
- ✓Produces one pull request per unit via gh pr create, enabling incremental review and merge instead of a single massive diff
- ✓Three-phase workflow (Research and Plan, Parallel Execution, Progress Tracking) with explicit user approval before any agents start executing
Use Cases
- →You are staring at a 200-file codebase that needs migrating from one framework to another. Instead of opening each file manually over a week, you type /batch migrate src/ from Solid to React and get 20+ tested PRs back in under an hour.
- →Your team just agreed on a new API error response format and every endpoint needs updating. /batch standardize all API error responses to use the new format decomposes the work, updates every endpoint in parallel, and opens individually reviewable PRs.
- →You inherited a JavaScript codebase with zero type annotations. Running /batch add type annotations to all untyped function parameters spawns parallel agents that annotate every file independently, each passing your existing test suite before opening a PR.
- →A security audit flagged lodash CVEs in your project. /batch replace all uses of lodash with native equivalents rewrites every import site in parallel, preserving behavior while eliminating the dependency.
- →Your monorepo has 15 packages with inconsistent naming conventions. /batch rename all database columns from camelCase to snake_case handles the migration across every package simultaneously with isolated worktrees.