---
title: "Split work between agents by files and · Agent Wranglers"
url: https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale/multi-agent-split
id: AID-67
level: Recommended
updated: 2026-10-22
tokens: 885
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Split work between agents by files and merge through one lead

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Running agents at scale](https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: AID-67
- Level: Recommended
- Chapter: [Running agents at scale](https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale.md)
- Rule: 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.
- 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.
- How: 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](https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale/parallel-agent-workspaces.md) says. Searches that only read go to subagents, as [Send wide searches to a subagent](https://agentwranglers.se/playbook/ai-assisted-development/context-and-memory/subagents-for-side-work.md) describes. The lead runs the full checks after each merge.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Shell example

```bash
# 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
```

## Sources

- [Claude Code agent teams, avoid file conflicts](https://code.claude.com/docs/en/agent-teams)

## Related rules

- AID-63 [Give every parallel agent its own working copy](https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale/parallel-agent-workspaces.md) in AI-assisted development
- AID-46 [Send wide searches to a subagent](https://agentwranglers.se/playbook/ai-assisted-development/context-and-memory/subagents-for-side-work.md) in AI-assisted development

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/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.

- Previous: [Use review bots as a first pass and never as the approval](https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale/review-bots-first-pass.md)
- Next: [Attribute the cost of every agent session](https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale/agent-cost-attribution.md)
- [Running agents at scale](https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale.md)
