文章目录

CodeGraph is a pre-indexed semantic code knowledge graph that supercharges Claude Code's Explore agents. Instead of letting AI agents scan through files with repeated grep, glob, and Read operations — burning through tokens on every tool call — CodeGraph builds a rich graph of symbol relationships, call graphs, and code structure upfront. Agents then query this graph instantly, slashing tool calls by up to 92% and speeding up codebase exploration by 71% on average.

Out of the box, CodeGraph indexes your entire codebase using tree-sitter parsers, extracting nodes (functions, methods, structs, imports) and edges (calls, references, inheritance). The resulting graph is stored locally as an SQLite database — no cloud, no external API calls. The installer works with a simple npx @colbymchenry/codegraph and auto-configures your Claude Code setup.


  • Massive Tool Call Reduction — Benchmarked across six real-world codebases including VS Code, Excalidraw, and Flutter, CodeGraph achieves 92%+ fewer tool calls. For VS Code, the Explore agent dropped from 52 tool calls in 1m 37s down to just 3 calls in 17s.
  • Multi-Language Support — CodeGraph uses 16 tree-sitter grammar WASM modules to parse TypeScript, Python, Rust, Java, Go, and more. The architecture was recently refactored to lazy-load grammars on demand, fixing out-of-memory crashes on large codebases (Issue #54).
  • 100% Local & Agent-Agnostic — Everything runs locally. The MCP server speaks plain stdio, making it compatible not just with Claude Code but potentially Cursor, Codex CLI, Continue, and Zed with the right installer (see Issue #137).

User @ronjb reported on M4 Max MacBook Pro with 64GB RAM:

"Same issue for me. CodeGraph v0.6.2, MacBook Pro M4 Max, 64 GB. After crash at 86%, it shows 'Files: 55, Nodes: 472, Edges: 417, DB Size: 1.66 MB' — so it's getting far but then OOM-kills."

Author @colbymchenry traced the root cause:

"The crash is in V8's WASM Zone allocator (not the JS heap), which runs out of memory while JIT-compiling WASM modules. CodeGraph was eagerly loading all 16 tree-sitter grammar WASM files at startup, regardless of which languages your project actually uses. Fix: lazy-load grammars on demand per file type."


User @thomasrepnik found a workaround:

"Used `npx @colbymchenry/codegraph` for automated setup, but got 'command not found'. Fixed by manually running `npm install -g @colbymchenry/codegraph` — now it works."

Author confirmed fix in v0.5.5:

"Try installing the latest version 0.5.5 and let me know if the issue persists."


Contributor @andreinknv explained the architecture:

"The MCP server itself is already agent-agnostic — it speaks plain stdio and works with Cursor, Codex CLI, opencode, Continue, Zed, etc. The lock is in the installer (`codegraph install`), which only knew how to write Claude Code configs. I've put together a multi-target installer PR."


CodeGraph is a clever optimization layer for AI-assisted coding — it shifts the work of codebase comprehension from repeated API calls to a one-time offline indexing pass. With benchmarks showing 92% fewer tool calls and 71% faster exploration across major open-source projects, it's a practical tool for developers working with large monorepos. The community is active, with active discussions around cross-platform installation, memory management for large codebases, and multi-agent expansion. At just 2,700 stars and growing, it's a great time to get involved.

⭐ 2,709 stars · TypeScript · MIT License · github.com/colbymchenry/codegraph