TL;DR
Throwing more LLM agents at a coding project doesn’t automatically make it faster or better—just like human software teams, poorly organized agents drown in communication overhead and conflicting code. This paper treats multi-agent coding as a classic distributed computing problem, grouping tightly coupled files together so agents rarely have to interrupt each other. The resulting system, Co-Coder, writes better code up to 3.13× faster and at 42% lower cost than a single agent working alone.
What Problem Does This Paper Address?
If one LLM agent can write code, surely ten agents working in parallel can build a whole repository ten times faster, right? Surprisingly, recent attempts show the opposite: adding agents often slows things down, inflates API bills, and breaks the code.
The authors point out that this isn't a weird quirk of LLMs—it’s the communication-to-computation trade-off, a foundational rule from forty years of distributed computing. Every time Agent A works on a file that depends on Agent B’s file, they have to share context tokens. If you split tightly coupled files across different agents, those agents spend all their time waiting on peers, re-reading updated states, or hallucinating incompatible interfaces. Prior multi-agent frameworks focused on how agents talk to each other, largely ignoring the structural question of how to divide the work in the first place.
Methods
To balance parallel speed against coordination costs, the authors introduce Cohesion-aware Coder (Co-Coder), an orchestrator that plans who does what before a single line of code is written:
- Graph Construction: An LLM reads project specs (like UML diagrams and requirements) to generate a Repository Interface Blueprint—an outline of every file, the symbols (classes, functions) it defines, and what it imports. This becomes a directed graph where node weights estimate file generation time and edge weights measure how heavily two files share symbols.
- Cohesion-Based Partitioning: Standard graph-clustering chokes on codebases because of "hub" files. Co-Coder first isolates in-hubs (shared utilities/constants imported everywhere) into solo tasks and groups out-hubs (top-level entry points) together so they don't bottleneck everyone else. It then runs Infomap—a random-walk community detection algorithm—to cluster tightly coupled files onto the same agent. Finally, it peels off independent "leaf" files inside clusters so they can run in parallel.
- Dependency-Aware Execution: Instead of making all agents pause at rigid step-by-step barriers, Co-Coder uses a classic greedy list-scheduler. As soon as a file’s upstream dependencies finish, its task flips from
pendingtoreadyfor its assigned agent, followed by a centralized test-and-repair loop led by a single leader agent.
Datasets
No training datasets are used. The authors evaluate from-scratch repository generation across two existing Python benchmarks (no new benchmarks are introduced):
- DevEval (Python subset): 10 compact, self-contained projects averaging 3.1 files and 243 lines of code (LOC).
- CodeProjectEval: 18 complex projects curated from real open-source libraries, averaging 11.9 files and 2,371 LOC with deep cross-file dependencies. (A small appendix test also checks 1 C++ and 1 Java project).
Key Insights and Ideas
- Brooks's Law applies to AI: Naively assigning one agent per file (File-based Parallel) causes agents to invent conflicting interfaces, leading to expensive regeneration loops. Conversely, letting agents self-organize (Claude Code w/ Agent Teams) finishes quickly, but code quality tanks below that of a single sequential agent.
- Complexity amplifies the payoff: On tiny, loosely connected projects, almost any setup works. Across CodeProjectEval, the denser a project's import graph ($|E|/|V|$), the bigger Co-Coder’s accuracy jump over sequential coding ($r = 0.65$). Keeping coupled files inside one agent's context window prevents interface mismatches before they happen.
- Smarter base models still need structure: Upgrading from GPT-5 Mini to Claude Sonnet 4.6 makes a single sequential agent much stronger, causing uncoordinated parallel baselines to look even worse by comparison. Yet Co-Coder still beats the stronger sequential agent while stretching its speedup even further.
Key Results
Evaluated across 28 tasks using both GPT-5 Mini and Claude Sonnet 4.6, Co-Coder advances the Pareto frontier—improving test pass rates, wall-clock speed, and API cost simultaneously:
- Vs. Sequential Single Agent: On CodeProjectEval, Co-Coder boosts unit test pass rates from 20.1% to 34.1% (GPT-5 Mini) and from 34.0% to 39.4% (Claude Sonnet 4.6), while running 2.10× to 3.13× faster and cutting API costs by 35% to 42%.
- Vs. Naive File-Parallel: File-based parallelism inflates API costs by up to 60% on CodeProjectEval for minimal accuracy gains; Co-Coder beats its pass rate by up to 10.8% at less than half the cost.
- Vs. Claude Code w/ Agent Teams: Co-Coder improves pass rates by 9.8% to 17.8% across benchmarks, while running up to 1.41× faster (on CodeProjectEval with Sonnet 4.6) and up to 22% cheaper.
Limitations and Future Work
- Heuristic cost proxies: Node and edge weights rely on interface size and symbol overlap rather than exact runtime or token measurements, meaning the system optimizes an approximation of the true objective.
- Pre-defined file layouts: Both benchmarks supply the target file tree upfront. While Co-Coder could theoretically sit downstream of an architecture-planning agent in open-ended tasks, that combination remains untested here.
- Language scope & tiny repos: Main results are restricted to Python (with only two C++/Java tasks in the appendix). Furthermore, when a repository has only one or two files with no parallelizable structure (4 of the 28 tasks), Co-Coder naturally reduces to a single sequential agent.
Summary updated