Semantic version control => entity-level diffs, blame, and impact analysis on top of git. 28 languages via tree-sitter. Built for coding agents.
- ✓Open-source license (Apache-2.0)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
- !Install pipes a remote script into a shell (curl | sh)
git clone https://github.com/Ataraxy-Labs/sem && cp sem/*.md ~/.claude/agents/Subagents overview
> **Part of the [Ataraxy Labs](https://ataraxy-labs.com) stack** — agent-native infrastructure for software development. See also: [weave](https://ataraxy-labs.com/weave) (entity-level git merge driver) · [inspect](https://github.com/Ataraxy-Labs/inspect) (semantic code review) · [opensessions](https://github.com/Ataraxy-Labs/opensessions) (tmux sidebar for coding agents).
>
> Read the manifesto: https://ataraxy-labs.com/#thesis · Essays: https://ataraxy-labs.com/blogs · LLMs: https://ataraxy-labs.com/llms.txt
<p align="center">
<img src="assets/banner.svg" alt="sem" width="600" />
</p>
<p align="center">
<a href="https://trendshift.io/repositories/25348" target="_blank"><img src="https://trendshift.io/api/badge/repositories/25348" alt="Ataraxy-Labs%2Fsem | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
</p>
<p align="center">
<strong>Semantic version control built on Git.</strong><br>
Instead of lines changed, sem tells you what entities changed: functions, methods, classes.
</p>
<p align="center">
<a href="https://ataraxy-labs.com/blogs/code-is-not-text">Why sem?</a> ·
<a href="#install">Install</a> ·
<a href="#commands">Commands</a> ·
<a href="#use-with-ai-agents-mcp">Agents (MCP)</a> ·
<a href="docs/cloud-consent.html">Cloud consent</a> ·
<a href="https://github.com/Ataraxy-Labs/sem/releases/latest">Releases</a>
</p>
<p align="center">
<a href="https://github.com/Ataraxy-Labs/sem/releases/latest"><img src="https://img.shields.io/github/v/release/Ataraxy-Labs/sem?color=blue&label=release" alt="Release"></a>
<img src="https://img.shields.io/badge/rust-stable-orange" alt="Rust">
<img src="https://img.shields.io/badge/tests-133_passing-brightgreen" alt="Tests">
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow" alt="License"></a>
<img src="https://img.shields.io/badge/languages-31-blue" alt="Languages">
</p>
sem is a semantic version control tool that works on top of Git. It parses your code with tree-sitter, extracts every function, class, and method as an entity, and diffs at the entity level instead of lines. This means you see "function `blahh` was modified" instead of "lines x-y changed."
It works in any Git repo with no setup.
Cloud-backed queries are opt-in per repo: logging in does not upload a repo or send a query. See the [cloud consent flow](docs/cloud-consent.html) for the public/private repo states, preview screen, local audit log, and forget controls.
<p align="center">
<img src="assets/terminal.svg" alt="sem diff" width="800" />
</p>
## Install
```bash
curl -fsSL https://raw.githubusercontent.com/Ataraxy-Labs/sem/main/install.sh | sh
```
Or via Homebrew:
```bash
brew install sem-cli
```
Or via winget on Windows:
```powershell
winget install AtaraxyLabs.sem
```
Or install the npm wrapper into `node_modules`:
```bash
npm install --save-dev @ataraxy-labs/sem
```
With Bun, trust the package so its `postinstall` script can download the binary:
```bash
bun add -d @ataraxy-labs/sem
bun pm trust @ataraxy-labs/sem
```
Once installed, update to the latest release any time:
```bash
sem update
```
Or build from source (requires Rust):
```bash
cargo install --git https://github.com/Ataraxy-Labs/sem sem-cli
```
Or grab a binary from [GitHub Releases](https://github.com/Ataraxy-Labs/sem/releases).
Or run via Docker:
```bash
docker build -t sem .
docker run --rm -it -u "$(id -u):$(id -g)" -v "$(pwd):/repo" sem diff
```
## Name conflict with GNU Parallel
GNU Parallel ships a `sem` binary (`/usr/bin/sem`) as a symlink to `parallel`. If you have both installed, they'll collide. Run `sem --version` to check which one you're using. ([#77](https://github.com/Ataraxy-Labs/sem/issues/77))
**Quick fixes:**
```bash
# Option 1: alias in your shell profile (~/.bashrc, ~/.zshrc)
alias sem="$HOME/.cargo/bin/sem"
# Option 2: make sure cargo bin comes first in PATH
export PATH="$HOME/.cargo/bin:$PATH"
# Option 3: if installed via Homebrew
export PATH="$(brew --prefix)/bin:$PATH"
```
If you installed via npm/bun, the binary lives in `node_modules/.bin/sem` and is invoked through `npx sem` or `bunx sem`, which avoids the conflict entirely.
## Commands
Works in any Git repo. No setup required. Also works outside Git for arbitrary file comparison.
sem stores its SQLite entity cache outside the repository, under the OS cache directory by default. Set `SEM_CACHE_DIR=/path/to/cache` to override the cache root; repo-local overrides are ignored so cache files do not dirty the working tree.
### sem diff
Entity-level diff with rename detection, structural hashing, and word-level inline highlights.
```bash
# Semantic diff of working changes
sem diff
# Staged changes only
sem diff --staged
# Specific commit
sem diff --commit abc1234
# Commit range
sem diff --from HEAD~5 --to HEAD
# Verbose mode (word-level inline diffs for each entity)
sem diff -v
# Plain text output (git status style)
sem diff --format plain
# JSON output (for AI agents, CI pipelines)
sem diff --format json
# Markdown output (for PRs, reports)
sem diff --format markdown
# Compare any two files (no git repo needed)
sem diff file1.ts file2.ts
# Read file changes from stdin (no git repo needed)
echo '[{"filePath":"src/main.rs","status":"modified","beforeContent":"...","afterContent":"..."}]' \
| sem diff --stdin --format json
# Only specific file types
sem diff --file-exts .py .rs
```
### sem impact
Cross-file dependency graph shows what breaks if an entity changes.
```bash
# Full impact analysis
sem impact authenticateUser
# Direct dependencies only
sem impact authenticateUser --deps
# Direct dependents only
sem impact authenticateUser --dependents
# Affected tests only
sem impact authenticateUser --tests
# JSON output
sem impact authenticateUser --json
# Disambiguate by file
sem impact authenticateUser --file src/auth.ts
# Include default-excluded paths such as generated, fixture, vendor, benchmark, and build trees
sem impact authenticateUser --no-default-excludes
```
### sem blame
Entity-level blame showing who last modified each function, class, or method.
```bash
sem blame src/auth.ts
# JSON output
sem blame src/auth.ts --json
```
### sem log
Track how a single entity evolved through git history.
```bash
sem log authenticateUser
# Verbose mode (show content diff between versions)
sem log authenticateUser -v
# Limit commits scanned
sem log authenticateUser --limit 20
# JSON output
sem log authenticateUser --json
```
With no entity, `sem log` analyzes recent repo history at the entity level:
**hotspots** (most-changed functions/classes, with author counts) and
**co-change pairs** (entities that repeatedly change in the same commits —
"if you touch one, don't forget the other"):
```bash
sem log # repo hotspots + co-change pairs (last 50 commits)
sem log --limit 200 # deeper history
sem log --file src/auth.ts # scoped to one file
sem log --json # full data
```
### sem entities
List all entities under a file or directory path. No path is the same as `.`.
```bash
sem entities
sem entities .
sem entities src/auth.ts
# JSON output
sem entities --json
sem entities src/auth.ts --json
# Include default-excluded paths such as generated, fixture, vendor, benchmark, and build trees
sem entities --no-default-excludes
```
### sem context
Token-budgeted context for LLMs: the entity, its dependencies, and its dependents, fitted to a strict content token budget.
When the target signature itself does not fit, JSON output reports `target_omitted: true`.
```bash
sem context authenticateUser
# Custom token budget
sem context authenticateUser --budget 4000
# JSON output
sem context authenticateUser --json
# Include default-excluded paths such as generated, fixture, vendor, benchmark, and build trees
sem context authenticateUser --no-default-excludes
```
## Use as default Git diff
Replace `git diff` output with entity-level diffs. Agents and humans get sem output automatically without changing any commands.
```bash
sem setup
```
Now `git diff` shows entity-level changes instead of line-level. No prompts, no agent configuration needed. Everything that calls `git diff` gets sem output automatically. Also installs a pre-commit hook that shows entity-level blast radius of staged changes.
On macOS and Linux, `sem setup` also registers a Claude Code `UserPromptSubmit` hook (`sem hook prompt-submit`) for prompt-time context injection. It edits `~/.claude/settings.json` idempotently, backs it up first, and leaves any hooks you already have untouched.
To disable and go back to normal git diff (also removes the session hooks):
```bash
sem unsetup
```
## Entity-level diffs on every pull request
Add the GitHub Action and every PR gets one sticky comment showing which
functions, classes, and methods changed — updated in place on each push, and
calling out cosmetic-only PRs (formatting/comments) explicitly:
```yaml
# .github/workflows/entity-diff.yml
name: Entity diff
on: pull_request
permissions:
contents: read
pull-requests: write
jobs:
entity-diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Ataraxy-Labs/sem/action@v0.15.1
```
No config, no API keys, never fails your build. See [action/](action/) for details.
## Cloud acceleration (for scale and teams)
Local is always free and always fast — the on-disk index answers day-to-day queries in single-digit milliseconds even from a cold process, so there's nothing to keep warm and no login required. You do not pay to make your laptop fast.
Cloud is for what a laptop can't do. On a very large monorepo the first local graph build can take a few seconds; a shared team graph shouldn't be rebuilt per developer; and CI wants the graph without checking anything out. `sem login` connects those cases to sem cloud, which keeps a warm, pre-built graph for your registered repos and serves the heavy queries fromWhat people ask about sem
What is Ataraxy-Labs/sem?
+
Ataraxy-Labs/sem is subagents for the Claude AI ecosystem. Semantic version control => entity-level diffs, blame, and impact analysis on top of git. 28 languages via tree-sitter. Built for coding agents. It has 3.3k GitHub stars and its last recorded update is dated 2026-08-22.
How do I install sem?
+
You can install sem by cloning the repository (https://github.com/Ataraxy-Labs/sem) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is Ataraxy-Labs/sem safe to use?
+
Our security agent has analyzed Ataraxy-Labs/sem and assigned a Trust Score of 92/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.
Who maintains Ataraxy-Labs/sem?
+
Ataraxy-Labs/sem is maintained by Ataraxy-Labs. The last recorded GitHub activity is dated 2026-08-22, with 9 open issues.
Are there alternatives to sem?
+
Yes. On ClaudeWave you can browse similar subagents at /categories/agents, sorted by popularity or recent activity.
Deploy sem to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/ataraxy-labs-sem)<a href="https://claudewave.com/repo/ataraxy-labs-sem"><img src="https://claudewave.com/api/badge/ataraxy-labs-sem" alt="Featured on ClaudeWave: Ataraxy-Labs/sem" width="320" height="64" /></a>More Subagents
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
The agent that grows with you
Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
The agent engineering platform.
Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.