Git diffs that speak in functions, not line numbers
A Rust CLI that layers semantic, entity-level version control on top of plain Git—built so coding agents can reason about code changes like humans do.
What it does
sem is a Rust CLI that wraps Git with tree-sitter parsing across 27 languages. It extracts functions, classes, methods, and other entities, then reports diffs, blame, and history at that level—“function validateToken modified” rather than “lines 12–18 changed.” It installs into existing repos with no configuration and can even hijack git diff output globally via sem setup.
The interesting bit
The matching logic is the quiet star: exact ID matches, structural hashing (to detect renames and moves while ignoring whitespace), and fuzzy token overlap for probable renames. This means sem knows when you renamed a function, not just that something vaguely similar disappeared and appeared. It also token-budgets context for LLMs, trimming dependency trees to fit a strict limit and flagging when even the target signature won’t fit.
Key highlights
- Entity-native commands:
diff,blame,log,impact(cross-file dependency blast radius), andcontext(token-budgeted LLM context) all operate on named code entities. - Agent plumbing: JSON output throughout, plus an MCP server exposing six tools (
sem_diff,sem_impact, etc.) for direct AI agent integration. - Broad language coverage: 27 programming languages plus structured formats (JSON, YAML, TOML, CSV, Markdown), with fallback chunk-based diffing for everything else.
- Rename/move detection: Three-phase matching catches structural renames and moves that line-based diffing misses entirely.
- GNU Parallel collision: The binary name
semconflicts with GNU Parallel’s symlink; the README documents workarounds but it’s a genuine papercut.
Caveats
- The project is explicitly part of a larger “agent-native” stack (Ataraxy Labs) with companion tools like
weaveandinspect—useful context, but also meanssemis positioned as infrastructure rather than a standalone end-user product. - 2,590 stars is respectable but early; some surface area (e.g., exact accuracy of impact analysis across dynamic languages) is hard to verify from README claims alone.
Verdict
Worth a look if you’re building coding agents, CI pipelines, or developer tools that need to reason about code semantically. Skip it if you just want prettier line diffs—delta already solved that.
Frequently asked
- What is Ataraxy-Labs/sem?
- A Rust CLI that layers semantic, entity-level version control on top of plain Git—built so coding agents can reason about code changes like humans do.
- Is sem open source?
- Yes — Ataraxy-Labs/sem is open source, released under the Apache-2.0 license.
- What language is sem written in?
- Ataraxy-Labs/sem is primarily written in Rust.
- How popular is sem?
- Ataraxy-Labs/sem has 3.2k stars on GitHub and is currently accelerating.
- Where can I find sem?
- Ataraxy-Labs/sem is on GitHub at https://github.com/Ataraxy-Labs/sem.