# Parallel Agents

> The Parallel Agents is a technique of running several coding agents at the same time on independent tasks.

## How do I run multiple AI coding agents in parallel?

The technique of running several agents simultaneously, each in its own branch, git worktree or container, so they do not conflict. The developer acts as a reviewer and integrates the results.

- Topic: Agentic Coding
- Type: technique

## Example

Wrong:

```bash
# Two agents in the same checkout
cd my-app && agent "Add dark mode" &
cd my-app && agent "Refactor auth" &
```

Right:

```bash
git worktree add ../my-app-dark-mode -b feat/dark-mode
git worktree add ../my-app-auth -b refactor/auth
# Run one agent in each folder, then review each branch
```

Each git worktree is a separate folder on its own branch, so agents never overwrite each other's files.

## Common mistakes

- Two agents editing the same files at once, causing conflicts and lost changes.

## Key points

- Each agent works in its own branch or worktree, never in the same working copy.
- Tasks are split so that agents do not edit the same files.
- Each result is reviewed and tested separately before merging.

## Interview questions

### What is a git worktree?

A git worktree is an extra working folder linked to the same repository, checked out on its own branch. Several worktrees can be open at once without cloning the repo again.

### How many coding agents can I run at once?

As many as you can review well. The real limit is usually your review time and merge conflicts, not the tools.

### Should parallel agents work on the same feature?

Usually not. Split work into independent tasks that touch different files, or run agents one after another when one depends on another.

## Related cards

- [git worktree](https://wonderium.dev/processes/git-worktree.md)
- [Sub-Agent](https://wonderium.dev/ai/sub-agent.md)
- [Background Agent](https://wonderium.dev/ai/background-agent.md)
- [Multi-Agent System](https://wonderium.dev/ai/multi-agent-system.md)
- [Branch](https://wonderium.dev/processes/branch.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/parallel-agents
- Last updated: 2026-11-25
