- All playbooks
- Give each parallel agent its own checkout and a claimed task
Give each parallel agent its own checkout and a claimed task
Each agent works in its own container or worktree and claims a task with a lock file before it starts.
Company examples
How Anthropic used this technique
Read what Anthropic changed and follow the original sources.
Give each parallel agent its own checkout and a claimed task
In Anthropic's C compiler project, each agent runs in its own Docker container, clones the shared repository to its own workspace and pushes from there. An agent takes a lock on a task by writing a text file to current_tasks/, so git's synchronization forces a second agent that claims the same task to pick a different one. Bun's Rust port split its work into 4 workflow shards, each in its own worktree and running 16 Claudes, and told the agents to avoid git stash, git reset and any git command beyond committing specific files.
- Use it when
- Several agents push to one repository, or two agents pick up the same task.
- Before applying it
- Task locks are plain files in the repository, so merge conflicts are frequent and the agents resolve them. Keep slow shared commands out of the agents' loop.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed