CodeGraph Supercharges Claude Code with Local Knowledge Graphs 🔗
Pre-indexed semantic relationships slash tool calls by 94% and accelerate exploration while keeping everything 100% local
CodeGraph builds a pre-indexed knowledge graph of any codebase so Claude Code’s Explore agents can query symbol relationships, call graphs, and structural context instantly instead of launching repeated grep, glob, and Read tool calls.
The problem it solves is painfully familiar to anyone using Claude Code on large repositories. Every time an Explore agent tries to understand how components interact, it spawns multiple tool calls that consume tokens, add latency, and inflate context windows.
CodeGraph builds a pre-indexed knowledge graph of any codebase so Claude Code’s Explore agents can query symbol relationships, call graphs, and structural context instantly instead of launching repeated grep, glob, and Read tool calls.
The problem it solves is painfully familiar to anyone using Claude Code on large repositories. Every time an Explore agent tries to understand how components interact, it spawns multiple tool calls that consume tokens, add latency, and inflate context windows. CodeGraph eliminates most of that overhead by doing the heavy lifting once, up front, then serving precise semantic answers on demand.
Developer Colby McHenry’s implementation delivers striking results. Independent benchmarks across six production codebases — including VS Code, Excalidraw, Alamofire, the Swift compiler, and two versions of Claude Code itself — show consistent gains. VS Code exploration dropped from 52 tool calls and 97 seconds to just 3 calls and 17 seconds, a 94% reduction in calls and 82% speed improvement. Similar leaps appear across Swift, Java, Python, and Rust projects. Average improvement sits at 92% fewer tool calls and 71% faster completion. All tests used Claude Opus 4.6 with identical prompts, proving the gains come from the graph, not prompt engineering.
What makes the project technically compelling is its decision to stay entirely local. The graph lives inside the developer’s machine, preserving privacy and eliminating network round-trips. Built in TypeScript, codegraph indexes symbols, definitions, references, and call hierarchies using a compact representation that fits comfortably inside Claude’s context window. Agents no longer need to reconstruct understanding on every query; they simply consult the graph.
Getting started is deliberately frictionless. Running npx @colbymchenry/codegraph launches an interactive installer that configures Claude Code automatically. Inside a project directory, codegraph init -i builds the initial index. Subsequent queries require almost no additional setup. The latest release, v0.7.6, fixed a permission issue with global npm installs, ensuring the CLI works reliably across shells.
For developers working on massive, multi-language repositories, this changes the economics of AI assistance. Exploration that previously felt expensive and sluggish becomes fast and cheap enough to use continuously. Instead of carefully rationing agent questions, engineers can ask deeper, more frequent queries about architecture, data flow, and implementation details.
CodeGraph also points toward a future where AI coding tools ship with persistent, project-specific memory rather than starting from zero each session. By shifting from runtime scanning to pre-computed semantic intelligence, it bridges classic static analysis techniques with modern agent workflows. The project doesn’t replace Claude Code — it makes its most expensive operations dramatically more efficient.
Early adopters report that complex refactoring discussions, security reviews, and onboarding to unfamiliar codebases now complete in fractions of the previous time. In an ecosystem still optimizing token usage and latency, CodeGraph offers a practical, immediately usable leap forward that respects developer workflows and local control.
The tool is particularly valuable for maintainers of large open-source projects and engineering teams shipping sophisticated software. It quietly removes one of the biggest remaining frictions between powerful frontier models and real-world codebases: the cost and delay of exploration itself.
- VS Code maintainers tracing extension host communication
- Swift engineers analyzing Alamofire networking internals
- AI developers debugging end-to-end tool execution flows
- bloop - offers semantic code search but requires separate web interface instead of direct Claude agent integration
- Sourcegraph - delivers code intelligence at scale yet depends on hosted infrastructure unlike CodeGraph's fully local approach
- Tree-sitter - enables fast structural parsing but stops short of building persistent call graphs and semantic relationships for AI agents