Skip to content

Blog

How to run multiple coding agents in parallel without interference

Run several AI coding agents at once without file, port or branch collisions: isolation options, a task split template, and which tools give each agent its own sandbox.

Last updated: November 2026

Short answer: Give every agent its own working copy, its own branch and its own machine resources, and give each one a written list of the files it may change. A cloud sandbox per agent does this for you: Statefold, Cursor Cloud Agents, Codex cloud, Claude Code on the web, Devin and Replicas all run each task or session in its own isolated workspace. To avoid manual handoffs, pick a tool where one agent can start child agents and wait for their results, and where CI results or review comments wake the agent without you.

Which tools run agents in isolated sandboxes?

ToolIsolation unitHow parallel work is started or coordinatedAgents it runs
StatefoldOne sandbox per threadA thread starts child threads and waits for results; GitHub, Linear, schedule and API triggersCodex, Claude Code, OpenCode, Pi, Gemini CLI
Cursor Cloud AgentsIsolated VM per agent"As many agents as you want in parallel"; start from web, Slack, GitHub, Linear or APICursor's curated model list
Codex cloudOwn workspace per taskSeveral tasks start from one published environment with each task's working state kept separateCodex
Claude Code on the webIsolated Anthropic-managed VM per sessionProjects let Claude coordinate parallel cloud sessionsClaude Code
DevinIsolated VM per managed DevinA coordinator session delegates to managed Devins and is woken when a child finishesDevin
ReplicasIsolated Linux VM per workspaceSlack, Linear, GitHub, GitLab, API, schedules, Sentry events and webhooksClaude Code, Codex, Cursor, Gemini, Muse Code, OpenCode, Pi
Northflank Cloud HarnessesmicroVM per HarnessRun different agents side by side or the same task on several agentsClaude Code, Codex, Cursor, OpenCode, Pi, bring your own agent

Where the vendors publish compute and price, the numbers differ more than the isolation does:

ToolMachineBilling
Statefold standard-3 (default)2 vCPU, 8 GiB, 16 GB disk$0.30 per hour, billed per second
Statefold standard-44 vCPU, 12 GiB, 20 GB disk$0.55 per hour
Replicas small2 vCPU, 8 GB$0.004 per minute within the included usage, $0.006 per minute after
Replicas large4 vCPU, 16 GB$0.008 per minute within the included usage, $0.012 per minute after
Claude Code on the webAbout 4 vCPU, 16 GB RAM, 30 GB diskNo separate charge for the VM; sessions count toward Claude plan limits

Model tokens are a separate cost in every row. Statefold and Replicas run on your own subscriptions or API keys, and Statefold never marks them up.

Fair notes on Statefold: it runs five harnesses where Replicas lists seven, and its published triggers are GitHub, Linear, schedules and the API, with no Slack trigger. Statefold does not publish a cap on simultaneous threads on its pricing page or its credits docs. Cursor, Codex, Devin and Replicas do not publish a concurrency cap in the docs linked above either, so confirm your own plan before you plan a 20-agent run.

How do we run multiple AI coding agents at the same time without them interfering?

Isolate three things per agent (working copy, branch, machine resources), split the work so no two agents own the same file, and merge through pull requests and tests instead of letting agents push to the main branch.

Why parallel agents collide

Northflank lists what breaks when several agents share one machine: file conflicts, shared CPU and memory, port collisions, credentials for several model providers, and agents that stop when the laptop sleeps. CircleCI gives two concrete cases: two dev servers that both want port 3000, and two agents seeding and clearing the same local orders table. C# Corner adds that Git detects textual conflicts but "cannot reliably identify every logical or behavioral conflict."

Pick an isolation approach

ApproachWhat is isolatedWhat still collides
Shared working directoryNothingConcurrent edits can overwrite changes
Git worktree per agentFiles and branchPorts, local databases and CPU, because all worktrees run on one machine; node_modules and Python virtual environments are not shared between worktrees
Sandbox or VM per agentFiles, branch, ports, databases, CPU and memoryMerge conflicts at pull request time, and your model provider's usage limits

Git worktrees are the cheapest start. A linked worktree shares everything except per-worktree files such as HEAD and the index, and Git refuses to check out a branch that another worktree already has. The same page says multiple checkout is still experimental and recommends against it for a superproject with submodules.

bash
git worktree add -b feature/order-status-api ../order-status-api main
git worktree add -b feature/order-status-ui ../order-status-ui main
git worktree list
# when an agent is done and its branch is merged
git worktree remove ../order-status-api

A sandbox per agent removes the shared-machine problems. Cursor says cloud agents "run in isolated VMs", and Statefold gives each thread its own container with its own database, Docker daemon and browser, so two threads can both bind port 3000.

A six-step method that works with any tool

  1. Pick independent tasks. CircleCI names good candidates: independent bug fixes in different parts of the codebase, new tests for stable code, documentation updates, and isolated components built against an existing interface. A broad refactor or a shared type change is a poor fit.
  2. Write a task split. One row per agent, with a branch and the paths it owns.
  3. Fix shared contracts first. If two agents depend on one interface, write the type or API contract, merge it, then start the agents.
  4. Give each agent an operating contract and a done condition.
  5. Validate every branch, then the combination. Branches that pass alone can fail together.
  6. Merge one branch at a time.

Task split, adapted from CircleCI's example:

AgentTaskBranchOwns
Agent AAdd GET /api/orders/:id/statusorder-status-apisrc/api/orders/, tests/api/orders/
Agent BBuild an OrderStatus componentorder-status-uisrc/components/order-status/
Agent CAdd integration testsorder-status-teststests/integration/order-status/

Operating contract for Agent A, following the format in Warp's guide:

text
You own src/api/orders/ and tests/api/orders/.
Do not edit src/shared/types/order-status.ts or anything under .circleci/.
Done when the endpoint tests and the linter pass.

Limits to plan for

How do we run multiple AI coding agents in parallel without manual handoffs?

Let one agent split the work and wait for the results, and let events such as a failed CI check wake the right agent, so you only step in to review.

Child agents. In Statefold, a thread can start child threads on any connected harness and model, wait for their results and continue. Each child has its own workspace and history. The parent can wait for up to 8 children for at most 240 seconds per call, and a family of threads is limited to 8 child launches at once and 3 levels of nesting. Files move between threads through saved results and the project source, not through another agent's conversation. You ask in plain words, for example "have Codex review this in a child thread". Devin delegates to managed Devins that each run in an isolated VM and wakes the coordinator when a child finishes. Claude Code on the web coordinates parallel cloud sessions through projects.

Event triggers. Statefold threads wake on a finished CI check, a reviewer comment, an @statefold mention on GitHub, an assigned Linear issue, a weekday schedule or an API call. A thread that opens a pull request, sees CI fail, fixes it and goes back to sleep needs no handoff from you. Cursor starts agents from Slack, GitHub, Linear and its API, and Replicas from Slack, Linear, GitHub, GitLab, Sentry events and webhooks.

Keep a human at the merge. Automation should stop at the pull request. Warp's guidance is blunt: do not merge every agent's output automatically, merge one branch at a time and rerun full validation on the integrated branch. Statefold agents are told to ask before force-pushing or merging, and a thread is Done when its pull request merges.

Running parallel threads on Statefold

  1. Sign in, connect Codex, Claude Code, OpenCode, Pi or Gemini CLI with your own account, and add credits. A GitHub link adds a one-time $3 starter credit, about 10 hours on the default machine.
  2. Start one thread per task in the task split above, from the web app or with the CLI: statefold thread new "Add GET /api/orders/:id/status". The CLI hands off your current checkout, including uncommitted work, without touching your local branch.
  3. Put the ownership rules in each prompt. Every thread starts in its own sandbox on standard-3, so file, port and database collisions between threads do not happen. Conflicts can still appear when branches merge, and Statefold's pull request page sends failing checks, reviews or conflicts back to the thread.
  4. Watch thread status. The statuses are Working, Needs you, Ready to review, Done, Failed and Limited, derived from what is running and linked, not from the agent declaring itself finished.
  5. Review and merge one pull request at a time.

What parallel runs cost. Sandboxes are billed per second while running, and a sleeping thread costs nothing. A sandbox sleeps about ten minutes after the agent goes idle, but a running one uses credits even while the agent waits. Five threads running two hours each on standard-3 use 10 machine hours, 10 x $0.30 = $3.00, which is the value of the starter credit. Plans are $10, $50 or $100 a month and grant their price in credits. Child threads use credits like any thread. See pricing for the full table.

Limits to know: Statefold does not publish a cap on simultaneous top-level threads. Children of one thread are limited to 8 launches at once and 3 levels of nesting, and you should tell each child which branch to use. If a thread runs out of memory you can move it to a bigger machine.

Who should pick which

  • One developer, a laptop, two or three agents: Git worktrees and a task split are enough. Add sandboxes when ports, databases or laptop sleep get in the way.
  • You want one agent to delegate to other agents and keep working overnight: Statefold child threads, Devin managed sessions or Claude Code projects. Statefold is the one that mixes five harnesses in one parent and charges for machine time only.
  • You live in Slack and want the widest list of agents and triggers: Replicas lists seven agents and Slack, Sentry and webhook triggers.
  • You are already on Cursor, ChatGPT or Claude plans: Cursor Cloud Agents need Premium or higher, Teams or Enterprise; Claude Code on the web is included in Pro, Max, Ultra and Team. Both keep you on one vendor's agent. For a feature-by-feature view, read Statefold vs Claude Code on the web.

FAQ

Can I run Claude Code and Codex on the same repository at the same time? Yes, if each has its own branch and working copy. Northflank describes different agents on different tasks, and Statefold runs both side by side.

Do I need Git worktrees if I use cloud sandboxes? No. Each sandbox has its own checkout. You still need separate branches and a task split, because merge conflicts happen at the pull request.

How many agents should I run at once? Start with two or three, per CircleCI, and add more only when you can review and merge quickly. C# Corner: "More agents do not automatically produce faster results."

Do parallel agents multiply my model usage limits? No. Separate sandboxes share your provider account's limits. In Statefold, a thread that hits a provider limit shows Limited with the reset time and Resume options.

What happens when my credits run out? On Statefold, the running turn gets up to 10 more minutes, then the sandbox sleeps and the thread shows Limited. Queued work carries on after a top-up.

Next steps

  1. Write the task split for your next three tasks.
  2. Start a thread on Statefold for each one; the starter credit covers about 10 hours on the default machine.
  3. Review the pull requests one at a time, then try a parent thread that delegates to children.

Back to the Statefold homepage or the pricing page.

Your next thread, shipped while you’re away

$3 of machine time to start. Bring your own subscriptions and keys.

Questions first? Ask in the Statefold Discord.