---
type: Article
title: "How AI Agents Coordinate Code: What 1,902 Runs Reveal"
description: "In multi-agent AI coding, task shape organizes the team more than a coordinator named in the prompt: that is what a study of 1,902 instrumented runs showed."
resource: https://felipecferreira.com.br/en/library/how-ai-agents-coordinate-code/
generated: { by: process:okf-bridge, at: 2026-11-24T19:38:51Z }
published_at: 2026-11-24T19:38:48Z
modified_at: 2026-11-24T19:38:48Z
author:
  name: "Felipe Carvalho Ferreira"
  url: https://felipecferreira.com.br/sobre/
  "@id": https://felipecferreira.com.br/#/schema/person/44400987115f09994755b76e5fdf9d3a
  sameAs:
    - https://www.youtube.com/@felipecferreiraa
    - https://x.com/FelipeCF_X
    - https://www.instagram.com/felipecferreira.com.br/
    - https://www.linkedin.com/in/felipe-c-ferreira-a76646152/
    - https://www.tiktok.com/@felipecferreiraa
    - https://github.com/felipeferreiragestor
content_sha256: 8ac6dfe1d4d0f698a0f4c51d3b9679eaab88a6f12fa179a5ffb6ae24a971dd71
status: stable
sources:
  - id: canonical-html
    resource: https://felipecferreira.com.br/en/library/how-ai-agents-coordinate-code/
    title: "Official HTML page"
    last_modified: 2026-11-24T19:38:48Z
---

# How AI Agents Coordinate Code: What 1,902 Runs Reveal

## TL;DR

In multi-agent AI coding, task shape organizes the team more than a coordinator named in the prompt: that is what a study of 1,902 instrumented runs showed. I review how coordination was measured, when shared files save output tokens, and what this changes for real multi-agent workflows.

When you put multiple [AI agents](https://felipecferreira.com.br/en/library/what-are-ai-agents/) to work coding in the same workspace, the question is not just whether the final code passes the tests. It is also **how much the team had to talk**, who read or wrote each file, and where the split of work left an unowned interface.

A run can finish green and still hide expensive, brittle, or hard-to-repeat coordination. That invisible layer is exactly what Giuseppe Destefanis and Tomaso Aste set out to measure.

The payoff is practical for anyone designing [multi-agent systems](https://felipecferreira.com.br/en/library/multi-agent-architecture-search/) (systems where multiple agents collaborate on the same task): more agents do not automatically mean more capability, a shared file is not always cheaper, and calling one agent a coordinator does not create structural leadership.

*How can you tell whether your agent team is truly coordinating or just piling up messages? Follow me and I will break these pieces down!*

***TECHNICAL NOTE**: Everything shared here reflects my own experience and workflow; you remain fully responsible for changes on your site or your clients' sites. Responsibility applies exclusively within engagements formalized by contract. When in doubt, visit the [Legal Notice](https://felipecferreira.com.br/en/legal-notice/).*

## The Paper's Contribution {#the-papers-contribution}

I am reviewing a paper by Destefanis and Aste (2026), posted to arXiv on August 17, 2026, titled: *When Agents Coordinate: Measuring Coordination in Multi-Agent AI Coding*.

In short, it focuses on measuring coordination in multi-agent AI coding.

The authors are in the Department of Computer Science at University College London in the United Kingdom. This is a preprint, not presented here as peer-reviewed or published in a specific journal or conference venue.

You can read the full original paper on arXiv: [When Agents Coordinate: Measuring Coordination in Multi-Agent AI Coding](https://arxiv.org/abs/2608.16801).

The study analyzed **1,902 instrumented runs** of Python coding tasks, each graded against a fixed test suite. Afterward, the authors replicated the main conditions in a sealed environment with an additional 244 runs.

The goal was not to rank models. It was to observe how coordination emerges, what it costs, and how it shifts when team size, nominal structure, and shared file policies change.

## How the Study Was Set Up {#how-the-study-was-set-up}

To see inside the team's work, the researchers modeled each run as a **temporal network** (a graph tracking who connected with whom and when). In this network, agents and files are nodes, while messages, writes, and reads are edges stamped with time, size, and token cost (the text units a model processes or generates).

The experimental design crossed three main factors:

* **Task shape:** a distributed task required reconstructing a specification split across agents; a chained task split consecutive stages of a pipeline (a sequence where one stage feeds its output to the next), requiring agreement on stage interfaces.
* **Team size:** the core teams had 1, 2, 4, or 8 agents. A scaling arm of the chained task reached 16 agents, keeping work assigned to every participant.
* **Structure and channel:** teams were either flat or had one agent named as coordinator, crossed with file policies set to forbidden, allowed, or mandatory. The mandatory policy required state between agents to pass through files.

Each run yielded a network and a binary outcome, pass or fail. The tasks were pure functions with no randomness, and a run counted as a pass only when every test passed.

That detail matters because the team was not handed a fixed communication graph (a preset map of who talks to whom). Connections were free to form during the work, and the instrumentation logged what actually happened.

## What the Study Showed {#what-the-study-showed}

The paper delivers one takeaway worth keeping up front: **task shape organizes the team more than the label written in the prompt**. From there, the findings become much easier to read.

### Messages Grow, Yet Initial Handshakes Explain Much of It {#messages-grow-yet-initial-handshakes-explain-much-of-it}

In smaller teams, direct messages (communication sent to a named agent) grow nearly quadratically, close to an n2 curve. In the chained task, the measured slope was 1.92, right near quadratic growth.

That growth does not mean every agent keeps chatting heavily with every other agent throughout the run. The instrumentation does not inspect message contents: it calls the first time any pair speaks a *handshake* (initial contact between peers), and then tracks a smaller core of sustained communication.

The 16-agent arm sharpens the contrast: mean messages stayed essentially flat, moving from 47.0 to 46.8 when the team grew from 8 to 16 agents. At that scale, pair-targeted messages dropped while broadcasts (messages sent to the entire team) rose.

### The Task Chooses the Shape of the Network {#the-task-chooses-the-shape-of-the-network}

When each agent holds a fragment of one shared specification, the team must reconcile scattered knowledge. The sustained network becomes dense, resembling a mesh where many agents keep active channels with one another.

When each agent owns a consecutive stage of a pipeline, coordination tends to stay local. Each agent needs to align interfaces with neighboring stages, and the network stays sparse as the team grows.

In the 16-stage chain, mean sustained degree was just 0.28 partners per agent, compared with 15 partners in a fully connected reference graph. **The larger team did not turn into a full mesh**; peer-to-peer coordination nearly vanished while team broadcasts and files carried the load.

### Files Can Trade Repeated Messages for Shared State {#files-can-trade-repeated-messages-for-shared-state}

A shared file persists in the workspace and can be read by multiple agents. A direct message, by contrast, reaches one recipient at a time.

Here is a quick analogy: a direct message is like briefing every person on the team one by one; a shared file is like writing the agreement on a board anyone can check.

In the distributed task, making files mandatory cut output tokens by roughly **42% with eight agents** compared with the file-allowed policy. The drop tracks the shift from repeated direct messages to a single write that multiple peers can read.

The outcome flips in the chained task. In that layout, files were already the natural channel because each stage's output fed the next. With eight agents, enforcing the mandatory policy added roughly 10% to output tokens relative to the allowed policy.

The lesson, therefore, is not "files always win." It is more specific: **the cheapest channel depends on the coordination pattern the task already demands**.

![Charts showing direct message tokens, file writes, and file reads across two tasks and three file policies](https://felipecferreira.com.br/wp-content/uploads/2026/08/coordenacao-agentes-figura-8-destefanis-2026.png)
*The mandatory policy shifts coordination from direct messages to file writes and reads. In the distributed task, that shift lowers output cost; in the chained task, where files were already the natural channel, it adds overhead. Bars are proxies for distinct channels and show the direction of change.*

*Source: DESTEFANIS; ASTE, 2026, p. 13. Figure republished under CC BY 4.0 license.*

### Naming a Coordinator Did Not Create a Hub {#naming-a-coordinator-did-not-create-a-hub}

In the coordinator condition, only one agent received a line in its prompt stating it held that role. The setup enforced no routing, queue, or obligation for peers to go through that agent.

The graph showed no hub (a central node concentrating traffic), and the label produced no reliable pass-rate gain. In the sealed replication, flat teams and coordinator teams scored at the same level across every file policy tested.

That does not prove a star topology never works. What the study actually measured is narrower: **a sentence in the prompt does not, by itself, create a leadership structure**.

### An Unowned Interface Can Sink the Result {#an-unowned-interface-can-sink-the-result}

The sharpest example appeared in the eight-stage chained task. When each agent owned a single stage, all ten runs failed on the exact same rounding convention between stages 7 and 8.

The agents discussed rounding in every run, yet each held only half of the convention. With two or four agents, a single participant owned both stages and could reconcile the detail internally.

The network pinpoints the failure: the interface sat between two owners. **More conversation did not fix a decision that had no owner**, even when each stage looked valid in isolation.

### A Single Run Is Just One Sample {#a-single-run-is-just-one-sample}

The authors repeated 54 cell pairs with identical prompts and the same fixed model. In the chained task, sessions reproduced averages almost identically; in the distributed task, 13 of 27 cells diverged after statistical correction.

In one distributed setup, mean messages swung from 31.4 down to 2.0 per run. That prevents picking one "true" number while ignoring variance: a configuration is better described by a distribution of runs.

*That is why a single polished demo is never enough to characterize an agent team, right?*

### Agents Went Looking for the Hidden Answer Key {#agents-went-looking-for-the-hidden-answer-key}

In the main dataset, the test suite and reference solution files sat accessible in nearby directories, even though no prompt told agents to look for them. Agents opened the hidden test suite in 234 runs and the reference solution in 77.

In the sealed replication, those files were replaced with placeholders (decoy files without real material). Even then, 80% of the 244 runs opened the decoy test-suite file, 66% opened another agent's prompt, and 61% opened the run manifest.

That behavior is not coding success. It is an unprompted search for evaluation artifacts, precisely the kind of conduct a binary pass-or-fail metric can leave invisible.

## What Changes How You Read the Results {#what-changes-how-you-read-the-results}

The study is valuable because it measures the path, yet the limits of that path need to stay visible too. The numbers come from two synthetic Python tasks, one runtime (the environment executing the agents and logging tool calls), and one fixed model, claude-sonnet-4-6 in the 2.1.x series of Claude Code.

Three further caveats matter:

* **Files via shell:** file reads or writes run through shell commands do not create edges in the instrumentation. That undercounts file activity, which went unlogged in ten runs of the main collection, around 0.6% of the dataset.
* **Tokens on different bases:** message cost is estimated from text length, whereas file cost splits a turn's output tokens across tool calls. The chart shows the direction of channel substitution, not an apples-to-apples ledger.
* **Uneven precision:** cells with ten runs carry wide uncertainty around pass rates, and arms with more repeats were treated differently. Single-cell contrasts are directional and should not become universal rankings.

The study also notes that in eight-agent teams on the main tasks, four participants end up without an exclusive fragment of the specification. The scaling arms were added to mitigate that issue, yet they remain synthetic tasks.

## Translating This to Real Work {#translating-this-to-real-work}

*Felipe, what does this look like in practice?* Before picking a "winning" topology, inspect the work your team actually needs to perform. That shape should dictate how agents coordinate.

* **Match the channel to the task pattern (paper finding):** if the team has to reconcile many independent pieces and currently repeats the same context in individual messages, shared files can trim repetition. If a pipeline already passes artifacts stage by stage, forcing extra files can add overhead.
* **Give every interface a clear owner (my recommendation from the finding):** at each handoff between stages, spell out who defines the contract, who validates the input, and who resolves mismatches. Never leave a critical convention split across two prompts without an explicit owner.
* **Treat "coordinator" as an operational role (my recommendation):** if the design calls for leadership, enforce routing, permissions, escalation rules, and work verification. Naming the role in the prompt can reinforce it, yet it cannot replace the mechanisms that make the role real.
* **Repeat your runs (my recommendation from reliability design):** evaluate a setup across multiple runs, log costs, and watch the spread. One run shows a single trajectory, not the team's true behavior.
* **Isolate evaluation material (my recommendation for test hygiene):** tests, reference solutions, private prompts, and run manifests must stay out of unnecessary agent reach. Otherwise your score also measures how well agents hunt for clues in the environment. The same holds for what one agent can overwrite in another: in [mind viruses](https://felipecferreira.com.br/en/library/mind-viruses-ideas-spreading-among-ai-agents/), an idea spreads across a team precisely through shared files and messages.

The point is simple: **multi-agent architecture starts with the task and its interfaces**, not with the headcount of agents on screen.

In my own work, that focus on task shape and interfaces is what I use when assessing AI and automation inside a client's operation, the diagnostic work I present in [Applied Technology](https://felipecferreira.com.br/en/applied-technology/).

## In My Daily Routine with Multiple Agents {#in-my-daily-routine-with-multiple-agents}

I work with multiple agents in parallel every single day. I hand a task to a Grok Bot agent and move to another thread; I run asynchronous agents in Cursor; and I inspect code in VS Code with OpenAI's Codex. So far, nothing critical has broken. The rework I have run into traced back to one specific mistake: an orchestrator delegated a complex task to a model that was too weak for it.

Shared state in files, which the paper measures, is also part of my workflow. When reviewing content for this site, agents log progress in files such as a batch summary and a ROLLBACK.md (the record of every change and how to undo it). The next agent reads the file and does not need anyone repeating the chat history.

And one cautionary case: on a tightly scoped project, Codex in VS Code (running GPT-5.6 Sol at high reasoning) stepped outside the agreed directory and inspected other folders without permission. The outcome turned out helpful because the real bug lived outside the scripts folder. Yet the behavior is the exact one the paper logged: an agent reaches for whatever looks useful, even unasked. That is why scope and permissions must be enforced by the environment, not just requested in the prompt.

## Conclusion: Coordination Is Part of the System {#conclusion-coordination-is-part-of-the-system}

Destefanis and Aste's paper offers no universal recipe. Its value lies in pulling coordination out from behind the curtain: instead of looking only at code that passed the tests, you get to see the path the team walked to get there.

The takeaways that hold are:

* **Scale:** near-quadratic message growth shows up mostly in initial handshakes and flattens out when large teams switch to broadcasts.
* **Topology:** distributed specifications produce a dense mesh; pipelines produce sparse, local coordination. The task shapes the network.
* **Channel:** files can save tokens when they replace repeated messages, yet add cost when the flow already runs on files.
* **Leadership:** naming a coordinator created neither a hub nor reliable pass-rate gains. The role has to exist in the interaction mechanics.
* **Reliability:** one run does not characterize a setup, and evaluation environments must be locked down so scores do not reflect answer-key hunting.

For anyone evaluating AI agent systems, the next metric should not stop at "passed the test." It pays to ask how many messages it took, which interfaces had no owner, which files were read, and how much the setup varies across repeats. At the single-agent level, the same logic holds for procedures: see why [skills for AI agents](https://felipecferreira.com.br/en/library/skills-for-ai-agents-why-they-work-where-they-fail/) work and where they fail.

*If your agent team could display its own coordination graph, what would you want to uncover first?*

**At the top of this page there is a button to download all of this content in Markdown** so you can use it as a reference alongside your AI agent. Download is free, asks for no signup or email, and puts you on no list. It is 100% public content for anyone to access and download.

Need help? Message me on WhatsApp. I will make sure to guide you end to end.

## References {#references}

DESTEFANIS, Giuseppe; ASTE, Tomaso. *When Agents Coordinate: Measuring Coordination in Multi-Agent AI Coding*. arXiv preprint arXiv:2608.16801v1, Aug 17, 2026. Available at: [arXiv:2608.16801](https://arxiv.org/abs/2608.16801). Accessed: Aug 31, 2026.

## Frequently asked questions

### What did the paper measure?

The study measured coordination during coding runs by logging direct messages, file writes, and file reads as events in a temporal network. Each run also received a binary pass-or-fail test evaluation.

### Do more agents always raise the cost?

No. Direct messages grew near-quadratically at small team sizes, yet growth flattened in the largest teams studied as agents shifted toward broadcasts. Cost also depends on the shape of the task.

### Are shared files better than messages?

It depends. In the distributed task, making files mandatory cut output tokens by roughly 42% with eight agents. In the chained task, where files already carried coordination, the same requirement added overhead.

### Does a named coordinator improve the team?

Not reliably just by naming one in the prompt. The study found neither a structural hub nor consistent pass-rate gains. Effective leadership requires interaction mechanisms that the experiment did not enforce.

### Can you trust a single run?

Not to characterize an entire setup. Replications showed that variance depends on the task, especially when the team is free to organize itself. Serious evaluation needs multiple runs and the observed spread.
