Sverklo
Sverklo is a local-first, open-source code intelligence MCP server that gives AI coding agents deep repo memory and semantic understanding through 37 specialized tools. It supports 12 programming languages and auto-integrates with agents like Claude Code, Cursor, Windsurf, and VS Code.
Search & Discovery
search— Hybrid BM25 + vector + PageRank search without knowing exact stringssearch_iterative/investigate— Multi-hop and fan-out parallel search with RRF fusionask— Natural-language router exercising the full stack in one calllookup— Find any function, class, or type by name (with typo tolerance)refs— All usages of a symbol with dead-code flaggingoverview— Structural codebase map ranked by dependency importanceconcepts/patterns/clusters— LLM-labeled subsystems, design-pattern annotations, and module detection via graph communitiesast_grep— Structural AST pattern matching (e.g. everycatch (e) { return null })wakeup— 500-token codebase summary for when MCP isn't available
Impact & Refactoring
impact— Transitive caller graph (true blast radius before refactoring)deps— File-level import/export dependency graphaudit— One-call health report: god nodes, dead code, circular deps, security smells, A–F grade
Code Review
review_diff— Risk-scored diff review (touched-symbol importance × coverage × churn)diff_search— Semantic search scoped to changed files onlytest_map— Map a git diff to test coverage; flag untested changescritique— Coverage check for an agent's answer; flags missed hubs and stale citationsverify— Confirm cited evidence still matches current code at the current SHA
Bi-temporal, Git-aware Memory
remember/recall/forget— Save, search, and delete decisions/patterns pinned to git SHAspromote/demote— Move memories between auto-injected core tier and archivepin/unpin— Attach memories to file paths or symbol names for automatic surfacingmemories— List all memories with health metrics and conflict detection
Post-filter Primitives (refine previous results without re-querying)
grep_results,head_results,ctx_peek,ctx_slice,ctx_grep,ctx_stats
Index Health & CLI
status— Index health: file counts, languages, memory summary, tool recommendationsCLI tools for running audits, reviews, and prompts;
sverklo audit-diffworks as a pre-commit hook to prevent new circular deps or fan-in spikes
Privacy: All indexing, embedding, and storage happen on-device by default using bundled models and an embedded SQLite database — no data leaves your machine unless you explicitly configure a remote embedding provider.
Integrates with JetBrains IDEs via MCP to give coding agents repo context like symbol relationships and decision history.
Give your coding agent repo memory.
Sverklo gives coding agents repo memory: symbols, callers, diffs, blast radius, and git-pinned decisions before they edit. It is an open-source local-first MCP server for Claude Code, Cursor, Windsurf, Codex CLI, and any MCP-speaking coding agent.
Local-first ◦ MIT ◦ bundled local embeddings by default ◦ remote embeddings only when explicitly configured ◦ telemetry opt-in and off by default
Use Sverklo when your agent needs relationships before editing: callers, dependencies, tests, diff risk, or prior repo decisions.
Use grep/ripgrep when you know the exact string, the repo is tiny, or the change is one file.
Start with the no-write proof command before installing MCP config. The public bench covers 180 hand-verified tasks across 6 OSS codebases; the methodology and ground truth live in sverklo/sverklo-bench. Bench · paper · 90-second demo
cd your-project
npm exec --yes --package=sverklo@latest -- sverklo prove --no-write --guided --markdown
sverklo init --dry-run
npm install -g sverklo && sverklo initsverklo prove --no-write --guided --markdown shows central files, a real symbol with callers, why that proof was selected, the exact prompt to paste into your agent, and a small feedback template before any MCP config or instruction files are written. It may cache the local model/index under ~/.sverklo, but it does not mutate your project. sverklo init --dry-run then previews the files init would touch; sverklo init writes the MCP config for your agent, appends local instructions to AGENTS.md or CLAUDE.md, and runs sverklo doctor to verify the handshake. With the bundled provider, code indexing and embeddings stay on your machine. An explicitly configured remote embedding provider receives the code chunks it embeds.
Need something shareable? Run sverklo prove --no-write --guided --markdown to print a GitHub/Discord-ready proof receipt from your repo, then post it in the proof thread.
Latest no-write proof run: on calesthio/OpenMontage@9066dcb (1,284 indexed files), Sverklo selected ToolResult at tools/base_tool.py:120 and found 475 references across 81 files. The legacy token-efficiency demo on the same checkout used 21.9× fewer estimated input tokens than grep+reading the top 10 matched files, with one miss called out plainly. Read the receipt · OpenMontage discussion
Need local launch planning for the Sverklo account? sverklo marketing runs a local-first Twitter/X agent-team workflow from operator-provided snapshots. It ranks opportunities, drafts seed-content queues, checks profile health, and records human decisions without posting, scraping, replying, liking, reposting, following, or changing the profile.
"The map is not the territory." — Alfred Korzybski
Training data is the map. Your codebase is the territory. Sverklo gives the agent the territory.
Editor shortcuts
If
sverklo provesurfaces useful repo context, please post a receipt, correction, grep-better case, or setup-friction report in the proof thread. If it helped, starring the repo also helps other agent-heavy teams find it.


▶ Watch the 90-second demo on YouTube —
sverklo init→audit→ 37 MCP tools → live Claude Code integration with blast-radius and symbol-graph traversal.

2026-05-04 — v0.20.2: parser brace-counter + lookup exact-match fixes. Lodash P1 0/10 → 9/10. Overall F1 0.45 → 0.56 (now leader on the public bench). release notes
2026-05-04 — Bench expanded to 3 datasets, 5 baselines, 90 tasks. Lodash 4.17.21 added per #26. sv-p5 ground truth refined per #27.
2026-05-03 — v0.20.1:
sverklo receiptships — token-spend summary parsed from~/.claude/projects/**/*.jsonl. why we built it2026-05-02 — Bench-as-feedback-loop story: 5-baseline expansion exposes blind spots on both sides of the bench. issue #25
2026-05-01 — MCP STDIO command-injection audit: the class Anthropic won't patch, and the 30-second audit any maintainer can run.
Why
Your AI agent edits UserService.validate(). It doesn't know 47 other functions call it. It hallucinates getUserByEmail() because that's how its training data spelled it — your code uses findByEmail(). It forgets the design decision you made yesterday because context was compacted. Tests pass because they mock the dependency. Breaking changes ship.
Sverklo drills into your repo before the agent does — symbol graph, blast radius, semantic recall, and git-pinned memory — so the agent reasons about your code instead of pattern-matching from training data.
cd your-project
npm exec --yes --package=sverklo@latest -- sverklo prove --no-write --guided
sverklo init --dry-run
npm install -g sverklo && sverklo initThat's it. sverklo prove --no-write --guided gives you the first useful repo-memory proof from your own codebase before project config changes; sverklo init --dry-run previews every setup target; sverklo init auto-detects your installed AI coding agent (Claude Code, Cursor, Windsurf, Zed), writes the right MCP config, appends instructions to AGENTS.md if present (otherwise CLAUDE.md), and runs sverklo doctor to verify the setup. sverklo prove --markdown makes that proof shareable in the public proof thread. Works on macOS, Linux, and Windows. Bundled local embeddings by default. Remote embeddings only when explicitly configured. Telemetry opt-in and off by default.
The bundled embedding model (
all-MiniLM-L6-v2ONNX, ~86 MB) is downloaded from HuggingFace on first use into~/.sverklo/models/. After that download, the bundled embedding provider can run from the cached local model. An explicitly configured remote provider uses its remote endpoint instead.
Want proof before installing? Browse the /report leaderboard — Sverklo audits of 47 popular OSS repos (express, react-hook-form, vite, lodash, prisma, …) with grade cards for dead code, circular deps, coupling, and security.
Related MCP server: uacos
"But isn't this just…?"
Likely you've seen tools that look adjacent. The honest one-paragraph answers, with detailed comparisons linked.
…just grep with extra steps? No, but tuned grep is genuinely competitive when you know the exact string. On the 180-task bench, sverklo leads overall F1 (0.58 vs smart-grep's 0.34) while using about 35× fewer input tokens than naive grep and one tool call per task. For an AI agent inside a 200K context window, that's the load-bearing axis. For a human at a terminal, grep is still fine.
…just Sourcegraph Cody? Same retrieval surface (hybrid BM25 + vector + graph), different deployment model and license. Cody is source-available with enterprise per-developer pricing ($9-19/dev/mo); sverklo is MIT and runs on a laptop with no signup. Full comparison →
…just Greptile? Greptile is a hosted PR-review bot ($30/dev/mo). Sverklo is local-first MCP. Same risk-scoring goal, opposite deployment model. If your code can't leave the machine for compliance reasons, Greptile isn't an option. Full comparison →
…just Cursor's @codebase? Cursor's indexing is cloud-based and editor-bound. Sverklo runs alongside Cursor as an MCP server, adding the symbol graph, blast-radius, and bi-temporal memory that Cursor's @codebase doesn't expose. Full comparison →
…just Claude Context (Zilliz)? Claude Context requires a Milvus database. Sverklo runs entirely on embedded SQLite — no extra services to manage. Full comparison →
…just Aider's repo-map? Aider's repo-map is a static signal in the system prompt — fine for small repos, doesn't scale past ~100 files. Sverklo is the queryable retrieval layer Aider can call via MCP for larger codebases. They're complementary, not competing. Full comparison →
…a niche memory MCP? Most memory MCPs are wrappers around an external vector DB. Sverklo's memory is bi-temporal (valid_from_sha, valid_until_sha, superseded_by) and pinned to git SHAs, so you can ask "what did this team believe about auth at commit abc123?" and get the answer that was true then. Full comparison vs codebase-memory-mcp →
…what about Aider, Continue, Codex CLI, Claude Code? Those are agents — they generate and apply edits. Sverklo is the retrieval layer the agent calls before writing code. Use both. sverklo init auto-detects which agents you have →
If something is missing here that you'd ask about, open an issue — I'll add it.
What's new in 0.20
Contradiction detection on the bi-temporal memory layer.
memories mode:"conflicts"surfaces pairs of active memories that share a pin (file path or symbol name) and may contradict — e.g., "JWT in middleware" vs "JWT in route handler" both pinned tosrc/auth.ts. Restricted to decision/preference/pattern categories (procedural/context are additive, not contradicting). Same-SHA pairs are skipped. Sorted by shared-pin count and age. Conservative by design: surfaces candidates for the agent or human to review, not auto-resolution. The bi-temporal model already preserved both sides of the contradiction; this just makes them findable.
What's new in 0.19
C# (.cs) language support — community contribution by @NerdChieftain in #22. Tree-sitter (when grammar installed) plus a regex fallback parser. Indexes namespaces (block-scoped + C# 10+ file-scoped), classes, structs, records (plain /
record class/record struct), interfaces, enums, methods, constructors, andusingdirectives. Addstree-sitter-c-sharp@0.23.5WASM grammar to the install set. Sverklo now supports 12 languages.
What's new in 0.18
Vue.js (.vue) support. Single-file components are now first-class: the
<script>block parses through the existing TS/JS pipeline (with line remapping back to the SFC), Composition API helpers (ref,computed,reactive,defineProps, …) are indexed as symbols, and PascalCase template tags emit relative imports so PageRank sees component graphs. Also fixes a preexisting TS bug whereimport type { X } from 'y'was missed.AGENTS.md aware
sverklo init. When AGENTS.md exists, the prefer-sverklo block is appended there instead ofCLAUDE.md.sverklo doctorflags drift between the two files so multi-agent setups stay in sync.Windows pathing fixed.
sverklo initandsverklo doctornow work on Windows — absolute paths go throughpath.basename()and storedrelativePathis normalized to forward slashes so every downstream consumer is cross-platform.npm run bench:swe— third-party-reproducible cross-repo eval. Clones 5 OSS repos (express, nestjs, vite, prisma, fastapi), runs 65 grounded questions, prints aggregated recall. PRs that add questions are welcome.Tree-sitter parser opt-in.
sverklo grammars install(~3.5 MB across 6 languages) +SVERKLO_PARSER=tree-sitterroutes the indexer through real ASTs for TypeScript/TSX/JavaScript/Python/Go/Rust. Silent regex fallback when grammars aren't installed. Plan to flip the default lives in docs/parser-parity.md.Workspace shared memory.
sverklo workspace memory <name> add/list/searchplusremember scope:"workspace"from the agent — write a decision once, query it from every other repo in the workspace.recallblends workspace results under project ones with a[ws]badge.sverklo memory export— markdown / Notion / JSON. Migrate your team's decision log to wherever it actually lives.PR-bot inline review.
sverklo review --format github-review-json+ the action's newinline-comments: truedefault posts per-line review comments viapulls.createReview, alongside the existing sticky summary.VS Code extension scaffold at
extensions/vscode/with a pre-builtsverklo-vscode-0.1.0.vsix. Inline caller-count decorations on every function header (⟵ 47 callers). Marketplace publish workflow ships dormant; install withcode --install-extension extensions/vscode/sverklo-vscode-0.1.0.vsixtoday.sverklo digest [--since 7d]— 5-line summary of audit-grade trend, new vs stale memories, and high-PageRank files touched. Wire into a shell-hook oncdfor a daily sverklo check-in.
Grep vs Sverklo — the same question, side by side
Every one of these is a query a real engineer asked a real AI assistant last week. Grep gives you lines. Sverklo gives you a ranked answer.
The question | With Grep | With Sverklo |
"Where is auth handled in this repo?" |
|
|
"Can I safely rename |
|
|
"Is this helper actually used anywhere?" |
|
|
"What's load-bearing in this codebase?" |
|
|
"Review this 40-file PR — what should I read first?" | Read them in the order git diff printed them |
|
If the answer to your question is "exact string X exists somewhere," grep wins. Use grep. If the answer is "which 5 files actually matter here, ranked by the graph," you need sverklo.
Works with every MCP editor
Editor | MCP | Skills | Hooks | Auto-setup |
Claude Code | yes | yes | yes |
|
Cursor | yes | — | — |
|
Windsurf | yes | — | — |
|
Zed | yes | — | — |
|
VS Code | yes | — | — | manual |
JetBrains | yes | — | — | manual |
Antigravity | yes | — | — |
|
Codex CLI | yes | — | — |
|
GitHub Copilot CLI | yes | — | — |
|
Any MCP client | yes | — | — |
|
Hero tools
Tool | What it does |
| Hybrid BM25 + vector + PageRank search. Find code without knowing the literal string. |
| All references to a symbol, with caller context. Flags likely dead-code candidates from the current reference graph. |
| Walk the symbol graph, return ranked transitive callers — the real blast radius. |
| Risk-scored review of |
Pre-commit gate — block architectural regressions before they ship
sverklo audit-diff is a local-first incremental quality gate. It reads git diff, runs Tarjan SCC over the modified files' boundary subgraph, and exits non-zero if your diff introduces a new circular dependency or pushes a file's fan-in past the threshold. Designed to run as a .git/hooks/pre-commit step — typical run completes well under 200 ms.
# manual
sverklo audit-diff
echo $? # 0 = clean, 1 = gate failure, 2 = config error
# CI variant
sverklo audit-diff --format json | jq .passWire it as a pre-commit hook (plain git):
cat > .git/hooks/pre-commit <<'EOF'
#!/usr/bin/env bash
set -e
sverklo audit-diff
EOF
chmod +x .git/hooks/pre-commitHusky variant:
npx husky add .husky/pre-commit "sverklo audit-diff"Pre-existing cycles and fan-in spikes don't trip the gate — only violations introduced by your diff. To inspect legacy debt: sverklo audit-diff --show-existing (exit code is unchanged).
Search — find code without knowing the literal string
Tool | What |
| Hybrid BM25 + ONNX vector + PageRank, fused with Reciprocal Rank Fusion |
| Wider candidate pool with refinement hints between rounds |
| Parallel multi-channel fan-out (FTS / vector / path / symbol) with per-channel RRF |
| Natural-language router — concepts + investigate + refs in one call |
| Structural codebase map ranked by PageRank importance |
| Find any function, class, or type by name (typo-tolerant) |
| One-call onboarding — combines overview, code, and saved memories |
| Structural pattern matching across the AST, not just text |
| Browse the LLM-derived concept index (themes across the codebase) |
| Semantic clusters of related symbols, computed offline |
| Query symbols tagged with a design pattern (observer, repository, validator, ...) |
Impact — refactor without the regression
Tool | What |
| Walk the symbol graph, return ranked transitive callers (the real blast radius) |
| Find all references to a symbol, with caller context |
| File dependency graph — both directions, importers and imports |
| Lint your codebase for AI-readiness. God nodes, hub files, dead code, circular deps, security smells, A-F health grade — all in one call |
Review — diff-aware MR review with risk scoring
Tool | What |
| Risk-scored review of |
| Second-pass critique of a review — what did the first read miss |
| Which tests cover which changed symbols; flag untested production changes |
| Semantic search restricted to the changed surface of a diff |
| Verify a quoted code span is still present at the cited SHA — citation gate |
Memory — bi-temporal, git-aware, never stale
Tool | What |
| Save decisions, patterns, invariants — pinned to the current git SHA |
| Semantic search over saved memories with staleness detection |
| List all memories with health metrics (still valid / stale / orphaned) |
| Delete a memory |
| Move memories between tiers (core / archive) |
| Pin a memory to a file path or symbol so recall surfaces it without semantic search |
Post-filter primitives — refine the last response without re-querying
Tool | What |
| Grep inside the previous result block instead of re-running the search |
| Take the first N hits from the previous response |
| Peek at a referenced span by its handle without expanding it fully |
| Slice a stored response by line range |
| Grep within a stored context window |
| Token-budget stats for stored response handles |
Index health
Tool | What |
| Index health check, file counts, last update |
| 500-token codebase summary for system prompts on agents that can't run MCP |
When to reach for sverklo — and when not to
We're honest about this. Sverklo isn't a magic 5x speedup and it doesn't replace grep. It's a sharper tool for specific jobs.
When sverklo earns its keep:
You don't know exactly what to search for
You need to prove dead code (zero references across the whole symbol graph)
You need the blast radius of a refactor before you start
You're reviewing a large PR and need to know what to read first
When grep is still the right tool:
Exact string matching — "does this literal string exist?"
Small codebases under ~50 source files — just read everything
Single-file diffs —
git diff+Readis hard to beatBuild and test verification — only
Bashrunsnpm test
If a launch post tells you a tool is great for everything, close the tab.
Common questions
How do I stop Claude Code from hallucinating about my codebase?
Claude generates code from training-data patterns, not your repo. Without a symbol graph, it invents getUserByEmail() when your code uses findByEmail(). Sverklo grounds the agent in your actual symbol graph — lookup and refs resolve names to file:line and prove existence before the agent writes the call. Verifiable retrieval (verify) lets the agent re-check that a quoted span is still present at the cited SHA, so a stale citation gets caught instead of confabulated.
Is there a local-first MCP server for codebase memory?
Yes — sverklo. remember and recall ship a bi-temporal memory layer: every memory is pinned to the git SHA it was authored on, and valid_until_sha + superseded_by preserve a timeline of supersessions instead of overwriting. Recall defaults to hybrid FTS5 + cosine over the bundled ONNX embedding model, with its index stored in embedded SQLite. No external vector database is required. An explicitly configured remote embedding provider receives the text it embeds.
Is there an open-source alternative to Sourcegraph Cody I can run locally?
Sverklo is the open-source local alternative to Sourcegraph Cody for codebase Q&A: hybrid BM25 + vector + PageRank retrieval, symbol-graph navigation, MIT-licensed instead of source-available, single-machine instead of Cody's enterprise deployment, and free instead of $9–19 per developer per month. Sverklo doesn't try to ship the same feature set — it's a primitives layer for AI coding agents (37 MCP tools), not a hosted IDE plug-in — but for the "give the agent semantic understanding of my codebase" job, it covers the same surface.
Where does my code go when I use sverklo?
By default, Sverklo indexes locally with embedded SQLite and the bundled ONNX embedding model. The model is downloaded from HuggingFace on first use (~86 MB), then cached in ~/.sverklo/models/. If you explicitly select a remote embedding provider, Sverklo sends that provider the code chunks it needs to embed; the index remains local. Telemetry is separate, opt-in, and off by default. Its fixed event schema excludes code, queries, file paths, symbol names, and memory contents.
Does sverklo work with Cursor's @codebase or Cursor Tab?
Sverklo runs alongside Cursor's built-in indexing rather than replacing it. Cursor's @codebase ships embedding-based search inside the IDE; sverklo adds the symbol graph, blast radius, diff-aware risk-scored review, and bi-temporal memory that Cursor doesn't expose. Wire sverklo as an MCP server in Cursor and both layers are available to the agent simultaneously. The same setup works for Claude Code, Windsurf, Zed, Antigravity, and anything else that speaks MCP.
Three retrieval techniques you'll only find here
Most code-search MCPs are a single BM25 + vector RRF on top of Milvus or pgvector. Sverklo's recall is built on three named moves that work because they exploit codebase structure, not just text similarity. Each one was added to close a real recall failure on real questions; together they're the reason sverklo's research benchmark hits 99% recall (31 of 32) without a managed vector database.
1. Filename-as-signal retrieval
When a query token matches a filename — even when the body of that file doesn't FTS-match — sverklo pulls every named definition in that file into the candidate set. Conversely, when FTS surfaces a file at all (because of a comment hit, an import line, anything), every definition in that file becomes a plausible answer. This is the single move that closes the "private helper function" gap: the function is too short for embeddings to disambiguate and uses a name no one would grep for, but it lives next to the code that does match. Implemented in src/search/investigate.ts (runDefinitionsByPathTokens, runDefinitionsInFtsFiles).
2. Channelized RRF fusion
Most hybrid retrievers run one Reciprocal Rank Fusion over fts ∪ vector and call it a day. Sverklo runs RRF per channel — FTS, vector, doc-section, path, symbol-name — then fuses the per-channel ranks with channel-specific weights. The path channel is weighted 1.5× because filename matches are precision-skewed; doc chunks score in their own channel so a 200-line markdown section can't drown a 4-line function body. This is structural retrieval, not just lexical-vs-semantic. Implemented in src/search/investigate.ts (per-channel RRF + weighted fusion).
3. Bi-temporal memory with superseded_by lineage
Every memory carries valid_from_sha and valid_until_sha. Updating a memory doesn't overwrite — it inserts a new row, sets valid_until_sha on the old one, and links them via superseded_by. Recall queries naturally exclude invalidated rows, but the timeline view keeps everything, so you can ask "what did this team believe about the auth flow at commit abc123?" and get the answer that was true then. sverklo prune consolidates clusters of similar episodic memories into one semantic note while preserving the lineage. Implemented across src/storage/memory-store.ts and src/memory/prune.ts.
How It Works
Your codebase Agent query
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Parse │ tree-sitter (12 langs) or │ Tool call │
│ chunks │ regex fallback │ (1 of 37) │
└──────┬──────┘ └──────┬──────┘
│ │
├─────────────┐ Index time │
│ │ │
▼ ▼ │
┌────────┐ ┌─────────┐ │
│ Embed │ │ Import │ │
│ ONNX │ │ graph │ │
│ MiniLM │ │ + PageRank │
└───┬────┘ └────┬────┘ │
│ │ │
▼ ▼ │
┌──────────────────────────┐ │
│ SQLite + sqlite-vec │ ← single-file index, ~/.sverklo/ │
│ chunks · embeddings · │ │
│ symbols · refs · imports │ │
│ memories (bi-temporal) │ │
└────────────┬─────────────┘ │
│ │
│ Query time │
▼ ▼
┌──────────────────────────────────────────────────────────┐
│ Channelized RRF retrieval │
│ │
│ FTS · Vector · Doc-section · Path · Symbol-name │
│ └─ each ranked independently ─┘ │
│ │
│ Fused with channel weights (path 1.5×, doc 0.7×, …) │
└─────────────────────────┬────────────────────────────────┘
│
▼
┌────────────────────────┐
│ Token-budgeted answer │ ← the agent gets
│ file:line + chunk │ ranked code, not
│ + provenance │ a wall of text
└────────────────────────┘Parse your codebase into functions, classes, types (TS, JS, Vue, Python, Go, Rust, Java, C, C++, Ruby, PHP, C#)
Embed code using all-MiniLM-L6-v2 ONNX (384d, bundled and local by default), a local Ollama model, or an explicitly selected remote provider that receives the code chunks it embeds
Graph dependencies and compute PageRank (structurally important files rank higher)
Retrieve via channelized RRF — per-channel rank fusion with channel-specific weights, the architectural choice that closes the private-helper-function recall gap
Remember decisions across sessions, pinned to git SHAs (bi-temporal memory)
Watch for file changes and re-index incrementally (~1 s per edit)
Performance
Real measurements on real codebases. Reproducible via npm run bench (methodology).
Repo | Files | Cold index | Search p95 | Impact analysis | DB size |
99 | 10 s | 12 ms | 0.75 ms | 4 MB | |
1,709 | 22 s | 14 ms | 0.88 ms | 11 MB | |
4,368 | 152 s | 26 ms | 1.18 ms | 67 MB |
Search p95 stays under 26 ms even on a 4k-file monorepo
Impact analysis is sub-millisecond — indexed SQL join, not a string scan
24 languages: 10 first-class structural parsers plus 14 regex-fallback languages
Retrieval benchmark — bench:primitives
Hybrid retrieval F1 vs grep baselines on a 180-task hand-verified evaluation across six OSS codebases (express, lodash, sverklo, requests, flask, fastapi). Public report at sverklo.com/bench/ — including every slice where sverklo loses. Methodology repo: github.com/sverklo/sverklo-bench.
Latest published 180-task run (sverklo v0.20.21, May 2026):
baseline | F1 | avg input tokens | tool calls |
naive-grep | 0.25 | 22,704 | 6.3 |
smart-grep (tuned) | 0.34 | 714 | 3.2 |
jcodemunch-mcp | 0.29 | 1,907 | 1.2 |
GitNexus | 0.30 | 630 | 1.2 |
sverklo | 0.58 | 652 | 1.0 |
Sverklo leads overall F1, dominates P4 file-dependency questions, and keeps the honest loss slice visible: dead-code detection is where grep-style baselines remain strongest. Token economy: about 35× fewer input tokens than naive grep, with a single tool call per task.
Reproduce: npm run bench:quick. Filter with BASELINES=sverklo,jcodemunch DATASETS=express npm run bench:quick.
Submitting a baseline? Open a PR adding benchmark/src/baselines/<your-tool>.ts — auto-bench CI runs on the PR (express dataset, ~10 min) and posts a results-table comment back. See .github/workflows/auto-bench.yml.
Quick Start
Three ways to install. Pick whichever matches your setup.
Click the badge for your editor. Cursor / VS Code prompt to confirm, then sverklo's MCP config is written automatically. Restart the editor and the 37 tools appear in the tool list. No npm install required — npx resolves it on first use.
cd your-project
npm exec --yes --package=sverklo@latest -- sverklo prove --no-write --guided
sverklo init --dry-run
npm install -g sverklo && sverklo initStart with proof, then wire the agent. sverklo prove --no-write --guided prints central files, a real caller graph, why that symbol was selected, and a prompt to paste into your agent without writing MCP config or instruction files. sverklo init --dry-run previews setup targets. sverklo init auto-detects which AI coding agents you have (Claude Code, Cursor, Windsurf, Zed, Antigravity) and writes the right MCP config files. Add --markdown or --receipt for a shareable proof artifact, then post it in the proof thread. Idempotent — safe to re-run. If sverklo doesn't appear in your agent after restart, run sverklo doctor --agent claude or the matching agent name.
Per-agent config locations (sverklo init writes these for you):
Claude Code:
.mcp.jsonat project root + appends toCLAUDE.md(orAGENTS.mdif present)Cursor:
.cursor/mcp.jsonWindsurf:
~/.windsurf/mcp.jsonVS Code:
.vscode/mcp.jsonJetBrains: Settings → Tools → MCP Servers
Antigravity:
~/.gemini/antigravity/mcp_config.json(global; re-runsverklo initper project)
For agents we don't auto-detect, drop this in their MCP config:
{
"mcpServers": {
"sverklo": {
"command": "/full/path/to/sverklo",
"args": ["."]
}
}
}Use the full binary path (which sverklo) — some clients spawn subprocesses without inheriting $PATH.
git clone https://github.com/sverklo/sverklo.git
cd sverklo
npm install
npm run build
npm link
sverklo init # in your project directoryUse this if you're contributing, debugging the indexer, or want to run a not-yet-published build. The npm link step makes sverklo resolvable globally from the local checkout.
To run the bench:
npm run bench:quickOutput lands in benchmark/results/<timestamp>/.
Git worktrees
Yes, sverklo works with git worktree. Run sverklo init inside each worktree — that gives you per-worktree isolation:
Index lives at
~/.sverklo/<basename>-<hash>/index.db, keyed by absolute path. Two worktrees of the same repo → two independent databases.Memory journal lives at
<worktree>/.sverklo/memories.jsonl, inside the worktree itself. Bi-temporal SHA pinning means each memory still answers "what was true at commit X?" correctly across branch switches within one worktree..gitlinkfile: nothing special needed. Sverklo shells out togitwithcwd: rootPath; git CLI handles the worktree linkfile transparently.MCP config: keep
args: ["."]from the worktree root (the defaultsverklo initwrites). Pointing at the main checkout from a worktree would defeat per-branch isolation.Multiple concurrent Claude Code sessions across different worktrees: safe by default. Different rootPaths = different DB files = no contention.
sverklo init adds .sverklo/ to your .gitignore automatically so the per-worktree journal doesn't get committed.
Any MCP client (one-shot via npx)
npx sverklo /path/to/your/projectNo global install needed. npx resolves and runs sverklo on first call. Use this in CI, ephemeral sandboxes, or any host where you don't want a global install.
Claude Code plugin marketplace
Inside Claude Code:
/plugin marketplace add github:sverklo/sverklo
/plugin install sverklo-skill@sverklo-marketplaceInstalls the bundled Skill (procedural instructions teaching Claude when to reach for search, impact, review_diff, remember, etc.) without touching your global skills directory.
First run note: The bundled ONNX embedding model (~90 MB) downloads automatically on first launch. It takes ~30 seconds; after that, the bundled embedding provider can run from the cached local model.
Why not... (as of 2026-04)
Alternative | Local | OSS | Code search | Symbol graph | Memory | MR review | License | Cost |
Sverklo | yes | yes MIT | hybrid + PageRank | yes | git-aware | risk-scored | MIT | $0 |
Built-in grep / Read | yes | yes | text only | no | no | no | varies | $0 |
no (cloud) | no | yes | partial | no | no | proprietary | with Cursor sub | |
no (cloud) | no | yes | yes | no | partial | source-available | $9-19/dev/mo | |
no (Milvus) | yes | vector only | no | no | no | MIT | $0 + Milvus | |
yes | yes | no | basic | no | no | Apache 2.0 | $0 | |
no (cloud) | no | yes | yes | no | yes | proprietary | $30/dev/mo |
Lint for AI-readiness — sverklo audit
Most lints check syntax. sverklo audit lints whether your codebase is legible to an AI agent: high blast-radius "god nodes" the agent will trip on, hub files that cascade widely on every change, orphan symbols that might be dead code or might be public API, circular dependencies that confuse the symbol graph, and a security smell scan. Outputs an A-F health grade you can pin as a README badge.
sverklo audit # markdown report in the terminal
sverklo audit --format html --open # self-contained HTML you can share
sverklo audit --badge # A-F shield markdown for your README
sverklo audit --format sarif # GitHub code-scanning alerts
sverklo audit --format json # machine-readable for CI gatesSix formats: markdown, html, json, sarif, csv, badges. Pair with impact (the MCP tool) when you want to see the per-symbol blast radius before refactoring.
CLI tools
Sverklo ships a CLI for CI and local use: sverklo review --ci --fail-on high for risk-scored diff review (auto-detects PR ref in GitHub Actions), sverklo audit for codebase health reports, and a GitHub Action that posts review comments on PRs. Run sverklo audit-prompt or sverklo review-prompt to get battle-tested workflow prompts you can paste into any agent.
Claude Code hooks recipe
Sverklo plays well with Claude Code hooks. The simplest hook to wire is a post-tool-use review: after Claude makes file edits, run sverklo review against the working tree and surface any high-risk findings in the agent transcript. Add this to ~/.claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "sverklo review --ref HEAD --format json --fail-on high || true"
}
]
}
]
}
}The trailing || true keeps the hook from blocking edits when sverklo isn't installed or the working tree has no diff yet. For project-scoped hooks, put the same block in .claude/settings.json at the repo root instead.
Telemetry
Opt-in and off by default. When telemetry is disabled, it sends nothing. If you opt in, it sends only anonymous usage metrics (no code, queries, file paths, symbol names, or memory contents). Telemetry is separate from the bundled model's first-use download and any explicitly configured remote embedding provider. Full schema and implementation details are in TELEMETRY.md.
Open Source, Open Core
The full MCP server is free and open source (MIT). All 37 tools, no limits, telemetry opt-in and off by default, no "free tier" — that's not where the line is.
Sverklo Pro (later this year) adds smart auto-capture of decisions, cross-project pattern learning, and larger embedding models. Sverklo Team adds shared team memory and on-prem deployment.
The open-core line: Pro adds new things, never gates current things. Anything in the OSS server today stays in the OSS server forever.
Links
Citing Sverklo
If you use Sverklo or its benchmarks (bench:primitives, bench:swe) in research, please cite:
Groshin, N. (2026). Sverklo: A Local-First Code Intelligence MCP Server and a Cross-Repository Software Engineering Benchmark. Zenodo. https://doi.org/10.5281/zenodo.19802051
BibTeX:
@misc{groshin2026sverklo,
author = {Groshin, Nikita},
title = {{Sverklo}: A Local-First Code Intelligence {MCP} Server and a Cross-Repository Software Engineering Benchmark},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.19802051},
url = {https://doi.org/10.5281/zenodo.19802051}
}Star history
If sverklo saved your AI from inventing function names that don't exist in your codebase, the most useful thing you can do is ⭐ star this repo and share with one teammate.
License
MIT
Available Tools
36 toolsaskA
Natural-language router over sverklo's existing primitives. Maps a question to (a) the closest concept (if the concept index exists), (b) an investigate fan-out, and (c) refs/impact on the top symbols surfaced. Returns a structured answer with evidence — no generated prose. Use when you want a single keystroke that exercises the whole stack; for fine-grained control prefer search / investigate / refs.
Inputs: query (required), mode, scope.
ast_grepA
Find code by AST shape, not text — e.g. 'every console.log($X)', 'every catch (e) { return null }'. Requires ast-grep on PATH. Pick this over search when you need exact structural matches (consistent transformations, lint-style queries) and over Grep when you need to ignore identifier names or whitespace. Falls back to a clear error if ast-grep is missing.
Inputs: pattern (required), path, language.
auditA
One-call codebase health report: god nodes (highest blast-radius symbols), hub files (highest PageRank), orphan symbols (likely dead code), and language/memory stats. Use as the seed for a code-quality pass — pair with impact for blast-radius and deps for fan-in/fan-out. Cheaper than running overview + impact + dependencies separately.
Inputs: token_budget.
clustersA
Group files into modules by graph-community detection (label propagation over the import graph). Returns 3+ file clusters with their hub file. Use this on first contact with an unfamiliar repo — pair with concepts (after running sverklo concept-index) for an LLM-named summary of each cluster. Skip if the codebase has fewer than ~20 source files; structure won't be informative.
Inputs: min_size.
conceptsA
Semantic search over LLM-labeled subsystem concepts. Returns the clusters whose label/summary best matches the query, along with each cluster's hub file. Requires the concept index to have been built: run sverklo concept-index once per repo. If no index exists, returns a helpful bootstrapping message.
Inputs: query (required), limit.
contextA
Umbrella context bundler. Give a task description and get a single curated bundle: codebase overview header, semantically relevant code, related symbols, and matching saved memories — in one round trip. Use this as the FIRST call when you start working on a new task and want to orient quickly. PASS budget for a PageRank-pruned repo map fit to a token budget — the ideal way to give an agent a complete mental model of an unfamiliar codebase in one call.
Inputs: task, scope, budget, exclude, +1 more.
critiqueA
Deterministic coverage check for an agent's answer. Takes the evidence ids the agent cited plus the symbols it discussed; verifies each evidence is still current and flags whether the answer missed high-PageRank hubs, symbol definitions, or related doc mentions. Returns a structured critique — no LLM call on the server side.
Inputs: evidence_ids (required), claim, symbols.
ctx_grepA
Filter the result blocks of a context handle by regex. Operates on the cached body — no second retrieval. Returns the narrowed body inline.
Inputs: uri (required), pattern (required), head.
ctx_peekA
Return a byte-slice from a single result block of a prior tool call. Use when the agent needs to inspect a specific offset without the full body.
Inputs: len (required), offset (required), hit_index (required), response_id (required).
ctx_sliceA
Return a byte-slice of a context handle (ctx:///). Use to drill into the body without rerunning the original retrieval. Returns 'expired' if the handle's pinned SHA no longer matches.
Inputs: uri (required), length, offset.
ctx_statsA
Inspect a context handle without consuming it: tool, age, block count, byte size, fresh/expired.
Inputs: uri (required).
demoteA
Demote a memory from core to archive tier. Archive memories are only retrieved on demand via recall — not automatically injected. Use for memories that no longer need to be in every session.
Inputs: id (required).
depsB
Show what a file imports/depends on and what depends on it. Helps understand the impact of changing a file.
Inputs: path (required), depth, direction, token_budget.
diff_searchA
Semantic search scoped to files in a git diff (and optionally their dependency closure). Use this when reviewing an MR/PR and you need to find code related to a query — but only within the changed files, not the entire codebase. Cuts noise from global search and lets you ask questions like 'find all lock acquisitions in the changed files' or 'where do these new functions get called from existing code'.
Inputs: query (required), ref, type, token_budget, +1 more.
forgetA
Permanently delete a memory after recall returned a stale or wrong entry. Prefer remember (with the new content) over forget+remember when superseding a decision — supersession preserves the audit trail via valid_until_sha + superseded_by; forget loses it. Get IDs from recall or memories.
Inputs: id (required).
grep_resultsA
Filter the result blocks of a prior sverklo tool call by a regex pattern — operates on the cached text so no second retrieval happens. Pass the response_id returned on any search/refs/impact call.
Inputs: pattern (required), response_id (required).
head_resultsA
Keep only the top N result blocks of a prior sverklo tool call. Cheap way to shrink a chatty response when you just need the top hit.
Inputs: n (required), response_id (required).
impactA
Refactor blast-radius: callers of a symbol with confidence scoring. Run before editing. Use cross_repo:true to see impact across linked projects in a workspace.
Inputs: symbol (required), limit, cross_repo, partition_threshold.
investigateA
Single-call research primitive: fans out to BM25, embeddings, symbol lookup, and reference-expansion in parallel; RRF-fuses the candidates; returns one ranked bundle with per-hit provenance (which retriever(s) found it). Cheaper than running search + refs + lookup back-to-back. WORKS WELL for open-ended questions where you don't yet know whether the answer lives in code, callers, or documentation — the found_by tags tell you which signal agreed. Use search instead when you already know you want pure text/semantic retrieval.
Inputs: query (required), repo, scope, budget, +2 more.
lookupA
Look up a specific symbol (function, class, type, variable) by name. Returns its full definition, signature, and location.
Inputs: symbol (required), repo, type, token_budget.
memoriesA
List all memories for the current project, or surface conflict candidates. Default mode shows memory health (staleness, confidence, access frequency). Pass mode: "conflicts" to surface pairs of active memories that share a pin and may contradict — the bi-temporal model preserves both, so this is a review prompt for the agent or human, not an auto-resolution.
Inputs: mode, limit, category, stale_only.
overviewA
Get a structural map of the codebase. Shows the most important files and their key symbols ranked by dependency importance (PageRank). Use this FIRST when starting work on an unfamiliar codebase or directory.
Inputs: path, depth, token_budget.
patternsA
Query the LLM-derived design-pattern annotations on indexed symbols. Pass a pattern from the closed taxonomy (observer, repository, validator, ...) to list every symbol tagged with it; pass no args to see the taxonomy + counts. Requires sverklo enrich-patterns to have been run.
Inputs: limit, pattern.
pinA
Pin a memory to a specific file or symbol. Pinned memories surface automatically when recalling by that file path or symbol name, without needing semantic search.
Inputs: target (required), memory_id (required).
promoteA
Promote a memory to the core tier. Core memories are auto-injected into every session via sverklo://context resource — use for project invariants that should always be in the AI's context (style rules, framework conventions, 'never do X' rules).
Inputs: id (required).
recallA
Search memories semantically. Finds past decisions, preferences, and patterns relevant to a query. Supports two specialized modes: mode=core returns only the always-on project invariants (fast, no query needed — use at session start); mode=archival searches the full archive with semantic ranking; mode=all (default) searches both. Use core for 'what are the project-wide rules I must not violate' and archival for 'what did we decide about X on this codebase'.
Inputs: kind, mode, limit, query, +2 more.
refsA
Find all references to a symbol across the codebase. Shows where a function, class, or type is imported, called, or used. Matches on identifier word boundaries by default — embed does NOT match embeddingStore. Pass exact: false to opt into substring matching.
Inputs: symbol (required), exact, token_budget.
rememberA
Save a persistent memory tied to git state. Auto-invalidates conflicting prior memories.
Inputs: content (required), kind, tags, tier, +4 more.
review_diffA
Diff-aware context bundler for code review. Takes a git ref or range and returns: changed files, semantic delta (added/removed/modified symbols), dangling references for removed symbols, impact set for modified symbols, and similar-symbol detection for added ones. Replaces 10-20 grep+read calls with one structured response. Use this FIRST when reviewing an MR/PR — it surfaces blast radius and convention violations grep cannot see.
Inputs: ref, max_files, token_budget, include_added_similarity.
searchA
Hybrid semantic + text search with PageRank ranking. WORKS WELL for: exploratory questions where you don't know the exact symbol ('how does auth work', 'find anything related to billing', 'where's the retry logic'), anti-pattern discovery ('swallowed exceptions', 'silent null returns'), and cross-file semantic matches. STRUGGLES WITH: framework registration and wiring questions ('how is X registered as a bean', 'where is this interceptor configured'). For those, grep the specific annotation (@Component, @Configuration, etc.) directly. Response includes a confidence signal and a fallback hint when the query shape is one we know semantic search handles poorly.
Inputs: query (required), mode, repo, type, +6 more.
search_iterativeA
Wider-pool, iterative-friendly variant of search. Returns a ctx:// handle to the top-200 candidate pool plus refinement hints (co-occurring symbols, dominant directories, concept overlap). Use ctx_grep / ctx_slice to refine without firing another retrieval. Worth the extra latency (~50ms) on hard multi-hop questions; for single-shot lookups use search.
Inputs: query (required), pool, repo, scope.
statusA
Project state + tool usage guide. Returns index health (files, chunks, languages), memory summary, and specific tool recommendations tailored to this codebase. Call this first when starting a new session to understand what sverklo knows about the project.
Inputs: no named parameters.
test_mapA
Map a git diff to its test coverage. Given a ref/range, lists which tests likely cover each changed source file (via name heuristics + import graph), flags changed source files with NO matching tests, and shows which test files were modified in the diff. Use this during MR/PR review to answer 'what tests should I run?' and 'is this change tested?' without grepping the whole repo. Coverage is heuristic — sverklo doesn't run code, so treat results as candidates, not ground truth.
Inputs: ref, include_importers.
unpinC
Remove a pin from a memory.
Inputs: target (required), memory_id (required).
verifyA
Check whether one or more evidence ids (from a prior search-family tool's ```evidence block) still point to the same code they did at retrieval time. Returns unchanged / moved / modified / deleted / file_missing per id. Use this to prevent hallucinated citations after code changes.
Inputs: evidence_ids (required), claim.
wakeupA
500-token codebase summary suitable for pasting into a system prompt when the agent has no MCP access. Use this when integrating sverklo intelligence into Cursor, Codex, or a CI bot that can't run the MCP server. For MCP-connected agents, prefer status and the richer per-tool surfaces — they return more and stay in budget.
Inputs: format, max_tokens.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 36 tools
Most tools have clearly distinct purposes with detailed descriptions and 'use this instead of X' guidance, e.g. search vs investigate vs search_iterative vs ask. However, the high number of search-variant tools (search, investigate, search_iterative, ask, concepts, diff_search) can still cause misselection if the agent doesn't read the usage notes carefully.
All names use lowercase snake_case, and there is a consistent ctx_* family. But the overall naming convention is mixed: some tools are verbs (remember, forget, search), some nouns (overview, refs, audit), and some compound nouns (review_diff, test_map, ast_grep). No uniform verb_noun pattern exists, making it harder to predict tool names.
36 tools is well beyond the typical well-scoped range. While the server covers a wide feature set, the sheer number makes tool discovery and selection costly for an agent, and many tools are narrow utilities (ctx_peek, grep_results, head_results) that add surface area without adding fundamental capabilities.
The tool surface is remarkably complete for a code intelligence server: it covers codebase exploration (search, lookup, refs, deps, overview, clusters), memory lifecycle (remember, recall, forget, promote, demote, pin), context bundling (context, review_diff), diff review (diff_search, test_map), answer verification (verify, critique), and post-processing (grep_results, ctx_*). No obvious gaps for its stated purpose.
Maintenance
Related MCP Connectors
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Shared context for your codebase: a hosted code knowledge graph over MCP. Free plan, OAuth sign-up.
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Related MCP Servers
- AlicenseAqualityBmaintenanceNexus-MCP is a local MCP server for coding agents. Hybrid code search and a call graph for 10 languages give the agent the right code in one call, so it reads less. No API key, no telemetry, MIT. * 95% fewer tokens to reach the right file * About 9× faster search than Grep and Read * Live Claude Code runs on 11 repos: cost per task lower on 8 of 11599 PyPIMIT
- AlicenseNot gradedqualityBmaintenanceLocal-first code intelligence and safety layer for AI coding agents. MCP server exposes dependency graph, impact analysis, and AST-compressed repo context, backed by typed local memory, patch-scope safety gates, and git-independent transaction rollback.1MIT
- AlicenseNot gradedqualityBmaintenancePrivate, local-first code intelligence MCP server that builds a static graph of repositories and exposes search, architecture, impact analysis, and review tools via MCP.MIT

Vibgrate AI Contextofficial
AlicenseNot gradedqualityAmaintenanceLocal-first MCP server that gives AI assistants codebase intelligence—code graph, drift analysis, vulnerability attribution, and version-correct library docs—all from the user's machine.1,261 npm6Apache 2.0