Weave: 100% Clean Merges Where Git Gets 48%
Git's merge algorithm compares lines of text. It has no idea what a function is. So when two developers edit different functions in the same file, git often reports a conflict anyway, because the lines are close together. We built Weave to fix this. On 31 real-world merge scenarios, Weave resolves all of them cleanly. Git manages 15.
The Problem
Imagine two people working on the same Python file. Alice adds a parameter to process_payment(). Bob adds logging to validate_order(). These are completely independent changes to different functions. But if the functions sit next to each other in the file, git sees overlapping context and declares a conflict. Someone has to manually resolve it. Multiply this across a team of developers, or 3-5 AI agents working in parallel, and merge conflicts become the bottleneck.
How Weave Works
Instead of comparing lines, Weave compares entities: functions, classes, methods, imports. It parses all three versions of the file (base, yours, theirs) using tree-sitter, matches entities by name, and merges them independently. Two edits to different functions? No conflict. Two edits to different methods in the same class? Also no conflict. Weave only flags a real conflict when the same entity was changed differently on both sides.
This eliminates false conflicts from adjacent function edits, import additions, class member reordering, and renamed functions (detected via structural hashing). It also handles things like comments and decorators sticking to the function they belong to, and import statements being merged as sets rather than sequences.
The Benchmark
We tested on 31 scenarios pulled from real open-source repositories: adjacent function edits, import conflicts, class member additions, renames combined with modifications, and mixed cases.
Tool Clean Merges Percentage
git merge 15/31 48.4%
Weave 31/31 100.0%Every Weave resolution compiles and passes tests. The 16 scenarios where git fails are exactly the kind of false conflicts developers waste time on: overlapping context from nearby functions, both branches adding imports, same-position inserts in a class.
Agent Coordination
Weave also includes an MCP server with 14 tools so AI agents can coordinate before they even merge. Agents can claim entities before editing, check what others are working on, and get warnings about potential conflicts. Think of it as optimistic locking at the function level. This is useful when multiple agents work on the same codebase at once.
Try It
brew install ataraxy-labs/tap/weave
weave setup # configures your repoYour next merge might just work. GitHub.