sem: Semantic Version Control

Posted on Sun, 15 Mar 2026 in Programming

I stumbled upon sem a few weeks ago and I think it's a brilliant idea. It's a CLI that goes beyond traditional line-by-line diffs and understands the actual structure of your code.

The difference between lines and entities

When you do a traditional git diff, you see something like:

- const oldAuth = function(user) { ... }
+ const newAuth = async function(user) { ... }

But with sem diff you see:

 function validateToken          [added]
 function authenticateUser       [modified]
 function legacyAuth             [deleted]

No lines added or deleted — entities that changed: functions, classes, methods. Much more useful for understanding what actually happened in the PR.

Available commands

  • sem diff: Shows what entities changed
  • sem impact <entity>: Analyzes what would break if you change that entity (incoming dependencies)
  • sem blame: Entity-level blame — who changed each function/class
  • sem graph: Shows the dependency graph between entities

Practical example

# See what entities changed in working directory
sem diff

# See only staged changes
sem diff --staged

# See changes from a specific commit
sem diff --commit abc1234

# See impact of changing a function
sem impact validateToken

# JSON output for CI pipelines
sem diff --format json

Installation

# macOS
brew install sem-cli

# Linux (my case)
brew install sem-cli
# or download binary from GitHub Releases

Or build from source if you have Rust installed:

git clone https://github.com/Ataraxy-Labs/sem
cd sem/crates
cargo install --path sem-cli

Why this is useful

For me, mainly two cases:

  1. Faster code reviews — You understand the real impact of a change in seconds
  2. Safe refactors — Before renaming a critical function, sem impact tells you what might break

Supports 20 languages (including Python, Rust, Go, TypeScript, Java, C++, etc.) using tree-sitter to parse the code.

A tool that goes straight into my daily toolkit.