sem
llms.txt3.4k starsChanged 57 days agoApache-2.0View on GitHub
Entity-level semantic diff on top of Git. Functions, classes, methods instead of lines. sem extends Git with entity-level operations. Instead of tracking lines, sem tracks functions, classes, methods, and types. Uses tree-sitter for parsing and AST-normalized structural hashing to detect cosmetic vs structural changes. Git tracks lines. Developers think in functions. sem bridges the gap. Or build from source: Binary at crates/target/release/sem. 27 programming languages:
- Installs packages
Trending
More talk lately.about the whole repository
Who's talking about Ataraxy-Labs/sem
- A Hacker News story“Sem – Semantic version control. Entity-level diffs on top of Git”Hacker News · Mar 8, 2026 · 95 points
- A Hacker News story“Sem – Semantic Diff behind the new viral merge algo Weave”Hacker News · Mar 5, 2026 · 10 points
- @u11g.com“Exactly the kind of diff abstraction AI-era code review needs when line changes are noisy but semantic …”Bluesky · Jun 19, 2026 · 2 likes
- chenrui333/homebrew-tap“sem-cli 0.26.0”GitHub · Oct 2, 2026 · 1 reactions
- chenrui333/homebrew-tap“sem-cli 0.18.0”GitHub · Jul 3, 2026 · 1 reactions
The biggest 5 of 24 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 24
Talked about on GitHub, Bluesky and Hacker News (24 times).
On GitHub · 17
- Oct 2, 2026sem-cli 0.26.0 — chenrui333/homebrew-tap1 reaction · 2 comments
- Jul 3, 2026sem-cli 0.18.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Jun 13, 2026feat: add sem MCP server to all AI tool configs — jellydn/my-ai-tools1 reaction · 3 comments
- Apr 16, 2026add support for delegating to sem — benstroud/lazygaze1 reaction
- Mar 10, 2026Support more file types — Ataraxy-Labs/weave1 reaction · 1 comment
12 more on GitHub
- Oct 5, 2026https://github.com/Ataraxy-Labs/sem — Morrison-Lab/wai0 reactions
- Oct 4, 2026agent-skills.github.ataraxy-labs.sem: 0.26.0 → 0.27.0 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.ataraxy-labs.sem: 0.25.0 → 0.26.0 — sudosubin/agents.nix0 reactions
- Oct 2, 2026sem-cli 0.26.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 25, 2026Proposal: contrib/sem.tigrc with entity-level diff and blame bindings — jonas/tig0 reactions
- Sep 25, 2026agent-skills.github.ataraxy-labs.sem: init at 0.25.0 — sudosubin/agents.nix0 reactions
- Sep 21, 2026docs(examples): add optional Sem MCP context integration — alibaba/open-code-review0 reactions · 2 comments
- Sep 5, 2026build(deps): bump sem-core from 0.23.0 to 0.23.1 — Ataraxy-Labs/weave0 reactions
- Jul 17, 2026🚀 consider to integrate `sem` — dandavison/delta0 reactions
- Jul 13, 2026https://github.com/Ataraxy-Labs/sem 응용? — Bogyie/codebase-memory-mcp0 reactions
- Jul 6, 2026Clew: P1 semantic spine, engine hardening, redesigned playground, and sem CI — naylorb/BASS0 reactions · 1 comment
- Apr 13, 2026ME-P1-D: Ataraxy-Labs sem as a code-fact supersession backend — dutiona/memory-engine0 reactions
On Bluesky · 5
- Jun 19, 2026Exactly the kind of diff abstraction AI-era code review needs when line changes are noisy but semantic intent matters.… — @u11g.com2 likes and reposts
- Jun 9, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 Ataraxy-Labs / sem ⭐ 2,523 (+149) 🗒 Rust Semantic version control => entity-level diffs, blame, and… — @github-trending-rs.bsky.social1 likes and repost
- Apr 23, 2026I've had the opportunity to only briefly use this tool, but what I've seen so far is really useful. github.com/Ataraxy-Labs... — @scottslowe.bsky.social1 likes and repost
- Apr 12, 2026Ataraxy-Labs / sem: Semantic version control CLI. Entity-level diff, blame, graph, and impact analysis for code. 23 languages via… — @rusttrending.bsky.social1 likes and repost
- Apr 8, 2026📦 Ataraxy-Labs / sem ⭐ 1,471 (+61) 🗒 Rust Semantic version control CLI. Entity-level diff, blame, graph, and impact analysis for code. 21… — @github-trending-rs.bsky.social1 likes and repost
On Hacker News · 2
- Mar 8, 2026Sem – Semantic version control. Entity-level diffs on top of Git95 points · 24 comments
- Mar 5, 2026Sem – Semantic Diff behind the new viral merge algo Weave10 points · 1 comment
The file
Files
# sem
> Entity-level semantic diff on top of Git. Functions, classes, methods instead of lines.
## Overview
sem extends Git with entity-level operations. Instead of tracking lines, sem tracks functions, classes, methods, and types. Uses tree-sitter for parsing and AST-normalized structural hashing to detect cosmetic vs structural changes.
Git tracks lines. Developers think in functions. sem bridges the gap.
## Install
```
brew install sem-cli
```
Or build from source:
```
git clone https://github.com/Ataraxy-Labs/sem
cd sem/crates && cargo install --path sem-cli
```
Binary at `crates/target/release/sem`.
## Commands
### sem diff
Entity-level diff. Shows which functions/classes were added, modified, deleted, or renamed. Distinguishes cosmetic changes (whitespace/formatting) from structural changes (logic).
```
sem diff # working changes
sem diff --staged # staged only
sem diff --commit abc1234 # specific commit
sem diff --from HEAD~5 --to HEAD # commit range
sem diff file1.ts file2.ts # compare two files (no git needed)
sem diff --format json # JSON output for agents/CI
sem diff --format plain # git-status style
sem diff --format markdown # markdown tables
sem diff --stdin --format json # read file changes from stdin
sem diff --file-exts .py .rs # filter by extension
sem diff -v # verbose inline content diffs
```
### sem blame
Entity-level blame. Who last modified each function/class, not each line.
```
sem blame src/auth.ts
sem blame src/auth.ts --json
```
### sem graph
Cross-file entity dependency graph. Shows what each function calls and what calls it.
```
sem graph
sem graph --entity validateToken
sem graph --file-exts .py
sem graph --format json
sem graph --no-default-excludes
```
### sem impact
Transitive impact analysis. If this entity changes, what else is affected? BFS through dependency graph.
```
sem impact validateToken
sem impact validateToken --json
sem impact validateToken --file-exts .py
sem impact validateToken --no-default-excludes
```
## Key Features
- 27 languages with full entity extraction via tree-sitter
- Structural hashing: AST-normalized hashes that ignore whitespace, comments, formatting
- Cosmetic vs structural change detection in diff
- Entity-level blame (per function, not per line)
- Cross-file dependency graph via call/reference analysis
- Transitive impact analysis (BFS through dependency graph)
- Three-phase entity matching: exact ID, structural hash (rename detection), fuzzy similarity
- JSON output for AI agents and CI pipelines
- Stdin mode for non-git usage
## Language Support
27 programming languages:
| Language | Extensions | Entity Types |
|----------|-----------|--------------|
| TypeScript | .ts .tsx .mts .cts | functions, classes, interfaces, types, enums, exports |
| JavaScript | .js .jsx .mjs .cjs | functions, classes, variables, exports |
| Python | .py | functions, classes, decorated definitions |
| Go | .go | functions, methods, types, vars, consts |
| Rust | .rs | functions, structs, enums, impls, traits, mods, consts |
| Java | .java | classes, methods, interfaces, enums, fields, constructors |
| C | .c .h | functions, structs, enums, unions, typedefs |
| C++ | .cpp .cc .hpp | functions, classes, structs, enums, namespaces, templates |
| C# | .cs | classes, methods, interfaces, enums, structs, properties |
| Ruby | .rb | methods, classes, modules |
| PHP | .php | functions, classes, methods, interfaces, traits, enums |
| Swift | .swift | functions, classes, protocols, structs, enums, properties |
| Elixir | .ex .exs | modules, functions, macros, guards, protocols |
| Bash | .sh | functions |
| HCL/Terraform | .hcl .tf .tfvars | blocks, attributes (qualified names) |
| Kotlin | .kt .kts | classes, interfaces, objects, functions, properties |
| Fortran | .f90 .f95 .f | functions, subroutines, modules, programs |
| Vue | .vue | template/script/style blocks + inner TS/JS entities |
| XML | .xml .plist .svg .csproj | elements (nested, tag-name identity) |
| ERB | .erb | blocks, expressions, code tags |
| Svelte | .svelte .svelte.js .svelte.ts | component blocks, rune modules + inner JS/TS entities |
| Dart | .dart | classes, mixins, extensions, enums, type aliases, functions |
| Perl | .pl .pm .t | subroutines, packages |
| OCaml | .ml .mli | values, modules, types, classes, externals |
| Scala | .scala .sc .sbt | classes, objects, traits, enums, functions, vals, extensions |
| Nix | .nix | bindings, inherit declarations |
| Zig | .zig | functions, tests, variables |
Plus structured data formats:
| Format | Extensions | Entity Types |
|--------|-----------|--------------|
| JSON | .json | properties, objects (RFC 6901 paths) |
| YAML | .yml .yaml | sections, properties (dot paths) |
| TOML | .toml | sections, properties |
| CSV | .csv .tsv | rows (first column as ID) |
| Markdown | .md .mdx | heading-based sections |
Everything else falls back to chunk-based diffing.
## JSON Output
```
sem diff --format json
```
Returns:
```json
{
"summary": { "fileCount": 2, "added": 1, "modified": 1, "deleted": 1, "moved": 0, "renamed": 0, "reordered": 0, "orphan": 0, "total": 3 },
"changes": [
{
"entityId": "src/auth.ts::function::validateToken",
"changeType": "added",
"entityType": "function",
"entityName": "validateToken",
"startLine": 12,
"endLine": 18,
"oldStartLine": null,
"oldEndLine": null,
"filePath": "src/auth.ts"
}
]
}
```
The named change-type buckets (added, modified, deleted, moved, renamed, reordered) always sum to total. Orphan is metadata for module-level changes already included in those buckets.
## Architecture
Cargo workspace: sem-core (library) + sem-cli (binary).
- tree-sitter for code parsing (native Rust, not WASM)
- git2 for in-process Git operations
- rayon for parallel file processing
- xxhash for structural hashing
- Plugin system for adding new languages and formats
## Performance
- Small commit (1 file): 5ms
- Medium commit (5 files): 8ms
- Large commit (13 files): 19ms
- Range (8 commits, 30 files): 24ms
- Faster than git diff for equivalent operations
## As a Library
sem-core can be used as a Rust library dependency:
```toml
[dependencies]
sem-core = { git = "https://github.com/Ataraxy-Labs/sem", version = "0.3" }
```
Used by weave (semantic merge driver) and inspect (entity-level code review).
## Links
- GitHub: https://github.com/Ataraxy-Labs/sem
- Website: https://ataraxy-labs.github.io/sem
- License: MIT OR Apache-2.0
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

