AID-67Recommended
Split work between agents by files and merge through one lead
When several agents work toward one goal, give each a written task that lists the files or folders it may change. No two agents own the same file, and one lead session or person merges the results.
How to do it
Use one agent unless the parts are independent, because several agents cost several times the tokens of one. Let the lead first write the shared parts, such as types and interfaces, and commit them. Then each worker gets its own task file with its list of allowed paths. It also gets its own copy, as Give every parallel agent its own working copy says. Searches that only read go to subagents, as Send wide searches to a subagent describes. The lead runs the full checks after each merge.
Examples
Shell example
# check-scope.sh <task-file>: fails when the branch changes a file outside the task's allowed paths
allowed=$(sed -n 's/^allowed: //p' "$1")
git diff --name-only origin/main...HEAD | while read -r file; do
case "$file" in $allowed) ;; *) echo "Outside task scope: $file"; exit 1 ;; esac
done
How to check
Every worker task file lists allowed paths. A CI step compares each worker branch with its list and fails on any changed file outside it.
Sources
Related rules
- AID-63 Give every parallel agent its own working copy in AI-assisted development
- AID-46 Send wide searches to a subagent in AI-assisted development
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale/multi-agent-split">Agent Wranglers AI-assisted development playbook</a>. In code you write, add a comment next to it with the same link.