Engineering
Parallel Agent Worktree Sweep
Run more agents, but keep their blast radiuses separate.
Use when
You have multiple independent coding tasks and the human bottleneck is orchestration, not implementation speed.
Cadence
When several independent repo improvements can run at once
Verification
Each agent branch has isolated scope, passing checks, a summary, and no conflicting files before integration review.
Advanced specStructured loop spec
| Field | Value |
|---|---|
| Name | Parallel Agent Worktree Sweep |
| Category | Engineering |
| Trigger | When several independent repo improvements can run at once |
| Objective | Run more agents, but keep their blast radiuses separate. |
| Allowed inputs | Relevant files, source notes, logs, tests, screenshots, metrics, or task state for this loop |
| Allowed actions | Split the work into independent tasks with non-overlapping files or explicit conflict boundaries.; Create separate branches or worktrees and give each agent its own goal, commands, budget, and done contract.; Require each agent to return diff summary, verification output, known risks, and next-step recommendation.; Review branches in priority order, checking for overlapping files, duplicated abstractions, and integration risks.; Merge only the branches with passing evidence and clear product value; park or discard the rest. |
| Verification | Each agent branch has isolated scope, passing checks, a summary, and no conflicting files before integration review. |
| Stop condition | Stop when the verifier passes, the budget is exhausted, no progress is made, a blocker appears, or approval is required. |
| Budget | Set a time, turn, token, retry, file, or dollar cap before running the loop. |
| Approval boundary | Human approval required before publishing, sending, deleting, spending, changing accounts, touching production, or making reputational/legal/financial commitments. |
| Safe output | Pull request, patch, report, or evidence log |
| Works with | Claude Code, OpenAI Codex, Cursor, Gemini CLI, any tool-using coding agent |
RunbookSteps
- Split the work into independent tasks with non-overlapping files or explicit conflict boundaries.
- Create separate branches or worktrees and give each agent its own goal, commands, budget, and done contract.
- Require each agent to return diff summary, verification output, known risks, and next-step recommendation.
- Review branches in priority order, checking for overlapping files, duplicated abstractions, and integration risks.
- Merge only the branches with passing evidence and clear product value; park or discard the rest.
Copy promptPrompt
Run the Parallel Agent Worktree Sweep loop. Split the repo work into independent tasks with non-overlapping scope, then create one branch or worktree per agent. Give each agent a goal, commands, budget, and done contract. Require diff summary, verification output, risks, and recommendation. Review branches for conflicts, duplicated abstractions, and integration risk before merging anything. Park or discard weak branches instead of forcing a messy merge.