---
title: "codebase-memory-mcp: Does It Really Cut Tokens by 99%?"
date: "2026-10-16"
video_id: "7697215147927981325"
tiktok_url: "https://www.tiktok.com/@mingdaoai/video/7697215147927981325"
creator: "@mingdaoai"
category: "AI"
tags: ["codebase-memory-mcp", "mcp server", "code knowledge graph", "claude code", "token usage"]
excerpt: "codebase-memory-mcp's 99% token claim comes from a five-query test. The authors' 31-repo study found 10x fewer tokens at 83% vs 92% answer quality."
---
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](https://github.com/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](https://github.com/DeusData/codebase-memory-mcp#performance) 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](https://arxiv.org/abs/2603.27277), 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](https://github.com/DeusData/codebase-memory-mcp/releases/tag/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](https://arxiv.org/html/2603.27277v1) 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](https://deusdata.github.io/codebase-memory-mcp/) 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](https://github.com/DeusData/codebase-memory-mcp/pull/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](https://github.com/DeusData/codebase-memory-mcp/blob/main/docs/images/README.md). The v0.12.0 notes say he "now joins the project to own it."

[v0.12.0](https://github.com/DeusData/codebase-memory-mcp/releases/tag/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](https://github.com/DeusData/codebase-memory-mcp/releases/tag/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

- [DeusData/codebase-memory-mcp on GitHub](https://github.com/DeusData/codebase-memory-mcp) - README, benchmarks and language tiers
- [Lens capture notes](https://github.com/DeusData/codebase-memory-mcp/blob/main/docs/images/README.md) - how the demo GIFs were recorded
- [PR #2068](https://github.com/DeusData/codebase-memory-mcp/pull/2068) - Lens Beta merge
- [v0.12.0 release](https://github.com/DeusData/codebase-memory-mcp/releases/tag/v0.12.0) - Lens ships in the binary
- [v0.12.1 release](https://github.com/DeusData/codebase-memory-mcp/releases/tag/v0.12.1) - fix for broken package installs
- [v0.11.0 release](https://github.com/DeusData/codebase-memory-mcp/releases/tag/v0.11.0) - the 158-grammar README
- [arXiv 2603.27277](https://arxiv.org/abs/2603.27277) - the 31-repository study
- [arXiv 2603.27277 HTML](https://arxiv.org/html/2603.27277v1) - affiliations and trace timings
- [codebase-memory-mcp homepage](https://deusdata.github.io/codebase-memory-mcp/) - indexing time and language count
- [DeusData GitHub profile](https://github.com/DeusData) - maintainer name and location
- [mingdaoai.com](https://mingdaoai.com/) - the uploader's site


## Video description and verification notes

**The narration describes the tool accurately, and the numbers burned into every frame need context: the "99% fewer tokens" in the About blurb is the project's own five-query comparison (about 3,400 tokens versus about 412,000), while the maintainers' arXiv study across 31 repositories measured 10x fewer tokens and 2.1x fewer tool calls at an answer-quality score of 83% against 92% for an agent that reads files directly. The artifact is a 56-second vertical clip, 720x1280, HEVC Main as `hvc1` at 30 fps across 1,698 frames and 179,204 bps, with HE-AACv2 stereo audio at 44,100 Hz and 47,277 bps, 232,891 bps overall, 1,648,670 bytes on disk; ffprobe puts the container at 56.63 seconds and the extracted audio at 55.38 seconds. TikTok's metadata dates the post 2026-10-16 10:47:03 UTC from uploader `mingdaoai`, channel nickname "Ming Dao", audio credited as "original sound - Ming Dao", with a 42-character description identical to the title. At capture the counters read 1,248 views, 67 likes, 0 comments, 20 reposts, and 68 saves. I read all 28 extracted frames and all 178 transcript words; all 10 Whisper segments end before the audio does (the last at 55.16 seconds), so I discarded none. There is no presenter. Every frame is the same dark GitHub-style page: a hamburger menu, the GitHub logo, a "Sign in" button, the breadcrumb "DeusData / codebase-memory-mcp", a "README.md" tab, an H1 reading "codebase-memory-mcp", one intro sentence, an embedded "CBM LENS Beta" demo with tabs for Explore, Galaxy, Architecture, ADR, Coverage, and System, a row reading "Notifications", "Fork 3.8k", and a star, and an "About" block reading "High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph" followed by "average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies." Yellow and white caption words track the narration across the lower third. Frames 6 and 7 shrink the page into a phone-shaped card over a sky and ocean photo; frames 12 to 14 zoom in on it. The embed cycles through the Architecture overview ("Repository structure", "2,261 files", "Browse map · 26 parts"), the `src/pipeline` area ("64 files · 244 indexed nodes", "10,658 indexed lines"), the `artifact.c` card ("1.5K lines") and its source panel ("Lines 1 to 160 · reported end 1539"), a Galaxy ring and cluster, a star burst around `cbm_pipeline_run` ("204 nodes · 258 edges"), a hierarchy fan, and a path panel reading "Path to cbm_store_check_integrity · 2 hops" through `seal_staging_db`.**

## The 99% figure is a five-query self-report, and the authors' own study says 10x with a quality cost

The About text on screen says "99% fewer tokens". The README's [Performance section](https://github.com/DeusData/codebase-memory-mcp#performance) traces that number to the project's original README report: about 3,400 tokens for five structural queries through codebase-memory-mcp against about 412,000 through file-by-file exploration, which the README rounds to "approximately 120x fewer tokens, or a 99.2% reduction, for that comparison." The README adds that "exact reproduction of the figures above requires the original inputs and raw artifacts," so the five-query result is a reported figure that a reader cannot rerun.

The same maintainers published a larger measurement. The arXiv preprint [Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCP](https://arxiv.org/abs/2603.27277), submitted 28 March 2026 by Martin Vogel, Falk Meyer-Eschenbach, Severin Kohler, Elias Grünewald, and Felix Balzer, evaluated the tool across 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." The results section puts it as "The MCP Agent achieves 90% of the Explorer Agent's quality score while consuming an order of magnitude fewer tokens." The README itself says these backend results "are separate from the five-query comparison above."

So two figures exist from the same source. The 99% describes five structural queries. The 10x (a 90% reduction) describes 31 repositories, and it came with a nine-point drop in answer quality. The narration's "far fewer tokens" is defensible under either number. The 99% on screen is the smaller and less rigorous of the two measurements.

## The "158 languages" on screen was stale at upload; the count has read 66, 158, and 162 this year

The About block in every frame says "158 languages". When I pulled the repository record on 2026-10-19 the description read "162 languages". The README on `main` at the last commit before the upload (`c0404766`, 2026-10-15 23:47 UTC) already carried a "languages 162" badge and the sentence "162 languages, counted by the vendored grammar directories in the parser manifest". The 158 figure matches the [v0.11.0](https://github.com/DeusData/codebase-memory-mcp/releases/tag/v0.11.0) README from 2026-09-15, which listed "158 vendored tree-sitter grammars". The arXiv abstract from March 2026 says the pipeline parses 66 languages. The number grows as grammars are vendored, and the video captured a description the repository had already moved past.

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

## "Sub-ms queries" holds for graph traversal; "average repo in milliseconds" conflicts with the project's own benchmarks

The README's Performance table, measured on an Apple M3 Pro, lists a Cypher relationship query at under 1 ms, a depth-5 call-path trace at under 10 ms, a regex name search at under 10 ms, and dead-code detection at about 150 ms. The preprint reports depth-5 BFS tracing at about 0.3 ms on the same hardware. "Sub-ms queries" is supported for the relationship-traversal case.

"Average repo in milliseconds" is a different claim, and I could not find a first-party benchmark behind it. The same table's smallest full index is Django at about 6 seconds (49K nodes, 196K edges); the Linux kernel (28M lines, 75K files) takes 3 minutes for a full index and 1 minute 12 seconds for a fast index. The project's [homepage](https://deusdata.github.io/codebase-memory-mcp/) describes "full-indexing an average repo in seconds". The milliseconds wording appears only in the GitHub description, and the project's own docs say seconds.

## The Lens demo in the video shipped in a release 12 hours 39 minutes before the upload, and the README still said to build from source

The "Lens Overview demo" the narration names is `docs/images/lens-overview.gif` in the README. The [capture notes](https://github.com/DeusData/codebase-memory-mcp/blob/main/docs/images/README.md) say Bernhard Jackiewicz recorded it on 12 October 2026 in headless Chromium at 1440x900, from commit `4d9592b5` on `main` after [PR #2068](https://github.com/DeusData/codebase-memory-mcp/pull/2068) landed, with an index of 75,037 nodes and 361,349 edges. PR #2068, titled "CBM Lens Beta: graph exploration and architecture workspace", was opened 2026-09-05 and merged 2026-10-12 03:38 UTC. The recording does what the narration says: it zooms into the repository map, selects `src/pipeline`, opens the area, selects `artifact.c`, and opens its source. The Galaxy clip in frames 6 to 11 is the second GIF, which searches `cbm_pipeline_run`, expands its outgoing calls one layer, and shows the two-hop path to `cbm_store_check_integrity`.

Timing matters for anyone who installs after watching. [v0.12.0](https://github.com/DeusData/codebase-memory-mcp/releases/tag/v0.12.0) was published 2026-10-15 22:08 UTC, 12 hours 39 minutes before the video's 10:47 UTC upload, and its notes open with "Meet CBM Lens" and state that Lens "ships inside the binary you already run and listens on loopback only." The README on `main`, both at upload and when I read it on 2026-10-19, still says Lens "is not part of the current v0.11.0 release" and tells readers to build from source, which is stale against the release notes. [v0.12.1](https://github.com/DeusData/codebase-memory-mcp/releases/tag/v0.12.1) followed at 2026-10-16 23:35 UTC, 12 hours 49 minutes after the upload, and its first fix says "npm i, pnpm add, pip install and the Go wrapper could not install v0.12.0 on any platform" because each wrapper refused archives above 256 MiB and "every v0.12.0 binary is 331-335 MB". The Homebrew formula was still at 0.10.3. During the window in which the video went live, the Lens build existed and three of the install channels could not deliver it.

## What the narration gets right, and what the on-screen page is

The transcript's mechanics check out against the README. "Stores the structure in a local database" matches the Persistence section: SQLite databases at `~/.cache/codebase-memory-mcp/` in WAL mode. "A graph of functions, classes, and routes" matches "functions, classes, imports, HTTP routes, and their relationships". "Runs on your machine" matches the MIT license (copyright 2025 DeusData), the "no hosted service or API key" line, and Lens binding to loopback at `http://127.0.0.1:9749`; the one outbound request is an optional Hugging Face model download for the browser chat, which the capture notes identify as Qwen2.5 Coder 0.5B. The narration's "parses every file" is bounded by ignore rules and a default `auto_index_limit` of 50,000 files.

The page itself is a composite. Its intro sentence, "codebase-memory-mcp is an open source MCP server that turns your codebase into a queryable knowledge graph, so your AI coding agent can answer structural questions", appears in none of the 40 most recent README-touching commits in `main`'s history through 2026-10-16, nor in the v0.11.0 README, nor on the homepage. The layout places the README above the Fork and Star row and the About block below both, which is the reverse of GitHub's page. The real elements are the About text (an earlier revision of the actual description), the fork count (3,880 on 2026-10-19, which GitHub renders as 3.8k), and the two Lens GIFs. The uploader's site, [mingdaoai.com](https://mingdaoai.com/), describes its output as "short videos about open-source tools, with the link, the context, and the words behind the video" and names no individual.

## Who built it

The `DeusData` GitHub account belongs to Martin Vogel in Berlin, per his profile, and he is the preprint's first author, listed there as an independent researcher. His co-authors are at Charité Universitätsmedizin Berlin, Humboldt University, Freie Universität Berlin, and University Hospital Heidelberg. The repository was created 2026-02-24, is written in C, and on 2026-10-19 showed 46,906 stars, 3,880 forks, 180 watchers, and 650 open issues. The v0.12.0 notes credit Lens to Bernhard Jackiewicz, "who now joins the project to own it," and count 231 merged pull requests since v0.11.0, 40 of them from outside contributors.

## Key Takeaways

- The on-screen "99% fewer tokens" comes from the project's own five-query comparison (about 3,400 versus about 412,000 tokens); the maintainers' 31-repository preprint measured 10x fewer tokens and 2.1x fewer tool calls with answer quality of 83% against 92%.
- The "158 languages" in the frames was already outdated at upload: the README said 162 before the video went up, the v0.11.0 README said 158, and the March preprint said 66.
- "Sub-ms queries" is backed by the README's under-1 ms Cypher traversal on an M3 Pro; "average repo in milliseconds" has no first-party benchmark, and the project's own table and homepage say seconds (Django at about 6 s).
- CBM Lens shipped in v0.12.0 on 2026-10-15, 12 hours 39 minutes before the upload, while the README still said build from source; v0.12.1 on 2026-10-16 fixed npm, PyPI, and Go installs that could not install v0.12.0.
- The narration's mechanics are accurate: local SQLite storage, a graph of functions, classes, and routes, and click-to-source in the Lens overview.
- The GitHub page in every frame is a composite: its intro sentence exists in no README revision I checked, while the About text, fork count, and GIFs are real.

## Resources

- [DeusData/codebase-memory-mcp on GitHub](https://github.com/DeusData/codebase-memory-mcp) establishes the MIT license, C codebase, 2026-02-24 creation date, 46,906 stars and 3,880 forks on 2026-10-19, the current "162 languages" description, the Performance table, the Persistence path, and the stale v0.11.0 build-from-source note.
- [docs/images/README.md capture notes](https://github.com/DeusData/codebase-memory-mcp/blob/main/docs/images/README.md) establishes who recorded the Lens GIFs, when, from which commit, and what each recording shows.
- [PR #2068](https://github.com/DeusData/codebase-memory-mcp/pull/2068) establishes the Lens Beta merge on 2026-10-12.
- [v0.12.0 release](https://github.com/DeusData/codebase-memory-mcp/releases/tag/v0.12.0) establishes the 2026-10-15 publish time and that Lens ships in the binary.
- [v0.12.1 release](https://github.com/DeusData/codebase-memory-mcp/releases/tag/v0.12.1) establishes the 2026-10-16 publish time and the broken npm, PyPI, Go, and Homebrew install paths in v0.12.0.
- [v0.11.0 release](https://github.com/DeusData/codebase-memory-mcp/releases/tag/v0.11.0) establishes the 2026-09-15 date and, through its README, the 158-grammar count.
- [arXiv 2603.27277](https://arxiv.org/abs/2603.27277) establishes the preprint title, authors, 28 March 2026 submission, 31 repositories, 66 languages, 83% versus 92% quality, 10x tokens, and 2.1x tool calls.
- [arXiv 2603.27277 HTML](https://arxiv.org/html/2603.27277v1) establishes author affiliations, the 0.3 ms depth-5 trace, and the Apple M3 Pro hardware.
- [codebase-memory-mcp homepage](https://deusdata.github.io/codebase-memory-mcp/) establishes "full-indexing an average repo in seconds" and the 162-language count.
- [GitHub profile for DeusData](https://github.com/DeusData) establishes the name Martin Vogel and the Berlin location.
- [mingdaoai.com](https://mingdaoai.com/) establishes the uploader's site description and the matching TikTok and YouTube handles.
