Two Heads Are Better Than One: Run Many AI Agents, Merge One Auditable Result

syumei1 pts0 comments

Two Heads are Better Than One. Run Many Coding Agents. Merge One Auditable Result. | by Hideaki Takahashi | Jun, 2026 | MediumSitemapOpen in appSign up<br>Sign in

Medium Logo

Get app<br>Write

Search

Sign up<br>Sign in

Two Heads are Better Than One. Run Many Coding Agents. Merge One Auditable Result.

Hideaki Takahashi

4 min read·<br>Just now

Listen

Share

Press enter or click to view image in full size

A few weeks ago, I showed that Claude Code and Codex can have a real-time conversation via Git. That was the first step. If coding agents can talk to each other, the next question is more interesting:<br>Can we run many coding agents on the same task, let them work independently, make them review each other, and merge only the result that is actually verified?

This is the direction I am exploring in h5i: auditable workspaces for AI agent teams.<br>Why one agent is not enough<br>A single coding agent is useful, but fragile.<br>It may miss a corner case.<br>It may overfit to the first approach it sees.<br>It may produce a patch that looks plausible but fails tests.<br>It may be influenced/biased by specific company’s philosophy.<br>This becomes a bigger problem as coding agents move from “autocomplete” to “autonomous work.”<br>The natural next step is not just a smarter single agent. It is an agent ensemble. In machine learning, ensembles work because independent attempts reduce variance.<br>The same idea should apply to software engineering: ask several agents to solve the same problem independently, compare their patches, let them review each other, and use a neutral verifier to decide what should be merged.<br>Why naive agent teams break<br>However, naively spawning multiple agents in the same repository is chaos. If you simply run Claude Code, Codex, and another coding agent on the same repo, you quickly hit many problems.<br>Environment conflict: Agents overwrite files, ports, caches, branches, or build artifacts<br>Token explosion: Every agent rereads the same repo and drags huge logs into context<br>Review overload: | Humans cannot inspect every prompt, command, retry, and failure, although agents can run risky commands<br>Git is excellent at tracking code diffs. Git Worktree can also provide (unsafe) workspace for each agents.<br>But AI agents do more than edit files. They follow prompts, run (potentially dangerous) commands, inspect logs, retry after failures, talk to other agents, and make decisions that never appear in a commit.<br>That missing execution layer is what h5i tries to capture.<br>h5i: auditable workspaces for AI agent teams<br>h5i gives each agent its own Git-backed workspace.<br>Each workspace can contain:<br>a sandboxed worktree<br>model, agent, and prompt metadata<br>compact summaries for token reduction<br>agent-to-agent messages<br>The key idea is simple:<br>Run many coding agents. Merge one auditable result.

The ensemble workflow<br>A typical h5i agent ensemble looks like this.<br>A human gives one task.<br>h5i creates isolated workspaces for multiple agents.<br>Each agent attempts the task independently.<br>Agents freeze their submissions.<br>They peer-review each other’s patches.<br>A neutral verifier replays candidates and runs tests.<br>h5i merges one verified result.<br>The whole process is stored as Git-backed evidence.<br>Press enter or click to view image in full size

Conceptually:<br>one task<br>-> agent A in sandbox<br>-> agent B in sandbox<br>-> agent C in sandbox<br>-> peer review<br>-> neutral verification<br>-> one auditable mergeLet’s try a small example.<br>First, we can easily install the pre-compiled binary of h5i:<br>curl -fsSL https://raw.githubusercontent.com/h5i-dev/h5i/main/install.sh | shThen, make a directory for this experiment and move there:<br>mkdir Experiment<br>cd Experimenth5i init and h5i hook setup initialize system prompts and hooks:<br>h5i init<br>h5i hook setup --write --wrap-bash --teamWe then move to a new branch and make two secure isolated sandboxes for Claude and Codex:<br>git branch dev<br>git switch dev

h5i env create claude-1 --profile agent-claude<br>h5i env create codex-1 --profile agent-codexh5i team command allows us to register those sandboxed environments to one team.<br>h5i team create demo-team<br>h5i team add-env demo-team env/human/claude-1 --runtime claude<br>h5i team add-env demo-team env/human/codex-1 --runtime codexWe then launch terminals for each agent and assign task. If you use Linux (including WSL), you can use the official script of h5i:

echo "Implement Quick Sort from scratch in Python. We also need to provide enough pytest unit tests" > TASK.md

team-launch.sh demo-team --task TASK.mdAfter their edit, hooks ask agents to wait for review request that we can run via team-review.sh .<br>team-review.sh demo-teamThis script guide agents to automatically peer-review each other’s implementation, and also improve their own source codes.<br>After the convergence, h5i automatically picks the best one and merge it to the original branch:<br>h5i team verify demo-team --agent -- pytest -q<br>h5i team verify demo-team --agent -- pytest -q<br>h5i team finalize demo-team<br>h5i team apply demo-teamWhile the...

agent team agents review demo coding

Related Articles