How to Run AI Coding Agents in Parallel

To run coding agents in parallel, give them the same starting commit and tasks that don’t depend on each other. Have each agent return its own files or report, then check the handoffs before combining anything.

This example is for self-hosted SwarmForge. If you want the hosted version, see the invite-only Cloud pilot and confirm your client, costs and setup before running a task.

Try two read-only tasks on the same commit

Use PyPA’s Sample Project at commit 621e4974ca25ce531773def586ba3ed8e736b3fc. Give both workers that exact revision. Start each request with: “Report the checked-out commit. Read the source at that revision and cite the paths you used. Return only the requested handoff. Do not modify repository files, install dependencies, run tests or push commits.” Then add the worker’s assignment below.

Worker Assignment Handoff to request
A Trace the sample command from packaging config to its implementation. entrypoint.md: the command mapping and the code path that implements it.
B Find how CI starts the tests and identify one test that checks behavior. test-map.md: the workflow, test runner configuration and one concrete test case.

Check the handoffs against the source

First, check that both reports name the pinned commit. These are reference findings checked against the pinned source, not saved agent reports. The example doesn’t assert that two agents ran, that CI passed or that parallel execution saved time.

If a report says the tests passed, ask which command ran and where the result is. This task asked for a map, not a test run. If you later ask an agent to modify the entry point and another to document the new behavior, agree on the interface first or sequence the tasks. Separate workers don’t prevent conflicting edits.

Delegate concrete deliverables

From your self-hosted MCP lead client, use spawn_worker with a common task ID and distinct instructions or role labels. Select a built-in code, review or documentation template where useful. Include expected files, constraints and what evidence should accompany the result.

Give each creation request its own stable request ID and use that same ID only when retrying that request. Observe each worker independently; a team-level count alone does not prove the whole feature is ready.

Review and integrate

Inspect persisted results, changed files, test reports, preserved artifacts and configured Git branch handoffs. Verify tests independently before merging. SwarmForge records worker reports and can verify branch pushes; the manager decides whether the result meets the task.

Integration, conflict resolution and pull-request creation remain external workflow steps. Use follow-up messages to request bounded corrections on a retained worker session when appropriate.

Finish without leaving retained infrastructure

Collect deliverables and verify source handoffs before normal cleanup. Completed, paused and failed VMs can consume capacity and provider resources. Preview retention eligibility, inspect refusals and destroy only eligible environments.

Parallelism is a capability, not a claim that every task becomes faster or cheaper. VM startup, model capacity, dependency order, review and interventions must be measured for the actual workload.