---
title: "Running 10 or more coding agents at once: what breaks and how to fix it · Cork"
description: "What breaks when you run 10 or more AI coding agents at once (rate limits, disk, ports, git races, duplicated work, review load) and practical fixes for each."
canonical: "https://corkcli.com/blog/run-10-coding-agents-at-once"
last_updated: "2026-11-14"
published: "2026-10-03"
author: "Kevin Vera"
---

# Running 10 or more coding agents at once: what breaks and how to fix it

What breaks when you run 10 or more AI coding agents at once (rate limits, disk, ports, git races, duplicated work, review load) and practical fixes for each.

By Kevin Vera · October 3, 2026 · [Guides](https://corkcli.com/blog/c/guides) · 7 min read

Running 10 or more coding agents at once breaks in predictable places: usage and rate limits, disk and setup time for one checkout per agent, shared local resources such as ports and databases, git races when everyone pushes to the same branch, agents duplicating or contradicting each other's work, and the human review queue. Each has a fix: budget tokens per agent, script worktree setup, give each agent its own resources, land through a rebase-test-push loop or a merge queue, coordinate who is changing what, and keep changes small. The coordination problems grow fastest, because the number of pairs of agents that can collide grows much faster than the number of agents.

## 1. Usage limits and token cost

Every agent is a separate model session with its own context window, so cost scales at least linearly with the number of agents. Claude Code's docs say agent team token usage is roughly proportional to team size, recommend starting agent teams with 3 to 5 teammates, and note that agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode. Anthropic's write-up of its multi-agent research system reported that multi-agent systems used about 15 times more tokens than chat interactions.

Fixes:

- Use a cheaper model for routine agents. Claude Code's guidance suggests Sonnet for teammates and `model: haiku` for simple subagents.
- Keep prompts specific so agents do not scan the whole repo.
- Shut agents down when their task is done; idle teammates keep consuming tokens.
- Watch organization rate limits. Claude Code's docs give per-user TPM and RPM recommendations by team size for API organizations; ten agents from one person can behave like ten users.

## 2. Disk, setup time and worktree limits

Isolating each agent in its own git worktree is standard advice, and at ten agents it has real costs. Each worktree is a full checkout of tracked files, and dependencies (`node_modules`, virtual environments, build caches) are usually per worktree. Gitignored files such as `.env` are not copied.

Fixes:

- Script setup. Claude Code copies gitignored files listed in `.worktreeinclude` into each worktree it creates; Cursor runs commands from `.cursor/worktrees.json` (`setup-worktree`, `setup-worktree-unix`, `setup-worktree-windows`) in each new worktree.
- Clean up. Cursor caps worktrees at 25 per machine by default and cleans older ones automatically; Claude Code removes clean worktrees on exit and sweeps old subagent worktrees. `git worktree list` and `git worktree remove` handle the rest.
- Use a package manager with a shared store, or sparse checkouts, if disk is the constraint.

## 3. Shared local resources

Ten agents that each run `npm run dev` all want port 3000. Ten test suites that share one local database corrupt each other's fixtures. These failures look like flaky tests and waste agent turns.

Fixes: give each agent an index and derive resources from it (`PORT=$((3000 + N))`, database name `app_test_$N`), pass them through the worktree setup script or the session environment (Cursor's `sessionStart` hook can return `env`), and prefer test setups that create and drop their own database.

## 4. Git races at landing time

When ten agents push to one branch, most pushes fail as non-fast-forward because someone else landed first. Each agent then fetches, rebases, maybe skips the test rerun, and tries again. That retry loop costs model turns and is where green branches produce a red main.

Fixes: give agents a landing script that loops fetch, rebase, test and push (see our guide on landing agent changes in one step), enforce it with a `pre-push` hook, or have agents open pull requests and merge through a merge queue that retests each change on top of the ones ahead of it. Turn on `git config rerere.enabled true` so repeated conflict resolutions are reused.

## 5. Agents colliding on the same code

This is the problem that grows fastest. With 2 agents there is 1 pair that can conflict; with 10 there are 45; with 20 there are 190. Worktrees prevent agents overwriting each other's files on disk, but they do not prevent:

- two agents changing the same function in different directions,
- one agent renaming a helper while three others add calls to the old name,
- two agents adding a migration with the same number,
- each agent re-reading the same files to learn what another agent already found.

Fixes, from simplest to most complete:

- **Partition work** by directory or package so tasks rarely overlap. Claude Code's agent teams docs recommend each teammate owns a different set of files.
- **Claim before editing.** A shared record of who is changing what, checked by a pre-edit hook (Claude Code, Codex and Cursor all support blocking an edit from a hook).
- **Tell agents what changed.** Messages between sessions (Claude Code's cross-session messaging) or a briefing hook at session start and on each prompt.
- **A [coordination layer](https://corkcli.com/blog/coordination-layer-ai-coding-agents)** that does all of this at the level of functions, across tools and machines.

## 6. Review load

Ten agents can open more pull requests in a day than one person can review well. Fixes: one concern per pull request, required automated checks, CODEOWNERS to route reviews, an AI review pass as a filter, and reviewing pull requests that touch the same files together rather than in arrival order.

## A checklist before you scale up

- A token budget per agent and a cheaper default model.
- A worktree setup script that installs dependencies and assigns ports and databases.
- One landing command, enforced by a hook.
- A way for agents to know what the others are changing.
- Small tasks with a clear "done" and a test that proves it.
- A cleanup step for worktrees and idle sessions.

## How Cork helps

Cork targets problems 4 and 5. With its hooks in Claude Code, Codex and Cursor (no extra model calls), each agent is briefed on the exact signatures, callers and recent changes of the code it is about to touch; when another agent changes code yours depends on, your agent hears it on its next step; a write gate holds an edit against code another agent is changing right now until your agent has their version; a teammate's rename or signature change becomes a [semantic lint](https://corkcli.com/blog/semantic-lint) rule; and `git push` becomes one step that rebases onto teammates' commits, reruns the tests and pushes. In Cork's published benchmark (12 Claude Code agents at once on one repository, hard tasks), agents with Cork used 53% fewer tokens than the same agents without it.

Cork is the coordination layer for [multiplayer coding agents](https://corkcli.com/blog/multiplayer-coding-agents): it keeps Claude Code, Codex and Cursor agents, on one machine or across a team's machines, from overwriting each other on one codebase, and hands each agent what the others already learned.

Cork Free supports unlimited agents and repos on one machine; the paid plan adds teammates' machines. Cork does not run agents or provide machines, so problems 1 to 3 stay with your setup.

```bash
curl -fsSL https://corkcli.com/install.sh | sh
```

## Frequently asked questions

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

There is no single limit. The practical limits are usage and rate limits, machine resources, and how much coordination and review you can absorb. Claude Code suggests 3 to 5 teammates as a starting point for agent teams.

### Do more agents finish work faster?

Only when the tasks are independent. Coordination overhead grows with every agent, and past a point extra agents add conflicts and review load faster than they add throughput.

### Why do my tests become flaky with many agents?

Usually shared local resources: the same port, the same database, or the same cache. Give each agent its own.

### Are worktrees enough for 10 agents?

They isolate files on disk. You still need a landing routine and a way for agents to know what the others are changing.

## Sources

- <https://code.claude.com/docs/en/costs>
- <https://code.claude.com/docs/en/agent-teams>
- <https://code.claude.com/docs/en/worktrees>
- <https://code.claude.com/docs/en/cross-session-messaging>
- <https://www.anthropic.com/engineering/multi-agent-research-system>
- <https://cursor.com/docs/configuration/worktrees>
- <https://cursor.com/docs/agent/hooks>
- <https://learn.chatgpt.com/docs/hooks>
- <https://git-scm.com/docs/git-worktree>
- <https://git-scm.com/docs/git-rerere>

## Related reading

- [Running AI coding agents in a monorepo: what to watch for](https://corkcli.com/blog/ai-coding-agents-monorepo): What breaks when AI coding agents work in a monorepo: instruction files, context size, shared packages, affected tests and parallel agents, with fixes for each.
- [Parallel AI coding agents: running several agents on one codebase at once](https://corkcli.com/blog/parallel-ai-coding-agents): Parallel AI coding agents are several coding agents working on one repository at the same time, each on its own task, to finish more work in less time.
- [Blast radius: how to know what a code change breaks before you make it](https://corkcli.com/blog/blast-radius-code-change): Find a code change's blast radius before you make it: callers via LSP and git grep, dependents with Nx or Turborepo, history, tests, and teammates' work.
- [Setting up Claude Code multi-agent work on Windows (Git Bash and PowerShell)](https://corkcli.com/blog/claude-code-multi-agent-windows-setup): Run several Claude Code agents on Windows: install, Git Bash vs PowerShell, worktrees, hooks in either shell, agent teams, messaging and WSL, per the docs.

[All articles](https://corkcli.com/blog.md) · [Cork in Markdown](https://corkcli.com/index.md) · [llms.txt](https://corkcli.com/llms.txt)

This page in HTML: https://corkcli.com/blog/run-10-coding-agents-at-once
