ICR · intent-aware code replication

The merge was clean.
The code was broken.

Two AI agents edit one repo. One renames a function; the other adds a call to the old name. Git compares lines, finds no overlap, and reports success — then your build dies at runtime. Hivecode merges by structure and intent: it recognises the rename, rewrites the stale call site, and refuses to emit code that doesn't parse.

$ npx git-clash scan See the benchmarks

Audits your real merge history for silent breaks. Runs locally, nothing uploaded.

auto-plays · click any step

76.5%

of independent feature pairs conflict when merged with git — on professionally written patches, not agent output

CooperBench · 505 of 652 pairs

3.7×

more of those conflicts integrated cleanly by ICR than by mergiraf, the best free structural merger

40.8% vs 11.1%

96.2%

of ICR's integrations pass both features' own test suites — verified, not asserted

50 of 52 scoreable pairs

0

unparseable merges across 6,430 real Python conflicts, checked with CPython's own parser

ConGra · 0 crashes

the failure class

Three ways a “clean” merge ships broken code

None of these produce a conflict marker. None fail a linter. All three are what happens when a tool that only understands lines is handed code that only makes sense as structure.

01 · dangling reference

Deleted, but still called

Agent A removes a helper it believes is dead. Agent B, at the same time, writes a new caller for it. The edits touch different lines, so git merges happily.

// agent A removes it
- function formatCents(n) { … }

// agent B adds a caller
+ total = formatCents(sum)

ICR resolves references after merging and reports ref:formatCentsclean: false, so nothing ships silently.

02 · character fusion

Code nobody wrote

In a live CRDT editor two agents change the same value at once. Both inserts survive with distinct identities, in deterministic order. Every peer converges — on a number neither author chose.

base   return 1
A      return 2
B      return 3
merged return 23  ← valid, convergent, unauthored

Signed provenance keeps both real versions, so the fused text — which nothing attests — is detected and surfaced as a genuine conflict.

03 · divergent intent

Two right answers

Both agents rewrite the same function — one adds rate limiting, one converts it to async. Any merge that silently picks a winner throws away work somebody asked for.

{ key: 'fn:login',
  base, ours, theirs,
  oursIntent:   'add rate limiting',
  theirsIntent: 'make login async' }

The conflict is emitted as a machine-resolvable object carrying both intents — an agent can reconcile it, and the engine re-validates the result before it lands.

how it works

Four layers, each with a job git doesn't have

The engine is open source and runs anywhere — as a library, as a git merge driver, or live inside a shared workspace.

layer 1 · identity

Merge declarations, not lines

Each version is parsed and split into keyed units — fn:login, class:Auth, import:./db. The key is identity, so “the same function in all three versions” is a fact, not a guess. Changed on one side wins; changed on both descends a tier: statements, then lines, then tokens.

import { merge } from 'icr-merge'

const r = merge(base, ours, theirs, { filename: 'auth.js' })
// r.method → 'structural' | 'rename' | 'lines'
layer 2 · the guarantee

Never emit code more broken than the input

Every merged unit and every final result is re-parsed before it is allowed out. If it doesn't parse, the engine refuses and falls back to a line merge — so the floor is exactly git, never worse. Held across thousands of fuzzed merges per run and 6,430 real conflicts.

// all three inputs parse but the result doesn't?
{ clean: false,
  warning: 'line-merged text does not parse' }
layer 3 · prevention

Claim before you write

Agents sense a shared claim map, take a lease, verify after sync, and back off if they lost the race — Ethernet's collision detection with ant-colony expiry. There is no coordinator, and a crashed agent's claim evaporates on its own TTL instead of deadlocking the room.

SENSE  → is this file taken?
FLOW   → if so, move to an open one
CLAIM  → { by, intent, at, ttl }
VERIFY → re-read after sync; lost? back off
layer 4 · provenance

Every byte signed, with its reason

Each edit is an Ed25519-signed receipt over author, the exact state it was made from, the result, and the intent. Author identity is the key's own fingerprint, so there is no account database. Unattributable bytes stand out precisely because nobody signed them.

{ author:  fingerprint(pubKey),
  parent:  sha256(stateEditedFrom),
  content: sha256(result),
  intent:  'add rate limiting to login' }

receipts, not adjectives

Measured on someone else's benchmark

CooperBench (Stanford, 2026) gives two agents independent features on one repo and scores the result by running both features' test suites. Its 652 gold pairs are professional human patches — the cleanest possible input. 505 of them still conflict under git. Here is how much of that loss each merge layer recovers.

Of the 505 git-conflicted pairs — integrated cleanly, then test-verified.
Merge layerPairs integratedSharePasses both test suites
git mergeline-based, the baseline 0 0%
mergiraf 0.18tree-sitter structural 56 11.1%
ICR — safe defaultstructure + intent 112 22.2%
100% 27 / 27
ICR — union modethe multi-agent policy 206 40.8%
96.2% 50 / 52
ground truth

279 conflicts humans already resolved

Replay real OSS conflicts and compare each tool's output against what the maintainer actually committed. ICR matched 87; mergiraf 64. Zero broken outputs, and ICR led on all five repositories.

public benchmark

ConGra — 6,430 Python conflicts

Verified with CPython's own ast.parse. ICR resolves 32.1% to mergiraf's 31.8%, with zero crashes and zero parse-guarantee violations. Running it found and fixed 17 real engine bugs first.

properties

Tested as maths, not examples

Symmetry (M(b,x,y) = M(b,y,x)), fixed-point, no-loss and the parse guarantee, under seeded fuzz across 20+ languages — 13,000+ assertions, green. Convergence isn't a nicety: without it, live peers diverge.

$ node scripts/cooper-merge-bench.mjs Every harness and raw receipt is in the repo — reproduce it, don't trust it.

upstream of the merge

Or don't collide in the first place

A merge engine is a safety net. The stronger move is a shared medium: agents and humans on one live workspace, seeing each other's edits in about a second, with no push, no pull, and no branch to reconcile later.

  1. 1Agents join over MCP. One line of config; they call hive_join and live in a hive_wait loop — no scripts, no polling.
  2. 2Every edit syncs in ~1s. A room is a CRDT document, one sub-document per file, mirrored to each participant's real files on disk.
  3. 3You keep control. Watch every edit live, fence an agent to a folder it cannot see past, gate risky work behind approval, and undo any agent instantly.
  4. 4Overlaps fall to ICR. What prevention misses, the engine merges by meaning — or names precisely, with both intents attached.
The Hivecode mark: many streams of concurrent code converging into a single codebase

Many agents. One codebase. No branch to reconcile.

three ways in

Start with the audit. It costs nothing.

Each of these is published and installable right now.

diagnose

git-clash

Replays your repository's own merge history and reports the merges that were clean to git but semantically broken. Read-only, entirely local.

$ npx git-clash scan
fix · MIT licensed

icr-merge

The engine as a library, a CLI, and a three-line git merge driver — so every git merge and rebase in your repo starts merging by structure instead of by line.

$ npm i icr-merge
prevent

hivecode-mcp

The live medium for agents: claims, chat, task approval, presence and provenance, exposed as MCP tools any capable agent can call natively.

$ npx hivecode-mcp
Full ICR walkthrough · 9 min

pricing

The engine is free forever. The medium is the product.

ICR is MIT-licensed and always will be — merge safety shouldn't be a paywall. Pro is for teams running agent fleets on a shared workspace, where enforcement, isolation and audit are what actually matter.

Free

$0/ forever

Everything an individual developer needs.

  • The full ICR engine — structure, intent, renames, the parse guarantee
  • Git merge driver + CLI, 20+ languages
  • Unlimited git-clash audits
  • Live rooms, up to 2 committers
  • Relay-enforced write leases
  • Private folder-scoped rooms
  • Signed provenance ledger
Get the engine

no account, no telemetry

Pro

$29/ committer / month

For teams running AI agents on a shared codebase.

1

Total $29 / month

  • 1 active committer
  • Relay-enforced write leases — block or queue, not just warn
  • Private rooms with per-folder scoping and read-only roles
  • Signed provenance ledger + silent-fork detection
  • Restore points and undo-by-agent
  • Priority relay, or self-host it yourself

A committer is one agent or human writing to the room at the same time. Idle agents, reviewers and read-only clients don't count — you pay for concurrent writers, not for how many agents you have configured.

Enterprise

Talk to us

For teams whose code cannot leave their own infrastructure.

  • Everything in Pro, unlimited committers
  • Self-hosted relay — your network, your keys, no code leaves it
  • SSO, per-team folder scoping, read-only roles
  • Exportable provenance audit log — who changed what, and why
  • Support direct from the engineer who built it
Start a conversation

deployed on your infrastructure

straight answers

Including the ones that don't flatter us

What can't ICR do?

It guarantees structure, not semantics. If two agents invent two different database schemas, ICR will merge both side by side into code that runs — deciding which schema is right is a product judgement, not a merge one. A comment and code edited on the same side can lose the comment. Languages without a full parser have weaker validation unless the tree-sitter oracle is enabled. And when an AI resolves a conflict, its answer can be semantically wrong while structurally valid — the engine verifies the shape, never the meaning.

Does this replace git?

No. ICR installs as a git merge driver, so it improves the merges you already do. The live medium is for the minutes between commits, where git has nothing to say. And the fallback tier is plain diff3 — the floor is exactly git's behaviour, never worse.

Which languages are supported?

20+. Full AST merging for JavaScript and TypeScript; structural and intent-aware merging for Python, Ruby, Go, Rust, Java and the C family; JSON merged as parsed data rather than text; YAML and TOML by keyed structure. An optional tree-sitter oracle upgrades the parse gate with real grammars for 15 of them.

Do you see my code?

git-clash and icr-merge run entirely on your machine and send nothing anywhere. For live rooms the relay forwards encrypted-in-transit CRDT updates and keeps no canonical copy of your repository; folder scoping means an out-of-scope file never reaches a participant at all. You can self-host the relay, and the trust root is a key you hold — there is no account database.

Why not just give each agent a git worktree?

That's today's default, and it's a deferral rather than a fix: it converts live coordination into a merge you deal with later. CooperBench measures the cost — three quarters of independent feature pairs conflict, on professionally written patches. Isolation doesn't reduce that number; it just decides when you meet it.

Find out whether it already happened to you

One command, read-only, no signup. It replays your merge history and tells you which “clean” merges weren't.

$ npx git-clash scan Read the source