When Two AI Coding Agents Disagree, Do This
Disagreement is information, and it usually tells you something about your brief rather than your code. A triage order that beats running a third agent.
You ask two AI coding agents the same question and they disagree, giving two different answers. One says the bug is in the retry logic, the other says it is in the connection pool. Both sound certain. The temptation is to pick the more convincing one, or to run a third agent as a tie-breaker.
Both of those are guesses. Disagreement is information, and what it usually tells you is something about your request rather than about the code.
When two AI coding agents disagree, classify it first
Three kinds, and they need different responses. Work out which one you have before doing anything else.
Different answers to different questions. The agents did not actually receive the same task. One read the file you meant, the other searched and found a similarly named file in a different module. One assumed the production config, the other the local one. This is the most common case by a wide margin and it is not really disagreement at all.
Check first: what did each agent actually look at? If one read three files and the other read eleven, you do not have a disagreement about the answer, you have two answers to two different questions.
Same question, different valid answers. Both are correct. There are two ways to fix this and they trade off differently. An agent asked to "fix the slow query" might add an index or restructure the query, and both work. This is not a problem to resolve, it is a decision you have to make, and the agents have just done the work of surfacing the options.
Same question, one is wrong. The genuinely useful case and the rarest. One agent has misread the code, invented an API, or reasoned from a stale assumption.
Make them show evidence, not confidence
The fastest way to tell these apart is to stop asking for conclusions and start asking for the trail.
Go back to each agent separately and ask the same thing:
Which files did you read to reach that conclusion?
Quote the specific lines that support it.
What would have to be true for your answer to be wrong?That third question is the one that does the work. An agent with a sound reading will name a concrete condition: "if the pool size were above 20 this would not be the bottleneck". An agent that pattern-matched will produce something vague, or restate its conclusion in different words.
Quoted lines break the tie faster than argument does, because a quote is checkable in a few seconds. An agent that cannot quote the code it is describing has usually inferred it.
Do not put the two agents in conversation with each other to resolve it. Models tend toward agreement under social pressure, so what you get is convergence rather than correctness, and often the more confidently phrased answer wins regardless of whether it is right. You end up with one answer and no more evidence than you started with.
Then go to the code
Once you have the evidence trails, the disagreement usually resolves without a third opinion:
Read the lines each one quoted. This is often enough on its own.
If they quoted different files, work out which is actually in the execution path. A disagreement about dead code is not a disagreement.
If both quoted the same lines and read them differently, run something. Add a log line, write a failing test, print the value in question. One round of evidence beats three rounds of opinion.
If they disagree about behaviour under load or concurrency, neither can be trusted from reading alone. That class of question is not answerable by inspection.
What the disagreement tells you about your prompt
Persistent disagreement across agents is a signal about the brief, and it is worth acting on because the same ambiguity is probably costing you elsewhere.
If two agents consistently diverge on your codebase, one of these is usually true. The task was underspecified, so each one filled the gap differently. There is no stated convention, so both invented a reasonable one. Or the relevant context was not in either context window, and both inferred from what they could see.
The fix is upstream. Acceptance criteria remove the first case. A written convention removes the second. Pointing agents at the right files removes the third.
A quick diagnostic: give the same task to the same agent twice, in fresh sessions. If one agent disagrees with itself, the brief is ambiguous and no amount of cross-checking will fix it.
When to deliberately use disagreement
Two agents on one question is wasteful as a default and valuable in specific places.
It earns its cost on decisions that are expensive to reverse: a schema change, an auth model, anything touching money. Running two independent reads and comparing them is cheap insurance when the fix costs a week.
It is also useful as a review pattern rather than an authoring one. One agent writes, a second reviews without seeing the first one's reasoning. That is genuinely independent, which two agents given the same authoring task are not.
What it is not good for is routine work. If you are running everything twice, you have doubled your cost to catch a disagreement rate that is probably low, and you still have to adjudicate every conflict yourself.
Related
Running multiple AI coding agents in parallel covers the mechanics of getting two going at once. Reviewing an agent plan before it runs catches most disagreements before any code is written, which is cheaper than resolving them after. Handing off a task between agents covers what context has to travel with the work, and our AI coding tools guide covers the wider setup.
Questions people ask
Should I use a third agent to break the tie?
No. A third opinion with no new evidence is another guess. Ask the first two for their evidence instead, then check the code.
Why do two agents reach different conclusions on the same code?
Usually because they read different files or made different assumptions about configuration. Genuine disagreement about identical evidence is less common than it looks.
Can I ask agents to debate until they agree?
You can, and they usually will agree, which is the problem. Models converge under pressure toward the more confidently stated position rather than the correct one.
Does disagreement mean one agent is worse?
Not necessarily. It more often means the task was underspecified. Test this by giving the same agent the same task twice in fresh sessions.
Is it worth running two agents on every task?
No. Reserve it for changes that are expensive to reverse, such as schema migrations, auth changes and anything handling payments.
How did this land?
About the author

Staff Engineer, Platform
Carlo works on the platform that turns prompts into running apps. He writes the engineering deep dives and the changelog notes worth reading.


