The engineer who wrote Git’s merge algorithm just endorsed a project that wants to replace how Git merges code. Elijah Newren — author of Git’s merge-ort strategy, the default since Git 2.34 — said this week that Weave, a new Git merge driver by Ataraxy Labs, is “a very reasonable way to tackle the problem,” adding that “language-aware content merging is needed more than ever for agents.” The tool hit the Hacker News front page today with 188 points and 113 comments, and the benchmark numbers make the case bluntly: Weave resolves 31 of 31 real-world merge scenarios cleanly. Git manages 15.
Why AI Agents Break Git Merge #
Git merges at the line level. That made sense when the only developers editing a file were humans working at human speed, one or two at a time. AI agents broke those assumptions. When Claude Code sub-agents, Cursor instances, or GitHub Copilot Workspace sessions each add functions to the same file simultaneously, they create “conflicts” that aren’t actually conflicts — they just happen to touch the same line ranges.
The scenario is mundane. Agent A adds parse_config()
starting at line 200. Agent B, working in parallel, adds validate_schema()
— also intended for line 200, now shifted by A’s insertion. Git sees overlapping line ranges and flags a conflict. Weave sees two independent functions and auto-merges both cleanly. For teams running Claude Code with sub-agents that can now spawn sub-agents, this scenario isn’t hypothetical — it’s every session.
How Weave Git Merge Works #
Weave intercepts Git merges via .gitattributes
and replaces line-level diffing with entity-level semantic analysis. It parses all three versions — base, ours, theirs — into semantic entities (functions, classes, JSON keys, YAML sections) using tree-sitter grammars. Each entity gets a unique identity string: file:type:name:parent
. Independent entity changes auto-merge. When the same entity was changed by both branches, Weave attempts intra-entity merge before declaring an actual conflict.
The numbers hold up under scrutiny. Validated on the git/git repo itself (500 merges, 1,319 files), CPython, Flask, and the TypeScript compiler — zero regressions across all of them. Weave supports 28 programming languages plus JSON, YAML, TOML, and Markdown. It falls back to standard line-level merge for files over 1MB or unsupported formats, so there’s no regression risk for mixed repositories.
Installation is two commands:
brew install weave
weave setup
weave setup
configures .gitattributes
and .gitconfig
for the current repository. From that point, Weave intercepts all merges silently. Run weave preview-merge origin/main
to simulate before merging.
The MCP Server: Stop Conflicts Before They Start #
Weave ships a dedicated MCP server that goes further than fixing merges — it prevents them. The weave-mcp package gives AI agents tools to coordinate before touching shared files. Agents can claim a specific function with weave_claim_entity
, check what other agents are actively editing with weave_who_is_editing
, and simulate merge outcomes with weave_preview_merge
before any actual merge happens.
In practice: Claude Code sub-agent A claims UserAuthService.validate_token()
. Sub-agent B queries weave_who_is_editing
, sees it’s claimed, and edits a different method instead. Zero conflict at merge time. This shifts multi-agent coordination from reactive (resolve after conflict) to proactive (negotiate before edit) — a meaningful architecture change for teams running parallel agent workflows.
What to Watch For #
C/C++ preprocessor macros create edge cases — Weave falls back to line-level for those files. Structural hash matching for renamed functions is best-effort, not guaranteed. The project is at v0.3.6, which means the API surface can still shift. The HN thread had legitimate pushback: one camp argued AI agents can resolve their own conflicts without semantic tooling; another questioned whether the benchmarked scenarios reflect real-world frequency. Newren’s endorsement carries weight, but healthy skepticism is warranted at this stage.
Related:[Claude Code v2.1.172: Sub-Agents Can Now Spawn Sub-Agents]
Key Takeaways #
- Weave is a Git merge driver that operates at the function/class level via tree-sitter, not the line level — eliminating false conflicts from parallel AI agent edits
- Benchmark: 31/31 clean merges vs. Git’s 15/31, validated against CPython, Flask, and the TypeScript compiler with zero regressions
- The author of Git’s merge-ort algorithm called the approach “a very reasonable way to tackle the problem” — an unusually credible endorsement
- Installation is
brew install weave && weave setup
— two commands, works with existing repos, graceful fallback for unsupported files - The MCP server (
weave-mcp
) adds proactive agent coordination: claim entities before editing, check who’s touching what, preview merges before attempting