Entity-level semantic merge driver for Git. Understands functions, classes, and properties — so two agents editing different functions in the same file merge cleanly.
# Two agents edit different functions in the same file # Agent 1 modifies processData() # Agent 2 modifies validateInput() $ git merge feature-b CONFLICT (content): Merge conflict in src/lib.ts Automatic merge failed; fix conflicts and then commit. # Git sees overlapping line ranges — false conflict. # The functions don't actually overlap. Git doesn't know that.
$ weave setup ✓ Merge driver configured for *.ts, *.js, *.py, *.go, *.rs, ... $ git merge feature-b weave [src/lib.ts]: 2 entities matched, 2 modified, 0 conflicts Merge made by the 'ort' strategy. # weave understands functions. Different functions = no conflict.
weave has three layers, each building on the last. Use just the merge driver, or add coordination for multi-agent workflows.
Replaces git's line-level merge with entity-level merge. Parses code with tree-sitter, merges by function/class instead of by line.
Persistent "who's editing what" state. Agents claim entities before editing, detect conflicts before they happen.
15 tools exposed via Model Context Protocol. Claude and other AI agents call them directly to coordinate work.
git merges lines. mergiraf merges tree nodes. weave merges entities. Read the full deep dive →
| Scenario | git merge | mergiraf | weave merge |
|---|---|---|---|
| Two agents edit different functions | CONFLICT (adjacent lines) | auto-resolved | auto-resolved |
| One adds function, one modifies another | often conflicts | auto-resolved | auto-resolved |
| Both modify the same function identically | CONFLICT | auto-resolved | detected as identical, uses either |
| Both modify the same function differently | CONFLICT | CONFLICT | attempts 3-way merge on entity body |
| One deletes, one modifies | silent data loss possible | depends on context | modify/delete conflict reported |
| Both add functions at same position | CONFLICT | CONFLICT | auto-resolved (unordered entities) |
| Python: both add decorators to function | CONFLICT | CONFLICT | auto-resolved (decorator bundling) |
Tested on real merge commits from major open-source repos. For each merge commit, we replay the merge with both git and weave, then compare against the human-authored result. Every "win" is a merge where git conflicted but weave resolved cleanly.
| Repository | Language | Merges | Wins | Regressions | Human Match |
|---|---|---|---|---|---|
| git/git | C | 1,319 | 39 | 0 | 64% |
| Flask | Python | 56 | 14 | 0 | 57% |
| CPython | C / Python | 256 | 7 | 0 | 29% |
| Go | Go | 1,247 | 19 | 0 | 58% |
| TypeScript | TypeScript | 1,639 | 4 | 3 | 75% |
Zero regressions on C, Python, and Go. Full breakdown with methodology →
31 hand-crafted merge scenarios across 7 languages. Run weave bench to reproduce.
| Scenario | weave | mergiraf | git |
|---|---|---|---|
| Different functions modified | clean | clean | clean |
| Different class methods modified | clean | clean | clean |
| Both add different imports (TS) | clean | clean | CONFLICT |
| Class: different methods among 4 | clean | clean | clean |
| One adds, other modifies | clean | clean | clean |
| Adjacent function changes | clean | clean | clean |
| Python: different class methods | clean | clean | clean |
| Python: adjacent methods (4-method class) | clean | clean | clean |
| Both add exports at end of file | clean | CONFLICT | CONFLICT |
| Reformat vs modify (whitespace-aware) | clean | clean | CONFLICT |
| Both add functions at end of file | clean | CONFLICT | CONFLICT |
| Both add methods to class at end | clean | clean | CONFLICT |
| Rust: both add different use statements | clean | clean | CONFLICT |
| Python: both add different imports | clean | clean | CONFLICT |
| Class: modify method + add new | clean | clean | clean |
| Both add functions between existing | clean | CONFLICT | CONFLICT |
| Python: both add different decorators | clean | CONFLICT | CONFLICT |
| Decorator + body change | clean | clean | clean |
| TS: class method decorators | clean | CONFLICT | CONFLICT |
| TS: interface field additions | clean | clean | CONFLICT |
| Rust: enum variant additions | clean | clean | CONFLICT |
| Java: different methods in same class | clean | clean | clean |
| Java: both add annotations | clean | clean | CONFLICT |
| C: different functions modified | clean | clean | clean |
| TS: method reorder + modification | clean | clean | clean |
| Python: both add class methods | clean | clean | CONFLICT |
| Rust: both add impl methods | clean | clean | CONFLICT |
| TS: enum modify + add variant | clean | clean | clean |
| TS: add JSDoc + modify body | clean | clean | clean |
| Rust: both add doc comments to different fns | clean | clean | clean |
| Go: both add different functions | clean | clean | CONFLICT |
weave: 31/31 clean (100%) vs mergiraf: 26/31 (83%) vs git: 15/31 (48%). Full benchmark suite runs in 11ms. Individual merges take 65-374µs. Entity extraction powered by sem-core with xxHash64 structural hashing and parallel tree-sitter parsing.
Entity extraction powered by sem-core and tree-sitter.
| Language | Extensions | Entities |
|---|---|---|
| TypeScript | .ts .tsx | functions, classes, interfaces, types, enums |
| JavaScript | .js .jsx .mjs .cjs | functions, classes, variables |
| Python | .py | functions, classes, decorators |
| Go | .go | functions, methods, types |
| Rust | .rs | functions, structs, enums, impls, traits |
| Java | .java | classes, methods, interfaces, enums, fields |
| C | .c .h | functions, structs, enums, unions, typedefs |
| C++ | .cpp .cc .cxx .hpp .hh .hxx | functions, classes, structs, enums, namespaces, templates |
| Ruby | .rb | methods, classes, modules |
| C# | .cs | methods, classes, interfaces, enums, structs, namespaces |
| PHP | .php | functions, classes, methods, interfaces, traits, enums, namespaces |
| Fortran | .f90 .f95 .f03 .f08 .f .for | functions, subroutines, modules, programs, interfaces |
| JSON | .json | properties, objects |
| YAML | .yml .yaml | sections, properties |
| TOML | .toml | sections, properties |
| CSV | .csv .tsv | rows |
| Markdown | .md .mdx | heading-based sections |
Get weave running in your repo in 30 seconds.
# Install $ cargo install --git https://github.com/Ataraxy-Labs/weave weave-cli $ cargo install --git https://github.com/Ataraxy-Labs/weave weave-driver # Configure your repo $ cd my-project $ weave setup ✓ Created .gitattributes with weave merge driver rules ✓ Configured git merge driver 'weave' # Preview a merge before doing it $ weave preview feature-branch src/auth.ts — auto-resolved 2 entities matched, 2 modified, 0 conflicts src/config.json — auto-resolved 1 entity matched, 1 modified, 0 conflicts ✓ Merge would be clean (2 file(s) auto-resolved by weave) # Now git merge uses weave automatically $ git merge feature-branch Merge made by the 'ort' strategy.
# Install the MCP server binary $ cargo install --git https://github.com/Ataraxy-Labs/weave weave-mcp # Add to Claude Code (available in all projects) $ claude mcp add --scope user weave -- weave-mcp # Restart Claude Code, then verify with /mcp
# Add to Claude Desktop config (~/.config/claude/claude_desktop_config.json) { "mcpServers": { "weave": { "command": "weave-mcp" } } }