// install
| Use case | Command |
|---|---|
| Any project rec | uv tool install slurp-graph |
| Python project with uv | uv add slurp-graph |
| With pip | pip install slurp-graph |
Using a non-Python project (JS, Go, TypeScript...)? Use uv tool install or pip install — not uv add.
For slurp explain: set ANTHROPIC_API_KEY, OPENAI_API_KEY, run Ollama locally, or use any OpenAI-compatible endpoint. No LLM? Use --no-llm for structural analysis.
// the problem
slurp index maps your entire codebase into a knowledge graph using pure static analysis — no LLMs, no APIs. But injecting every node into every query is wasteful — your LLM spends most of its context budget on nodes it'll never use.
slurp scores each node against your query using PageRank + TF-IDF — zero LLM calls, zero extra tokens spent — and serves only what fits inside your budget.
Benchmark: PrismaStats codebase · 2,111 nodes · "player stats" query
// benchmark
PrismaStats: 2,111 nodes, 69,418 tokens. No mocks.
| Query | Budget | Tokens used | Full graph | Saved |
|---|---|---|---|---|
| "auth flow" | 2,000 | 2,000 | 69,418 | 97.1% |
| "player stats" | 4,000 | 4,000 | 69,418 | 94.2% |
| "database schema" | 8,000 | 8,000 | 69,418 | 88.5% |
Quality benchmark
Honest result: slurp excels at efficiency, not just token savings.
Call graph: Python, TypeScript/JS, Go, Java and Rust with cross-file resolution
PrismaStats: 193 → 488 call edges · createAdminClient: 0 → 97 callers
// zero dependencies
slurp index analyzes your codebase using pure static analysis — no LLMs, no external APIs, zero cost. 16 languages supported: Python, TypeScript/JavaScript, Java, Rust, C#, Ruby, PHP, Kotlin, Scala, Swift, C, C++, Go, Lua, Elixir, PowerShell.
Run it once and start querying immediately. No accounts, no API keys, no cloud.
Install language extras: uv sync --extra java · uv sync --extra rust · uv sync --extra all-languages
// demo
The interactive visualizer shows the subgraph slurp selected — and how much you saved.
Live demo — real PrismaStats codebase, real data. Orange = functions, Blue = classes, Purple = modules.
// architecture intelligence
Call graph
5 languages with cross-file resolution. Return type propagation. 2,273 tests.
slurp explain
Architectural role, risk percentage, explore further suggestions. Structural mode improved — no LLM needed.
slurp eval
Objective quality benchmark with LLM judge. 5× better quality per token proven on real projects.
MCP tools
5 tools: slurp_query, slurp_explain, slurp_impact, slurp_diff, slurp_suggest. Claude Code calls them automatically.
// performance
Optimized at v0.7.0 — measured on a real 2,111-node codebase.
| Optimization | Before | After | Improvement |
|---|---|---|---|
| PageRank cache | 8.32 ms | 0.002 ms | 4000× |
| Token count cache | ~50 ms | 0.174 ms | 280× |
| Greedy heap (O(n log n)) | 63.78 ms | 10.69 ms | 6× |
| End-to-end latency | 86.41 ms | 10.69 ms | 8.1× |
| Graph staleness | silent | auto-reload | ✓ |
Graph changes detected automatically — no server restart needed.
// how it works
Run slurp init — detects your language, indexes your codebase, and configures the MCP server in one step.
One command, no dependencies beyond Python.
slurp index . analyzes your code with pure static analysis — no LLMs, no APIs, no cost.
Keep the graph fresh: re-run slurp index . after big changes · slurp index . --watch for background auto-indexing · add as a GitHub Actions step for CI/CD.
Already indexed? Use slurp index . --smart to update only changed files.
Want to understand your codebase? slurp explain "functionName" explains any function in plain language.
Before editing a file, run slurp impact <file> to see what might break.
Add slurp to your .mcp.json. Claude Code calls it automatically on every query.
Global install:
Python project with uv:
Already using graphify? slurp works with your existing graph.json out of the box.
// features
slurp explain
LLM-powered architecture explanations. What any function does, who calls it, and the risk of changing it. Works with Anthropic, OpenAI, Ollama, or any compatible endpoint.
slurp eval
Quality benchmark with LLM judge. Measures if slurp context improves response quality vs full graph injection. 5× better quality per token proven.
slurp index --smart
Git-aware incremental re-indexing. 21× faster on changed files.
slurp advisor
Recommends optimal token budget from your query history.
Multi-graph federation
Query multiple codebases simultaneously.
Call graph
Python, TypeScript/JS, Go, Java and Rust. Cross-file resolution for all five languages. Accurate blast radius analysis.
slurp impact
Pre-edit blast radius analysis. Know what breaks before you touch a file.
slurp suggest
Query recommendations from the graph frontier. Know what to explore next.
--viz
Interactive subgraph explorer
slurp diff
Compare graph snapshots
slurp benchmark
Measure token savings
--inject-code
Attach source code to nodes
// 1.0.0
slurp 1.0.0 ships with a complete call graph for Python, TypeScript/JS, Go, Java and Rust — with cross-file resolution for all five. slurp explain and slurp diff now tell the truth about your codebase.