Already installed? Run codegraph upgrade
Follow @getcodegraph on X for updates.
Surgical context · fewer tool calls · faster answers · 100% local
The CodeGraph platform is coming — for every PR, know exactly what to test, what could break, which flows are affected, and whether business logic is compromised.
Get early beta access to the hosted product · getcodegraph.com
No Node.js required — one command grabs the right build for your OS:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iex
Already have Node? Use npm instead (works on any version)
npm i -g @colbymchenry/codegraph
CodeGraph bundles its own runtime — nothing to compile, no native build, works the same everywhere. The installer puts codegraph on your PATH but doesn't change your current shell — open a new terminal before the next step so the command resolves.
Upgrade any time with codegraph upgrade — it detects how you installed (bundle, npm, or npx) and updates in place. Add --check to see if an update is available, or codegraph upgrade <version> to pin one.
In a new terminal, run the installer to connect CodeGraph to the agents you use:
codegraph install
Detects and auto-configures Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, and Kiro — wiring the CodeGraph MCP server into each. This is the step that connects CodeGraph to your agent; installing the CLI in step 1 does not do it on its own. It only wires up your agent — it does not index any code; building each project's graph is the separate codegraph init in step 3. (Shortcut: npx @colbymchenry/codegraph downloads and runs this in one go.)
cd your-project
codegraph init
codegraph init creates the local .codegraph/ directory and builds the full graph in the same step — one command, done.
Auto-sync is enabled by default. CodeGraph watches the project and updates the graph on every file change — while your agent edits code, or you add, modify, or delete files. The index is never stale, and there is nothing to re-run.
Changed your mind? One command removes CodeGraph from every agent it configured:
codegraph uninstall
Reverses the installer — strips CodeGraph's MCP server config, instructions, and permissions from each configured agent. Your project indexes (.codegraph/) are left untouched; remove those per-project with codegraph uninit. Use --target to remove from specific agents, or --yes to run non-interactively.
When an AI agent needs to understand code — to answer a question or make a change — it discovers structure the slow way: grep, glob, and Read, one file at a time, rebuilding call paths and dependencies by hand. That's a pile of tool calls and round-trips before it even starts the real work.
CodeGraph hands the agent the exact code it needs in one call. It's a pre-built knowledge graph of every symbol, call edge, and dependency in your codebase — so instead of crawling files, the agent asks one question and gets back the relevant source, the call paths between those symbols (including dynamic-dispatch hops grep can't follow), and the blast radius of a change. Surgical context, not a file-by-file search — which means fewer tool calls and faster answers on every codebase, large or small.
A note on cost: CodeGraph's win on every codebase is precision and speed — fewer tool calls, faster answers. It cuts token and dollar cost too, but those savings are scale-dependent: small and noisy on a modest codebase, and material only once a repo is large and tangled — at the scale of a Google or Microsoft monorepo, multiplied by a whole team's daily agent usage — for them to compound into a real line item. On a 500-file project, adopt CodeGraph for the speed; the cost savings show up when the codebase (and the team) gets big.
Tested across 7 real-world open-source codebases spanning 7 languages, comparing an agent (Claude Code, headless) answering one architecture question with and without CodeGraph, at the median of 4 runs per arm. Re-validated on Opus 4.8 (2026-06-02), on the current build (codegraph_explore as the primary tool).
The universal win — every repo, every size: 58% fewer tool calls · 22% faster · file reads cut to ~zero.
The reliable, universal payoff is surgical context and speed: CodeGraph collapses the agent's grep/find/Read crawl into a few direct queries — returning the exact methods you asked about even when they're buried in a multi-thousand-line file — so it answers with near-zero file reads while the no-CodeGraph agent spends its budget on discovery. The Tokens and Cost columns are real too, but — as noted above — they're scale-dependent: small and noisy per query, compounding into real money only at large-codebase, high-volume scale.
| Codebase | Language | Tool calls | Time | File reads | Tokens | Cost |
|---|---|---|---|---|---|---|
| VS Code | TypeScript · ~10k files | 81% fewer | 11% faster | 0 vs 9 | 64% fewer | 18% cheaper |
| Excalidraw | TypeScript · ~640 | 40% fewer | 27% faster | 0 vs 7 | 25% fewer | even |
| Django | Python · ~3k | 77% fewer | 13% faster | 0 vs 9 | 60% fewer | 8% cheaper |
| Tokio | Rust · ~790 | 57% fewer | 18% faster | 0 vs 8 | 38% fewer | even |
| OkHttp | Java · ~645 | 50% fewer | 31% faster | 0 vs 4 | 54% fewer | 25% cheaper |
| Gin | Go · ~110 | 44% fewer | 24% faster | 1 vs 6 | 23% fewer | 19% cheaper |
| Alamofire | Swift · ~110 | 58% fewer | 33% faster | 0 vs 9 | 64% fewer | 40% cheaper |
File reads = median files the agent opened with vs without CodeGraph — the surgical-context win in one column. Tokens and Cost are the same with-vs-without deltas; they're directional (they move run-to-run) and, per query, small in absolute terms — which is why they only become a line item at scale. codegraph_explore also collapses redundant interchangeable implementations to signatures, so a response is sized to the answer rather than the file count.
Per-repo breakdown — WITH vs WITHOUT (median of 4)
VS Code · ~10k files | Metric | WITH cg | WITHOUT cg | Δ | |---|---|---|---| | Time | 1m 59s | 2m 13s | 11% faster | | File Reads | 0 | 9 | −9 | | Grep/Bash | 0 | 11 | −11 | | Tool calls | 4 | 21 | 81% fewer | | Total tokens | 640k | 1.79M | 64% fewer | | Cost | $0.68 | $0.83 | 18% cheaper |
Excalidraw · ~640 files | Metric | WITH cg | WITHOUT cg | Δ | |---|---|---|---| | Time | 1m 32s | 2m 6s | 27% faster | | File Reads | 0 | 7 | −7 | | Grep/Bash | 1 | 8 | −7 | | Tool calls | 9 | 15 | 40% fewer | | Total tokens | 1.27M | 1.69M | 25% fewer | | Cost | $0.78 | $0.78 | even |
Django · ~3k files | Metric | WITH cg | WITHOUT cg | Δ | |---|---|---|---| | Time | 1m 43s | 1m 58s | 13% faster | | File Reads | 0 | 9 | −9 | | Grep/Bash | 0 | 5 | −5 | | Tool calls | 3 | 13 | 77% fewer | | Total tokens | 559k | 1.41M | 60% fewer | | Cost | $0.57 | $0.62 | 8% cheaper |
Tokio · ~790 files | Metric | WITH cg | WITHOUT cg | Δ | |---|---|---|---| | Time | 1m 55s | 2m 20s | 18% faster | | File Reads | 0 | 8 | −8 | | Grep/Bash | 0 | 6 | −6 | | Tool calls | 6 | 14 | 57% fewer | | Total tokens | 1.08M | 1.73M | 38% fewer | | Cost | $0.82 | $0.82 | even |
OkHttp · ~645 files | Metric | WITH cg | WITHOUT cg | Δ | |---|---|---|---| | Time | 1m 1s | 1m 29s | 31% faster | | File Reads | 0 | 4 | −4 | | Grep/Bash | 2 | 6 | −4 | | Tool calls | 5 | 10 | 50% fewer | | Total tokens | 502k | 1.10M | 54% fewer | | Cost | $0.41 | $0.55 | 25% cheaper |
Gin · ~110 files | Metric | WITH cg | WITHOUT cg | Δ | |---|---|---|---| | Time | 1m 14s | 1m 37s | 24% faster | | File Reads | 1 | 6 | −5 | | Grep/Bash | 1 | 2 | −1 | | Tool calls | 5 | 9 | 44% fewer | | Total tokens | 651k | 847k | 23% fewer | | Cost | $0.46 | $0.57 | 19% cheaper |
Alamofire · ~110 files | Metric | WITH cg | WITHOUT cg | Δ | |---|---|---|---| | Time | 1m 35s | 2m 21s | 33% faster | | File Reads | 0 | 9 | −9 | | Grep/Bash | 0 | 4 | −4 | | Tool calls | 5 | 12 | 58% fewer | | Total tokens | 766k | 2.10M | 64% fewer | | Cost | $0.57 | $0.95 | 40% cheaper |
Full benchmark details
Methodology. Each arm is claude -p (Claude Opus 4.8) run headlessly against the repo with --strict-mcp-config: WITH = CodeGraph's MCP server enabled, WITHOUT = an empty MCP config. Built-in Read/Grep/Bash stay available to both. Same question per repo, 4 runs per arm, median reported. Cost = the run's total_cost_usd; Tokens = total tokens processed (input incl. cached + output); Time = wall-clock; Tool calls = every tool invocation, including those inside any sub-agents the model spawns. Repos cloned at --depth 1 and indexed by the same CodeGraph build that served them. Re-validated 2026-06-02 on the current build. These numbers are lower than the prior Opus 4.7 validation — not a CodeGraph regression but a stronger native baseline: Opus 4.8 greps/reads efficiently on the main thread instead of fanning out into large Explore-subagent sweeps, so the no-CodeGraph arm is leaner than it used to be. Per-repo numbers move run-to-run with how hard the without-arm thrashes (the median-of-4 smooths it, but tails remain — e.g. Django's without-arm hit $2.71/14m one batch).
Queries: | Codebase | Query | |----------|-------| | VS Code | "How does the extension host communicate with the main process?" | | Excalidraw | "How does Excalidraw render and update canvas elements?" | | Django | "How does Django's ORM build and execute a query from a QuerySet?" | | Tokio | "How does tokio schedule and run async tasks on its runtime?" | | OkHttp | "How does OkHttp process a request through its interceptor chain?" | | Gin | "How does gin route requests through its middleware chain?" | | Alamofire | "How does Alamofire build, send, and validate a request?" |
Why CodeGraph wins: with the index available, the agent answers directly — usually one codegraph_explore returns the relevant source — and stops, usually with zero file reads. Without it, the agent spends most of its budget on discovery (find/ls/grep) before reading the right code. CodeGraph only helps when queried directly, so its instructions steer agents to answer directly rather than delegate exploration to file-reading sub-agents — otherwise a sub-agent reads files regardless and CodeGraph becomes overhead.
| Surgical Context | One tool call returns entry points, related symbols, and code snippets — no slow file-by-file exploration |
| Full-Text Search | Find code by name instantly across your entire codebase, powered by FTS5 |
| Impact Analysis | Trace callers, callees, and the full impact radius of any symbol before making changes |
| Always Fresh | File watcher uses native OS events (FSEvents/inotify/ReadDirectoryChangesW) with debounced auto-sync — the graph stays current as you code, zero config |
| 20+ Languages | TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C, |
$ claude mcp add codegraph \
-- python -m otcore.mcp_server <graph>