<- all tokdocs

codebase-memory-mcp: Does It Really Cut Tokens by 99%?

By , founder of Mavric and Apso

View on TikTok ->

codebase-memory-mcp is an open-source MCP server that indexes a codebase into a local knowledge graph, so a coding agent can answer structural questions without reading files one by one. Its "99% fewer tokens" claim comes from a five-query comparison. The maintainers' own study across 31 repositories measured 10x fewer tokens, with answer quality of 83% against 92% for an agent that reads files directly.

A TikTok from @mingdaoai walks through the project's GitHub page and its CBM Lens demo. The narration describes the tool accurately. The numbers on the page need context.

What is codebase-memory-mcp?

The project lives at DeusData/codebase-memory-mcp. It parses source files with tree-sitter and stores "functions, classes, imports, HTTP routes, and their relationships" in SQLite databases at ~/.cache/codebase-memory-mcp/. It runs locally under the MIT license, with "no hosted service or API key." By default it indexes up to 50,000 files (the auto_index_limit setting) and respects ignore rules.

The DeusData account belongs to Martin Vogel in Berlin. The repository was created 2026-02-24, is written in C, and on 2026-10-19 showed 46,906 stars and 3,880 forks.

Does codebase-memory-mcp really use 99% fewer tokens?

The README's Performance section traces the 99% to a test of five structural queries: about 3,400 tokens through codebase-memory-mcp against about 412,000 through file-by-file exploration. The README calls that "approximately 120x fewer tokens, or a 99.2% reduction, for that comparison," and notes that "exact reproduction of the figures above requires the original inputs and raw artifacts."

The same maintainers published a larger test. The arXiv preprint Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCP, submitted 28 March 2026 by Martin Vogel, Falk Meyer-Eschenbach, Severin Kohler, Elias Grünewald and Felix Balzer, covered 31 repositories. Its abstract reports "83% answer quality versus 92% for a file-exploration agent, at ten times fewer tokens and 2.1 times fewer tool calls."

So the broader result is a 90% token reduction with a nine-point drop in answer quality. The 99% applies to five queries and cannot be rerun from public data.

How many languages does it support?

The page in the video says 158. By upload, the README already said 162, "counted by the vendored grammar directories in the parser manifest." The 158 figure matches the v0.11.0 README from 2026-09-15, and the March preprint said 66.

The README's quality tiers matter more than the total. It rates 17 languages "Excellent" (90% or higher on its 64-repository benchmark), 16 "Good" (75 to 89%) and 2 "Functional" (under 75%). The remaining 127 are "also supported (not yet benchmarked)." Hybrid LSP type resolution covers 13: Python, TypeScript, JavaScript, JSX/TSX, PHP, C#, Go, C, C++, Java, Kotlin, Rust and Perl.

How fast is indexing and querying?

The README's benchmarks on an Apple M3 Pro list a Cypher relationship query under 1 ms, a depth-5 call-path trace under 10 ms, a regex name search under 10 ms, and dead-code detection at about 150 ms. The preprint reports depth-5 tracing at about 0.3 ms. "Sub-ms queries" holds for graph traversal.

The page's "average repo in milliseconds" does not match the project's own numbers. Indexing Django takes about 6 seconds (49K nodes, 196K edges). The Linux kernel takes 3 minutes for a full index and 1 minute 12 seconds for a fast index. The homepage says "full-indexing an average repo in seconds."

What is CBM Lens, and how do you install it?

CBM Lens is the visual explorer shown in the video, with Explore, Galaxy, Architecture and other views. PR #2068, "CBM Lens Beta: graph exploration and architecture workspace," merged on 2026-10-12. The demo GIFs were recorded by Bernhard Jackiewicz, according to the capture notes. The v0.12.0 notes say he "now joins the project to own it."

v0.12.0 shipped on 2026-10-15 and says Lens "ships inside the binary you already run and listens on loopback only," at http://127.0.0.1:9749. The README still told readers to build Lens from source.

Installing right after the video was harder than it looked. v0.12.1, released 2026-10-16, says "npm i, pnpm add, pip install and the Go wrapper could not install v0.12.0 on any platform," because "every v0.12.0 binary is 331-335 MB" and the wrappers refused archives above 256 MiB. Use v0.12.1 or later.

Lens makes one optional outbound request, a Hugging Face download of Qwen2.5 Coder 0.5B for the browser chat.

A note on the page in the video

The GitHub page in the video is a mockup. Its About text, fork count and Lens GIFs are real, but its intro sentence does not appear in any README revision checked, and the layout differs from GitHub's.

Bottom line

codebase-memory-mcp does what the video says: it builds a local graph of your code that an agent can query cheaply. Expect roughly 10x fewer tokens with somewhat lower answer quality, based on the authors' 31-repository study. Treat the 99% as a best case from five queries, and install v0.12.1 or later if you want Lens.

Sources

Published October 16, 2026. Based on a TikTok by @mingdaoai. Full video notes (markdown)