Sem is a semantic version control tool that sits on top of Git. It parses source with tree-sitter, extracts every function, class, and method as an entity, and diffs, blames, and traces impact at that level rather than by line, so a change reads as "function validateToken was modified" instead of a hunk range. It works in any Git repo without setup, and also compares arbitrary files outside Git.
The command set is organized around questions a coding agent asks. Find locates an entity and reports its callers, its references, or its code with callers and callees inside a token budget. Impact lists everything that depends on an entity or on a whole diff, transitively, plus the tests that reach it. Check runs the project's own compiler, type checker, linter, and tests and returns one verdict (pass, fail, or could not decide), rechecking only what a change can affect when that provably gives the same answer. Certify writes a review certificate for a commit range: entities touched, signature changes and the callers they leave behind, promises kept or broken, affected tests, and an optional architecture delta. Every verb takes a JSON output flag.
Entity matching runs in three phases: exact identity, structural hash (same AST shape under a different name, which catches renames and moves and separates cosmetic edits from logic changes), and fuzzy token overlap above 80 percent. Answers come from an on-disk SQLite index built on first use, with no daemon. An optional cloud account keeps a warm pre-built graph for large monorepos and CI, is opt-in per repo, and falls back to identical local computation when unreachable.
For agents, the same verbs are served as MCP tools over stdio (sem_find, sem_grep, sem_impact, sem_check, sem_certify, sem_diff, sem_graph, sem_history), with a companion skill package for Claude Code and a config block for Cursor, Claude Desktop, or any MCP client. Setup can also replace the default git diff output with entity diffs, install a pre-commit hook that shows the blast radius of staged changes, and register a Claude Code prompt-submit hook. A GitHub Action posts one sticky entity-diff comment per pull request. Promises, written as tree-sitter queries, let an agent or a person record a claim about the codebase as a check that passes or fails after each edit.
Entity extraction covers 32 programming languages (TypeScript, JavaScript, Python, Go, Rust, Java, C, C++, C#, Ruby, PHP, Swift, Kotlin, Scala, Haskell, SQL, and others) plus structured formats such as JSON, YAML, TOML, CSV, Markdown, and LaTeX. Anything else falls back to chunk-based diffing, and extensionless files are detected from shebangs, modelines, and structural heuristics.
Features
- Entity-level diff: functions, classes, and methods added, modified, deleted, renamed, moved, or reordered, with word-level inline highlights and plain, JSON, or Markdown output
- Find: locate an entity by name, then list its callers, its references, or its code with callers and callees within a token budget
- Impact analysis: transitive dependents and dependencies of an entity or of a whole diff, plus the tests that reach it
- Check: runs the project's compiler, type checker, linter, and tests and returns pass, fail, or could not decide, rechecking only what a change can affect when that is provably equivalent
- Review certificate: per commit range, the entities touched, signature changes and orphaned callers, promises kept or broken, affected tests, and an architecture view of new or removed data paths and cycles
- History and blame: how an entity changed over time with logic changes told apart from cosmetic ones, per-entity blame, and repo hotspots and co-change pairs
- Graphs: the entity dependency graph, JS/TS module metrics and blast radius, data-flow reads and writes, and a whole-system graph from lockfiles
- Promises: tree-sitter query laws that encode a claim about the codebase as a passing or failing check, runnable as an edit hook
- MCP server: the core verbs as tools over stdio for Claude Code, Cursor, Claude Desktop, or any MCP client, with a shared warm daemon per checkout
- Git integration: entity diffs in place of git diff output, a pre-commit blast-radius hook, and a GitHub Action that posts one sticky comment per pull request
- Cloud option: an opt-in, per-repo hosted graph for large monorepos, CI, and cross-repo queries, with identical local results when offline
- Language coverage: 32 programming languages via tree-sitter plus JSON, YAML, TOML, EDN, CSV, Markdown, and LaTeX, with chunk-based fallback for the rest
