r/ClaudeCode • u/xobotyi • 57m ago
Built with Claude We open-sourced our internal code graph engine (with an MCP server)
We build games, and our repositories are big: the main one is 170k source files of C++, a couple of in-house scripting languages and shaders. Agents were bad at navigating it. To find who calls a function they grep the name, read every hit and burn context telling real calls from comments and namesakes. And yet the token consumption is not the "selling-point" – it is the reason.
So we built a code graph engine with an MCP server on top (it is engine at first with MCP happens to be on top), and we've been running it internally for our own agents and code review for well above half a year. We've now opened it up: kartta, MIT, written in Rust (for those believers).
What it gives an agent: where a symbol is defined, who calls it, what it calls, where it's used, what implements an interface, which files include a file, what an edit would break, plus file and content search. One server, 24 first-party languages (as of now, easily extensible), one set of tools.
The part we care about most is scale. Numbers from an M5 Max at 8 threads:
- Linux kernel, 97k files, 2.2M symbols, 4.6M calls: first index about 20 s, about 3 s when the cache is warm, about 1.4 GB peak.
- Kubernetes: 4 s cold, 1.4 s warm.
- Callers of
kfreeacross Linux, two hops: about 165 ms. Files that includelinux/sched.h(20,988 of them): 1 ms.
And so that you know - as far as author aware - there is no engine that is capable to index linux sources at all, not to say that it works in seconds. Competitors do work hours to provide the same or less quality..
We tried the other code-graph tools we could find on the same trees before deciding to develop own and once more before to publish. On Linux they either ran for more than an hour or didn't finish. That's the gap we built this for. Our consumption makes it impossible to wait more than minute to be operationable.
MCP also follows the working tree: edit a file and the next query sees it. Besides being embeddable.
Honest limits:
- It's tree-sitter plus resolution rules and heruistics atop, not a compiler. Answers carry a confidence mark, and it tells you when it left something out.
- No edges across languages (no FFI hops), at least yet, wet dream, but costs much.
- The version is 0.x because we're not ready to freeze the API, not because it's new to us, it serves us well than enough of time.
Install: cargo install --locked kartta-mcp, then claude mcp add --scope user kartta -- kartta-mcp. There's also an npm package and Go and Node bindings if you want the engine as a library.
•
u/AutoModerator 57m ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.