Source: github.com/colbymchenry/codegraph (MIT; benchmark re-measured 2026-08-05); highlighted by Mayank A. on LinkedIn (2026-11-17).
What it is
CodeGraph builds a persistent knowledge graph of a repository: symbols, call edges, imports, inheritance and dependencies, parsed by a native Rust kernel with tree-sitter, and stored in a local SQLite database with FTS5 full-text search. Coding agents (Claude Code, Codex, Cursor, Copilot, Gemini CLI and about twenty others) query it over MCP. Instead of grep, glob and file reads, one codegraph_explore call returns entry points, related symbols, call paths and source snippets. It is fully local: no LLM calls to index, no API keys, no external services.
Other features: impact analysis (callers, callees, blast radius of a change), framework-aware routes for more than 20 web frameworks (URL patterns linked to handlers), cross-language bridging for Swift/Objective-C, React Native and Expo, and navigation edges for client-side routers.
Freshness design
Stale indexes are the classic failure of code-search tools. CodeGraph uses three layers:
A native file watcher with a debounced re-sync (2 s by default) on every create, modify or delete.
A per-file staleness banner. During the debounce window, any tool response that references a still-pending file is prefixed with a warning telling the agent to read the file directly.
Connect-time catch-up. When the MCP server reconnects, it reconciles size, mtime and content hash against the working tree before answering, so edits from git pulls or other editors aren't missed.
Incremental sync takes well under a second on a single-file save. Reported fresh indexes: the 27k-file Swift compiler repo in about 100 seconds on a workstation; the Linux kernel (70k files, 2M symbols) in under 12 minutes on a 2-core, 6 GB VPS.
The benchmark
Seven open-source repos in seven languages (VS Code, Excalidraw, Django, Tokio, OkHttp, Gin, Alamofire), one architecture question each, Claude Opus 4.8 headless, median of 4 runs per arm, with and without the CodeGraph MCP server. Built-in read, grep and bash tools are available in both arms.
Headline: 88% fewer tool calls, 53% faster, 62% fewer tokens processed, 44% cheaper on average, and zero file reads in every repo.
Variance: cost savings ran 57 to 78% where the baseline needed 28 to 43 tool calls, but only 13% on Django and about even on Gin. Savings track how much discovery the question demands, not repo size.
A control-arm fix worth copying. On an unblocked harness, the baseline agent found the
codegraphCLI on PATH and used it through bash in 26 of 28 runs, which contaminated the comparison. The re-measurement blocks the CLI in both arms with a sanitized PATH and a PreToolUse hook. All 28 baseline runs tried the CLI and all were blocked. The README notes that earlier published figures were produced without this block.The cost the headline hides. In multi-turn sessions, CodeGraph's responses leave about 80% more retrieval context resident at session end (on VS Code, 67k tokens vs 18k). Dense verbatim payloads stay in the window, while a grep-and-read agent's many small results get evicted. Fewer tokens processed and a larger persistent footprint are both true at once.
How to read it
It is the maintainer's benchmark: one question per repo, four runs, one model. The questions are architecture questions, which is where a graph helps most; editing tasks were not measured.
The honesty is unusual and useful: the contamination finding and the context-footprint caveat are published alongside the wins.
The repo has anonymous telemetry, and a hosted product is planned. Check the telemetry settings before using it on proprietary code.
The star count is high, but stars are not a quality measure.
Tradeoffs
Precomputed structure vs on-demand reading: faster answers and fewer calls, at the cost of an index to keep fresh and a larger resident context.
Static analysis limits: dynamic dispatch, reflection and generated code can be missed; the bridging resolvers tag heuristic edges with provenance so the agent can tell.
Another MCP server in the trust boundary, with read access to the whole repo.
Review checklist for adopting a code graph
Does your benchmark block the tool in the control arm, so the baseline can't reach it another way?
Do you measure resident context in long sessions, not just tokens processed per answer?
How does the tool signal staleness to the agent between an edit and the next sync?
Are heuristic or inferred edges labelled as such?
Is telemetry acceptable for your codebase?
Have you tested edit tasks, not only questions?
Related
R076: Graphify, a tree-sitter code graph that agents query instead of grep.
R037: a generated codebase map for humans.
R055: embedded property-graph storage.