- name
- slg-git-search
- description
- Semantic git history search and code archaeology. Use when asked why code exists, who owns a file, what introduced a regression, what changed in a commit range, or whether a change is risky to revert.
- version
- 1.0.0
- metadata
- openclaw
- emoji
- 🔍
- homepage
- https://github.com/vrknetha/slg-cli
- requires
- bins
- install
- kind
- node
- package
- slg-cli
- bins
- [slg]
- label
- Install slg-cli (npm global)
SLG — Semantic Git Search
slg is a local-first CLI that builds a semantic index of your git history (embeddings + BM25) so you can ask natural-language questions about who changed what, why, and when. No API keys required — everything runs offline via ONNX Runtime.
Installation
npm install -g slg-cli
# or run without installing
npx slg-cli <command>When to Use This Skill
Use slg when the user:
- Asks why a piece of code exists or was written a certain way
- Wants to know who is responsible for a file or function
- Is tracking down what introduced a bug across many commits
- Needs to understand what changed between two refs or in a range
- Wants to assess how risky reverting a commit would be
- Asks about recent activity on a file or directory
Setup
Index must be built once before searching. Run this in the repo root:
slg initRe-index after significant new commits:
slg reindexCheck index health:
slg doctorCore Commands
Why does this code exist?
slg why "why does the retry logic use exponential backoff"
slg why "what is the purpose of the connection pool size limit"Returns ranked commit results explaining the reasoning behind code decisions.
Who owns a file?
slg blame src/auth/middleware.ts
slg blame --top 3 src/payments/Returns contributors ranked by semantic commit weight for the given path.
Find what introduced a regression
slg bisect "authentication stopped working after the refactor"Narrows down the range of commits most likely to have introduced an issue using semantic search over the message + diff corpus.
Search commit history semantically
slg log "database schema migrations"
slg log --since 2024-01-01 "API rate limiting changes"
slg log --limit 20 "performance optimizations"Returns commits ranked by semantic + BM25 relevance. Supports --since, --until, --limit, and --path filters.
Summarize a diff
slg diff HEAD~5..HEAD
slg diff v1.2.0..v1.3.0
slg diff --path src/api/ main~10..mainGenerates a semantic summary of what changed across a commit range.
Assess revert risk
slg revert-risk abc1234
slg revert-risk HEAD~3Scores how risky it would be to revert a given commit based on downstream dependency analysis.
See recent activity
slg status
slg status --path src/Shows recent indexed commits and index freshness.
MCP Server
slg ships an MCP (Model Context Protocol) server, letting AI agents query git history directly:
slg serve
# or
slg mcpConfigure in your agent:
{
"mcpServers": {
"slg": {
"command": "slg",
"args": ["serve"]
}
}
}Available MCP tools: slg_why, slg_blame, slg_bisect, slg_log, slg_diff, slg_revert_risk, slg_status.
Tips
slg whyworks best with full-sentence natural language questionsslg bisectis most effective when given a behavioral description rather than error text- Prefix path filters with
--pathto narrow any command to a directory or file - Run
slg doctorif search results seem stale — it reports index coverage and age - For large repos (10K+ commits) the initial
slg initmay take several minutes; subsequentslg reindexcalls are incremental and fast