Five subagents are working in parallel on different modules of the same repository. Without coordination, two agents modifying the same files would cause conflicts. What branching strategy best isolates each agent's work?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Separate branches are separate sandboxes — Agent A cannot see or step on Agent B's uncommitted changes. Each agent owns its branch completely, and the orchestrator's job is to merge the finished sandboxes, not to referee a shared workspace fight.
Full explanation below image
Full Explanation
Agent-per-branch isolation is the standard pattern for parallel multi-agent work on a shared repository. Each agent creates its own branch (e.g., agent/auth-refactor, agent/payments-refactor), makes all its changes on that branch, and the orchestrator merges branches after conflict detection and resolution. This provides complete isolation: agents cannot interfere with each other's in-progress work, each agent's output is independently reviewable as a pull request, and failures are scoped to the individual branch without affecting other agents.
Option A (all agents commit to the same branch in order) requires a serialization mechanism, eliminates the parallelism benefit, and creates complex ordering dependencies. 'Alphabetical order of task IDs' provides no technical enforcement and will result in conflicts.
Option C (committing directly to main) violates branch protection rules in most repositories and makes it impossible to review, test, or reject individual agent contributions. If one agent introduces a regression, it is immediately in production history.
Option D (concurrency group to serialize commits to one branch) eliminates parallel execution — only one agent can work at a time, which is the opposite of what the multi-agent architecture is designed to achieve. It also still creates a shared branch where all agents' changes mix together, making it impossible to isolate individual agent outputs.
Separate agent branches are the fundamental isolation primitive for parallel multi-agent work.