Use /batch to Fan Out Massive Changesets Across Parallel Agents
When you need to make the same kind of change across dozens, hundreds, or even thousands of files, /batch is the command that scales Claude Code horizontally.
/batch "Update every API endpoint to use the new auth middleware"
/batch interviews you about the task, then fans the work out to as many worktree agents as it takes to get it done. Each agent works in its own git worktree, so there are no conflicts and no agents stepping on each other.
This is perfect for:
- Large-scale code migrations (e.g. updating an import path across a monorepo)
- Applying a consistent pattern change to many files
- Refactoring that follows a repeatable template
The key difference from running a shell loop with claude -p is that /batch is interactive. It confirms the plan with you first, then orchestrates everything, including creating branches, running the work in parallel, and collecting results.
If you have been doing large refactors one file at a time, or writing custom scripts to automate repetitive changes, /batch replaces all of that with a single command.
One prompt, a thousand files, zero conflicts.
via @bcherny
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.