by FreePeak
LeanKG: Stop Burning Tokens. Start Coding Lean.
# Add to your Claude Code skills
git clone https://github.com/FreePeak/LeanKGLast scanned: 5/30/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-30T15:43:50.096Z",
"npmAuditRan": true,
"pipAuditRan": true
}LeanKG is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by FreePeak. LeanKG: Stop Burning Tokens. Start Coding Lean. It has 210 GitHub stars.
Yes. LeanKG passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/FreePeak/LeanKG" and add it to your Claude Code skills directory (see the Installation section above).
LeanKG is primarily written in Rust. It is open-source under FreePeak on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh LeanKG against similar tools.
No comments yet. Be the first to share your thoughts!
One command — binary, MCP wiring, and agent docs for your tool of choice:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- <target>
| Target | What you get |
|---|---|
cursor |
Binary + MCP + skill + AGENTS.md + session hook |
claude |
Binary + MCP + plugin + skill + CLAUDE.md + hooks |
opencode |
Binary + MCP + plugin + skill + AGENTS.md |
gemini / kilo / antigravity |
Binary + MCP + skill + agent docs |
docker |
Hub image + index + embed + MCP HTTP (no Rust) |
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- cursor
cargo install leankg
# or
git clone https://github.com/FreePeak/LeanKG.git && cd LeanKG && cargo build --release
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/docker-up.sh | bash
curl http://localhost:9699/health
Point your MCP client at http://localhost:9699/mcp. Multi-project RocksDB mounts: AGENTS.md.
Published Hub tags currently target
linux/arm64. Onlinux/amd64, build withdocker compose -f docker-compose.rocksdb.yml up --build.
Installing the binary alone does not connect your agent. Run setup (or use an install target above) so MCP is registered:
leankg setup
This configures Cursor, Claude Code, OpenCode, Gemini, and other supported clients with LeanKG’s MCP server, skills, and hooks where available.
cd your-project
leankg init
leankg index ./src
leankg status
Optional: enable watch mode so the graph stays fresh while you and your agent edit code:
leankg mcp-stdio --watch
leankg impact src/main.rs --depth 3
leankg path "Handler" "Repository"
leankg explain "APIRouter"
leankg graph-query "what connects auth to the database?"
leankg web # UI at http://localhost:8080
Upgrade anytime:
leankg update
When an AI agent needs to understand code, it usually discovers structure the slow way: grep, glob, and Read — one file at a time — rebuilding call paths and dependencies by hand. That is a pile of tool calls and round-trips before the real work starts.
LeanKG hands the agent the exact subgraph it needs. It indexes symbols, edges, tests, docs, and (optionally) embeddings into a local knowledge graph, then exposes them over MCP. Instead of crawling the tree, the agent asks one question and gets back callers, dependents, blast radius, and targeted source — surgical context, not a file-by-file search.
graph LR
A[AI Agent] -->|intent| B[LeanKG MCP]
B --> C[Graph + Embeddings]
C -->|targeted context| A
| Without LeanKG | With LeanKG |
|---|---|
| Grep → open many files → large context | Query the graph → minimal, relevant subgraph |
| No blast-radius awareness | Impact radius with confidence + severity |
| Keyword-only search | Keyword + semantic (HNSW) + ontology |
| Stale mental model of the repo | Index + optional --watch incremental updates |
On cost: LeanKG’s win on every codebase is precision and speed — fewer tool calls, faster answers. Token savings are real and scale-dependent: modest on small repos, material on large monorepos multiplied by team-wide agent usage.
For engineering managers choosing a team-wide stack: LeanKG vs Graphify — Company ROI Brief (token/tool-call floors, multi-repo Docker TCO, mega-graph safety, ops/traceability). The primary adoption lever is always-on graph-first install (curl …/install.sh | bash -s -- cursor or claude) so agents query the graph before grep.
Vector-engine A/B gate (100 tasks, synthetic agent workload vs grep/cat-style baseline) — see docs/benchmarks/vector_engine_gate_results.json:
| Metric | Result | Floor |
|---|---|---|
| Token reduction | −65.0% | ≥ 60% |
| Tool-call reduction | −84.6% | ≥ 80% |
| Speedup | 2.50× | ≥ 2× |
| 1M SQ8 ANN P95 | ~0.055 ms | < 50 ms |
Unified agent A/B (19 cases vs grep baseline): ~30% input token savings, ~3× tokens/result efficiency.
Load test (~100K nodes):
| Operation | Throughput |
|---|---|
| Insert elements | ~57k / sec |
| Insert relationships | ~67k / sec |
| Retrieve elements | ~419k / sec |
| Cache speedup (cold → warm) | 345–461× |
cargo build --release
target/release/leankg benchmark-unified --project .
cargo bench --bench vector_engine_ab
Full methodology: docs/benchmark.md
ontology/workflows.yaml while serving; watcher re-syncs so kg_trace_workflow returns corrected steps without restartimports, calls, tested_by, http_calls, service_calls, tunnels, and more--features embeddings; included in Docker)gitnexus-web (Force / Tree / Circles, filters, search, code panel); data plane is LeanKG /api/* (ui-v2/ + leankg serve)Architecture: docs/architecture.md · MCP catalog: docs/mcp-tools.md · UI v2: ui-v2/README.md