I made Claude and Codex argue, and judge each other blind
When I ask a model “should we do X?”, I get a tidy list of pros and cons. It sounds balanced, but it’s one model’s view, written to sound balanced. If the model leans one way, the list leans with it, and I can’t tell.
So I built Agent Tug of War. Claude argues one side of a question, Codex argues the other, and both of them judge every round without knowing which model wrote which argument. At the end you get a decision record: the strongest case for each side, the open risks, and a recommendation.
What it does
You give tug a motion, a statement one side defends and the other attacks, and optionally some material to argue from:
tug "This PR is safe to merge" --diff main --out review.md
tug "We should adopt this RFC" -c docs/rfc-042.md -r 8
tug "A hot dog is a sandwich" -r 3- Real opposition. Claude argues FOR and Codex argues AGAINST (
--swapflips them). Each has to rebut the other’s latest point, not just restate its own. - Blind judging. Both models judge every round from two arguments labelled only A and B, in random order. Each judge’s bias towards its own style pulls against the other’s.
- A record you can act on. The match ends in Markdown you can keep: summary, strongest case for each side, risks, recommendation, scoreboard and full transcript.
- Grounded in your material. Files, folders, a
git diffor piped text become shared context, so both sides argue about your actual code or document.
How a match works
It really is a tug of war. A rope sits in the middle, and each round pulls it one way.
- FOR makes a point, then AGAINST rebuts it. Both see the context and the recent rounds.
- Both models judge the round blind, in parallel. Each gives it to one side with a pull of 1 (narrow), 2 (clear) or 3 (knockout).
- The two pulls are averaged. If the judges disagree, the rope barely moves. A side only gains ground when both judges see it.
- First to pull the flag over their line wins (6 notches by default). If the rounds run out first, the side ahead wins.
- A neutral pass writes the decision record from the whole transcript. It treats the result as evidence, not a verdict to obey.
In the terminal you watch the rope move round by round, with a scoreboard at the end showing rounds won, how often the judges agreed, and the round with the biggest pull.
What I use it for
| Question | Command |
|---|---|
| Is this PR safe? | tug "This PR is safe to merge" --diff main |
| Should we adopt this design? | tug "We should adopt this RFC" -c docs/rfc.md |
| Rewrite or refactor? | tug "We should rewrite billing in Go" -c services/billing |
| Is my draft convincing? | cat essay.md | tug "This essay makes its case" -c - |
| A personal decision | tug "I should take the Berlin offer" -c notes.md --swap |
The most useful part is rarely the winner. It’s the “strongest case AGAINST” section on a plan I already liked, and the risks that neither side managed to close.
Use it inside Claude Code or Codex
The repo includes a SKILL.md, so it also works as an agent skill. Link the folder into each tool’s skills directory:
ln -s "$PWD" ~/.claude/skills/tug-of-war
ln -s "$PWD" ~/.codex/skills/tug-of-warThen ask in plain English: “Should we switch to pnpm? Run a tug of war on it.” The agent phrases the motion, picks the relevant files as context, runs a short match and answers in a consistent format: the result, a small rope diagram, the best point from each side, a recommendation, and what’s still open.
A CI gate, too
tug exits with 0 when FOR wins, 10 when AGAINST wins and 11 for a draw. That makes it usable as a second opinion in a pipeline:
tug "This change is safe to ship" --diff origin/main --quiet --fast --out review.md \
|| echo "The case against shipping won. See review.md"Try it
You need Node 18.3 or later, plus the Claude Code and Codex CLIs, both signed in. There are no npm dependencies; it’s one script of about 700 lines.
git clone https://github.com/Jenish109/agent-tug-of-war.git
cd agent-tug-of-war
npm install -g .
tug doctorTo see the interface without any model calls, run node tug.mjs --demo. It uses canned arguments and coin-flip judges.
Fairness and limits
- The second speaker has an edge. AGAINST speaks second and rebuts directly. For decisions that matter, run it again with
--swapand compare. - Short matches are noisy. Two rounds can turn on one good line. Use more rounds when it counts.
- Thin context loses. If the material is missing, the side that points that out tends to win. Give both sides the real files.
- It takes a few minutes. Each round makes four model calls (the two judges run in parallel), and context is capped at 40,000 characters.
Things I learned building it
- Two judges matter more than two debaters. A single model judging tends to favour arguments that sound like its own. Averaging two blind judges from different families cancels a lot of that out.
- Rebuttal is the forcing function. Making each side answer the other’s latest point, in a word limit, stops both models from writing parallel essays.
- The record is the product. A debate is fun to watch once. A Markdown file with the strongest case on each side is something you can attach to a PR or send to a colleague.
The code is MIT-licensed on GitHub. If you run a match on something real, I’d like to hear how it went.
Want something like this for your team?
Agent Tug of War is a small tool that gets two AI agents to check each other’s work. I build custom MCP servers and Claude Code workflows like it for teams, starting at $500.
Tell me what you’d like your agents to do and I’ll reply with what’s worth building.
Prepared with AI assistance using the primary sources linked in the article. Guidance checked on 13 October 2026.