| name | sem |
| description | Use sem to get entity-level (function/class/method) semantic diffs, impact analysis, blame, and dependency context from any Git repo. Trigger this skill whenever the user asks what changed in a commit or PR, wants to understand the blast radius of a change, needs to know who last modified a function, wants to trace how a function evolved, or needs structured code context for an LLM task. Also use it proactively when reviewing code, planning refactors, or any time line-level git diff output would be noisy or hard to interpret. |
| license | MIT OR Apache-2.0 |
| compatibility | Requires the sem CLI (https://github.com/Ataraxy-Labs/sem) on PATH and a Git repository |
| metadata | {"homepage":"https://github.com/Ataraxy-Labs/sem"} |
sem — Semantic Version Control
sem extends Git with entity-level operations. Instead of "lines 43-51 changed",
it tells you "function validateToken was modified in src/auth.ts". It parses
30+ languages via tree-sitter and works in any Git repo with no setup.
When to reach for sem
- User asks "what changed in this commit / PR / branch?"
- User wants to know what will break if they change a function
- User asks who last touched a function or class
- User wants to trace how a function evolved over time
- You need structured, token-efficient code context for an LLM subtask
- You're doing a code review and want entity-level signal, not line noise
Commands
sem diff — what changed?
sem diff
sem diff --staged
sem diff --commit abc1234
sem diff --from HEAD~5 --to HEAD
sem diff file1.ts file2.ts
sem diff --format json
sem diff --format markdown
sem diff -v
sem diff --file-exts .py .rs
Change types: added, modified (structural vs cosmetic), deleted,
renamed/moved.
sem impact — blast radius
sem impact validateToken
sem impact validateToken --deps
sem impact validateToken --dependents
sem impact validateToken --tests
sem impact validateToken --json
sem impact validateToken --file src/auth.ts
Use this before refactoring or deleting a function to understand scope.
sem blame — who last touched this?
sem blame src/auth.ts
sem blame src/auth.ts --json
Unlike git blame, this shows who last modified each function, not each line.
sem log — how did this evolve?
sem log validateToken
sem log validateToken -v
sem log validateToken --limit 20
sem log validateToken --json
sem context — token-budgeted LLM context
sem context validateToken
sem context validateToken --budget 4000
sem context validateToken --json
Use this when you need to load a function and its call graph into context
without blowing the token budget.
sem entities — list all entities
sem entities
sem entities src/auth.ts
sem entities --json
sem graph — dependency visualization
sem graph
sem graph src/
sem graph --format json
sem graph --file-exts .py .rs
For a single entity's dependencies/dependents, use sem impact or
sem context instead.
JSON output
All commands support --format json / --json. Prefer JSON when you need to
process results programmatically or pass them to another tool.
{
"summary": { "fileCount": 2, "added": 1, "modified": 1, "deleted": 1 },
"changes": [
{
"entityId": "src/auth.ts::function::validateToken",
"changeType": "modified",
"entityType": "function",
"entityName": "validateToken",
"filePath": "src/auth.ts"
}
]
}
MCP server
Run sem mcp to start the MCP server (stdin/stdout transport). It exposes the
same operations as 6 MCP tools: sem_entities, sem_diff, sem_blame,
sem_impact, sem_log, sem_context. These mirror the CLI exactly. When sem
is configured as an MCP server in the agent, prefer these tools over shelling
out.
Find code you don't know the name of
sem is deterministic by design — no fuzzy ranking. Locate a candidate name with
a plain text search (cheap, one pass), then hand it to sem for the structure
grep can't give:
grep -rn "retry" src/
sem context retry_handler
The sem_entities MCP tool also takes a query argument for the same ranked
search, and sem context <entity> --hops N bounds the context to N graph hops
(use 1-2 for just the immediate neighborhood). Prefer these over grep for
"where is the code that does X".
Install check
sem --version
If there's a conflict with GNU Parallel, add alias sem="$HOME/.cargo/bin/sem"
to the shell profile, or use npx sem / bunx sem if installed via npm/bun.