CodeGraph builds a pre-indexed code knowledge graph for Claude Code, Cursor, and Codex. AI agents query the graph instead of scanning files — 94% fewer tool calls, no data leaves your machine.
CodeGraph uses tree-sitter to parse your local code into a SQLite graph database, then runs as a local code graph MCP server that Claude Code, Cursor, and Codex connect to automatically.
Run the installer in your project. The interactive installer configures Claude Code, Cursor, and Codex automatically — no manual JSON editing.
tree-sitter parses every file into an AST. Functions, classes, call chains, and import relationships are extracted and stored in a local code knowledge graph (SQLite). VS Code, Cursor, and Windsurf projects all supported.
The local code graph MCP server starts automatically. Claude Code, Codex, and Cursor query the graph via MCP tools instead of spawning grep agents — giving precise code graph context in one call.
Native OS file events (FSEvents / inotify) watch for saves. The code graph analysis updates incrementally with a 2-second debounce — zero config, always current.
Tested with Claude Opus 4.6 across 6 production codebases. Each test compared Claude Code's Explore agent with and without CodeGraph MCP.
| Codebase | With CodeGraph | Without CodeGraph | Improvement |
|---|---|---|---|
| VS Code · TypeScript | 3 calls · 17s | 52 calls · 1m 37s | 94% fewer · 82% faster |
| Excalidraw · TypeScript | 3 calls · 29s | 47 calls · 1m 45s | 94% fewer · 72% faster |
| Claude Code · Python+Rust | 3 calls · 39s | 40 calls · 1m 8s | 93% fewer · 43% faster |
| Alamofire · Swift | 3 calls · 22s | 32 calls · 1m 39s | 91% fewer · 78% faster |
| Swift Compiler · 25,874 files | 6 calls · 35s | 37 calls · 2m 8s | 84% fewer · 73% faster |
Symbol relationships, call graphs, class inheritance, and import chains — all pre-indexed in a local SQLite database for instant lookup.
Runs as a local MCP server. Claude Code, Cursor, Codex, and OpenCode connect automatically via the Model Context Protocol.
Graph-based retrieval beats vector RAG for code. Relationship-aware queries return precise context — not similar text chunks.
Native OS file events keep the code graph in sync as you code. No polling, no manual re-index, always fresh.
No API keys, no cloud upload, no GitHub OAuth. Your code stays on your machine. Private repos stay private.
TypeScript, JavaScript, Python, Go, Rust, Java, C#, Swift, Kotlin, PHP, Ruby, C, C++, Dart, Svelte, and more.
When running as a code graph MCP server, CodeGraph exposes these tools to Claude Code, Cursor, and any MCP-compatible agent.
codegraph_search
Find symbols by name across the codebase
codegraph_context
Build relevant code graph context for a task
codegraph_callers
Find what calls a function
codegraph_callees
Find what a function calls
codegraph_impact
Analyze what code is affected by a change
codegraph_node
Get details about a specific symbol
codegraph_files
Get indexed file structure instantly
codegraph_status
Check index health and statistics
Vector RAG finds similar text. Code graph RAG understands relationships. For codebases, structure matters more than similarity.
CodeGraph's code knowledge graph supports 19+ languages via tree-sitter.
Works with Claude Code, Cursor, Codex, and any MCP-compatible agent. 100% local — your code never leaves your machine.