colbymchenry/codegraph
Pre-indexed code knowledge graph, auto syncs on code changes, for Claude Code, Codex, Gemini, Cursor, OpenCode, AntiGravity, Kiro, CoPilot, and Hermes Agent — fewer tokens, fewer tool calls, 100% local
CodeGraph – Semantic Code Intelligence for AI Agents
What it is – CodeGraph is a locally‑run service (built in Rust) that builds a knowledge graph of every symbol, call edge and dependency in a codebase. The graph is stored in a hidden .codegraph/ folder and kept up‑to‑date as files change.
Why it matters for LLM‑powered tools – When an AI‑assistant (Claude Code, Cursor, GitHub Copilot, etc.) needs to answer a question or make a change, it normally has to discover the code structure by grepping, reading files and stitching call‑paths together. That costs many tool calls, tokens and time. CodeGraph gives the agent a single, pre‑computed payload that contains the exact symbols and call‑chains relevant to the request, dramatically reducing discovery work.
Key capabilities
- Full‑stack language support – 30+ languages (TS/JS, Python, Go, Rust, Java, C/C++, Swift, etc.) are parsed automatically; no per‑language configuration is required.
- Cross‑file, dynamic‑dispatch resolution – the graph captures calls that static greps miss, so agents get true call‑graph context.
- Live updating – a file‑watcher keeps the graph fresh; agents always query the latest state without re‑indexing.
- Zero‑install runtime – the CLI bundles its own runtime, works on macOS, Linux and Windows, and can also be installed via npm (
@colbymchenry/codegraph). - Agent integration – a single
codegraph installcommand wires the service into supported agents (Claude Code, Cursor, Codex, Gemini, GitHub Copilot, etc.) via an MCP (multi‑client protocol) server. - CLI workflow –
codegraph initcreates the index,codegraph upgradeupdates the tool, andcodegraph uninstallremoves all agent configurations.
Performance evidence – Benchmarks on seven real‑world repos (VS Code, Excalidraw, Django, Tokio, OkHttp, Gin, Alamofire) show:
- 44 % lower cost and 62 % fewer tokens on average.
- 88 % fewer tool calls (often down to a single
codegraph_explorecall). - 0 file reads when the graph is present, compared with up to 43 reads without it.
- Speedups from 1.4× to 3.6× per query.
How to try it
- Install the CLI (curl script or
npm i -g @colbymchenry/codegraph). - Run
codegraph installto connect your AI agents. - Inside a project, run
codegraph init– this builds the graph and creates.codegraph/. - The agents will now automatically use the graph for code‑related queries.
Where to learn more – Full docs, API reference and a website are hosted at https://colbymchenry.github.io/codegraph/. A wait‑list for the hosted SaaS version is available at https://getcodegraph.com.
TL;DR – CodeGraph is a Rust‑based, language‑agnostic code‑graph builder that plugs into popular LLM coding assistants, giving them a single, up‑to‑date knowledge source. This cuts discovery overhead, reduces token usage and speeds up answers, making AI‑driven code assistance more efficient and cheaper.
Related
- Project
- Project
- Project
- Project
- Project