Install
openclaw skills install slg-cliSemantic 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.
openclaw skills install slg-clislg 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.
npm install -g slg-cli
# or run without installing
npx slg-cli <command>
Use slg when the user:
Index must be built once before searching. Run this in the repo root:
slg init
Re-index after significant new commits:
slg reindex
Check index health:
slg doctor
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.
slg blame src/auth/middleware.ts
slg blame --top 3 src/payments/
Returns contributors ranked by semantic commit weight for the given path.
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.
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.
slg diff HEAD~5..HEAD
slg diff v1.2.0..v1.3.0
slg diff --path src/api/ main~10..main
Generates a semantic summary of what changed across a commit range.
slg revert-risk abc1234
slg revert-risk HEAD~3
Scores how risky it would be to revert a given commit based on downstream dependency analysis.
slg status
slg status --path src/
Shows recent indexed commits and index freshness.
slg ships an MCP (Model Context Protocol) server, letting AI agents query git history directly:
slg serve
# or
slg mcp
Configure 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.
slg why works best with full-sentence natural language questionsslg bisect is most effective when given a behavioral description rather than error text--path to narrow any command to a directory or fileslg doctor if search results seem stale — it reports index coverage and ageslg init may take several minutes; subsequent slg reindex calls are incremental and fast