Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/freepeak/leankg/agents-mdgit clone --depth 1 https://github.com/FreePeak/LeanKGWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/freepeak/leankg/agents-md)<a href="https://agentmods.dev/instructions/freepeak/leankg/agents-md"><img src="https://agentmods.dev/badge/instructions/freepeak/leankg/agents-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01827 | $0.01827 |
| Opus 5 | $0.00914 | $0.00914 |
| Sonnet 5 | $0.00365 | $0.00365 |
| Haiku 4.5 | $0.00183 | $0.00183 |
Grade A, and why
LeanKG AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
Health check: `curl http://localhost:9699/health`. If healthy → use Docker MCP. Else → fall back to stdio + host-path `mcp_init`. How it starts
The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LeanKG — Agent Context
Tech stack: Rust + CozoDB + tree-sitter + MCP
Build & Test
cargo build --release # always --release; debug profile has debug=false
cargo test --lib # quick unit tests only (CI does this)
cargo test # full suite including integration/e2e
make lint # = cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all -- --check # formatting check
.opencode.json auto-loads instructions/leankg-tools.md — detailed MCP tool reference.
CLI Quick Reference
| Command | Purpose |
|---|---|
cargo run --release -- init |
Init project |
cargo run --release -- index ./src |
Index codebase |
cargo run --release -- mcp-stdio --watch |
MCP stdio (local AI tools) |
cargo run --release -- mcp-http --port 9699 |
MCP HTTP (remote clients) |
cargo run --release -- embed |
Build embedding vectors (after index) |
cargo run --release -- embed --dry-run |
Export embed queries to .leankg/embed_export.jsonl (offsite/GPU batch — pair with scripts/embed_batch.py + embed --import) |
cargo run --release -- embed --import <file> |
Import vectors produced from a --dry-run export (resumable; --no-verify skips drift check) |
cargo run --release -- serve |
REST API + embedded UI v2 on :8080 |
cargo run --release -- impact <file> <depth> |
Blast radius calc |
cargo run --release -- doctor |
Stale-process / mmap diagnostics |
cargo run --release -- doctor --deep [--format json] [--project PATH] |
Deployment self-diagnosis (H9): PG latency, migrations, index freshness, embeddings coverage, pool env, orphan edges, duplicate names. Exit 0 pass / 1 warn / 2 fail |
Embeddings require --features embeddings build flag (off by default). Without them, semantic_search / kg_semantic_context return "no vectors".
MANDATORY: Docker MCP project paths
When MCP talks to Docker HTTP on :9699, always pass container mount paths as project=. Host paths return "not initialized".
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 120 lines · 1,827 tokens per session scan A bf133219a4e5
LeanKG AGENTS.md is an instructions file published in the GitHub repository FreePeak/LeanKG (215 stars, last pushed 11d ago), licensed Apache-2.0. It adds 1,827 tokens to every session, about $0.0091 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
m_flow AGENTS.md
AGENTS.md instructions for FlowElement-xinliuyuansu/m_flow, covering m-flow — developer & agent reference, 1. repository map, extension points, 2. local development and python backend (requires python 3.10 – 3.13).
omnigraph AGENTS.md
Instructions for ModernRelay/omnigraph, covering omnigraph agent guide, required reading, repository snapshot, documentation map and engineering rules.
samyama-graph CLAUDE.md
Claude Code instructions for samyama-ai/samyama-graph, covering claude.md, project overview, build & development commands, build and run tests (1814 unit tests).
kglite CLAUDE.md
Claude Code instructions for kkollsga/kglite, covering kglite — claude code conventions, build & test, architecture, the boundary principle (wrappers vs core) — summary and in-memory is the core product.
vellis AGENTS.md
Instructions for volantlabs/vellis, covering agents.md, repository purpose, startup checks, installing vellis for a user and model-first component workflow.
kivgraph AGENTS.md
AGENTS.md instructions for Luqueee/kivgraph, covering instrucciones de desarrollo de kivgraph, mapa de instrucciones, identidad del proyecto, qué pregunta contesta cada tool de kivgraph and la puerta delante de grep.