Skip to content

CodeGraph

A local code graph that re-syncs itself as files change and answers a coding agent's structural questions through one MCP tool.

Reviewed by Sheela · Updated

Setup docs Source codeOpen source

Our rating

4.1/5

A code graph that keeps itself current and that a company can adopt under MIT, though it reads less deeply than GitNexus and phones home unless told not to.

What is CodeGraph?

CodeGraph parses a repository into a local SQLite graph of symbols, calls, imports and inheritance, then serves it to coding agents over MCP. By default the server lists a single tool, codegraph_explore, which returns the relevant source grouped by file, the call paths between symbols and a blast-radius summary in one call. Seven narrower tools (node, search, callers, callees, impact, files, status) stay available through the CODEGRAPH_MCP_TOOLS environment variable or as CLI commands, and codegraph affected lists the test files a diff touches.

Parsing runs in a Rust kernel for 20 languages, with 34 listed in total, from TypeScript and Python to COBOL, Terraform and Nix, and route detection for 17 web frameworks. A file watcher updates the graph about two seconds after each save, and no LLM or API key is involved. codegraph install wires up nine agents, including Claude Code, Cursor, Codex CLI, Gemini CLI and GitHub Copilot; codegraph init indexes each project.

The repo, created in January 2026, has about 75,400 stars and is MIT-licensed. The latest release is v1.6.2 from 3 October 2026, and the npm package logged about 77,000 downloads in the week to 22 October. A hosted pull-request analysis product is on a waitlist at getcodegraph.com with no prices published.

How to install CodeGraph

npx @colbymchenry/codegraph && codegraph init

Is CodeGraph worth it?

CodeGraph solves the problem that undermines most code graphs: they go stale. Its watcher re-syncs changed files about two seconds after a save, tool responses flag any file still waiting to sync, and a reconnecting server catches up on edits made while it was off, such as a git pull. GitNexus needs --watch or its enterprise tier for that, and Graphify, reviewed under repos, is out of date after a pull until you run an update.

The maintainer's benchmark is unusually careful for a self-reported one. Claude Opus 4.8 answered one architecture question on each of seven open-source repos, four runs per arm, with the codegraph CLI blocked in both arms after an earlier harness let the control arm reach it in 26 of 28 runs. The medians: 88% fewer tool calls, 62% fewer tokens and 44% lower cost. The spread matters more than the average. On VS Code the agent made 2 calls instead of 28 and spent $0.53 instead of $1.80; on Gin, a small Go project, cost was even at $0.31. The README also admits the opposite effect: CodeGraph's dense answers leave about 80% more retrieved text sitting in the context window by the end of a session, 67,000 tokens against 18,000 on VS Code.

The narrow surface is deliberate. One listed tool steers agents better than a menu, the maintainer argues, and it is read-only, so nothing in the MCP server edits code. That also means no previewed rename, no raw graph queries and no statement-level data flow, all of which GitNexus offers. GitNexus reads deeper; CodeGraph's MIT licence lets a company run it today, where GitNexus needs a commercial deal even for a pilot.

Two defaults deserve attention. Anonymous usage telemetry is on unless you switch it off in the installer, with codegraph telemetry off or with DO_NOT_TRACK=1; the documented fields exclude code, paths and queries. The installer also writes MCP config, auto-allow permissions for Claude Code and a marker-fenced section in CLAUDE.md or AGENTS.md. Agents do not always use it: a July issue reports Claude Code grepping anyway, and the fix is the alwaysLoad setting now in the README.

The project ships fast and has a backlog to match: about 140 open issues and 400 open pull requests. The codegraph ui viewer appears in the docs, but users on 1.6.0 report "unknown command" in an issue still open since September. A search of the official MCP registry finds other projects called CodeGraph and none from this repo, so check the npm name, @colbymchenry/codegraph, before installing.

Where it earns its place

  • A backend developer on an 11,000-file TypeScript monorepo

    Stop the agent grepping through dozens of files before it can explain a flow

    Run npx @colbymchenry/codegraph once, then codegraph init in the repo, and set alwaysLoad so Claude Code sees codegraph_explore from the first prompt. On the README's VS Code benchmark that cut a question from 28 tool calls to 2; budget for the larger context footprint in long sessions.

  • A platform engineer at a 30-developer SaaS company

    Run only the tests a change can affect in CI

    Pipe git diff --name-only into codegraph affected --stdin --quiet and pass the result to the test runner. It follows imports to a depth of 5 by default, so tests reached through dependency injection or reflection can be missed; keep a nightly full run.

  • An engineering manager rolling an agent out across a team

    Give every developer the same code context without a licence negotiation

    MIT means no commercial deal, unlike GitNexus. Use codegraph install --yes in the dev-container image and set CODEGRAPH_TELEMETRY=0 there if usage statistics leaving company machines is a concern. The hosted PR product is waitlist-only, so there is no vendor contract to sign or price to compare.

Before you commit

Setup
The shell or PowerShell installer bundles its own runtime, or npm i -g @colbymchenry/codegraph; codegraph install configures Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity, Kiro and GitHub Copilot, then codegraph init builds each project's graph. The README puts a fresh index of the 27,000-file Swift compiler repo at about 100 seconds.
Integrations
One MCP tool by default (codegraph_explore) over stdio; node, search, callers, callees, impact, files and status re-enabled with CODEGRAPH_MCP_TOOLS. All are read-only. The same functions are CLI commands and a Node API (Node 22.5+ when embedded).
Data and privacy
Code, the graph and searches stay local in .codegraph/codegraph.db. Telemetry sends daily counts of commands, agents and indexed languages unless disabled, and the server checks GitHub for a new version once a day. No security advisories are published; npm packages and release bundles have carried provenance attestations since July 2026.
Cost at scale
Free; the cost is machine time. The README reports the Linux kernel (70,000 files) indexing in under 12 minutes on a 2-core, 6 GB VPS, and a one-file edit re-syncing in about 4 seconds on the Swift repo. No hosted fees until the waitlisted platform prices itself.
Limits
Files over 1 MB and gitignored paths are skipped. Static analysis misses runtime dispatch and reflection: cross-file coverage is 73.8% for Liquid and 83.3% for Spring routes. WSL2 projects on /mnt drives have socket and locking problems, and only one writer per project is allowed.

What's good

  • Graph re-syncs about two seconds after each save
  • MIT licence; no LLM, API key or network service for indexing
  • Read-only MCP surface with one tool by default
  • Careful self-reported benchmark, including where it costs more context

What's not

  • Anonymous telemetry on by default
  • No rename, raw queries or data-flow analysis, unlike GitNexus
  • Answers leave more text in the context window over long sessions
  • About 400 open pull requests; documented ui command missing from releases

Best for

Teams who want their coding agent to answer from an always-current local code graph under a licence their employer will accept.

CodeGraph alternatives

Head to head

CodeGraph: common questions

Is CodeGraph worth it?
A code graph that keeps itself current and that a company can adopt under MIT, though it reads less deeply than GitNexus and phones home unless told not to. We rate it 4.1 out of 5.
How much does CodeGraph cost?
Free and MIT-licensed. A hosted pull-request analysis platform is in waitlist beta at getcodegraph.com; prices are not published.
What are the downsides of CodeGraph?
Anonymous telemetry on by default; no rename, raw queries or data-flow analysis, unlike GitNexus; answers leave more text in the context window over long sessions; about 400 open pull requests; documented ui command missing from releases.
Who is CodeGraph best for?
Teams who want their coding agent to answer from an always-current local code graph under a licence their employer will accept.
How much does CodeGraph cost for a team or in production?
Free; the cost is machine time. The README reports the Linux kernel (70,000 files) indexing in under 12 minutes on a 2-core, 6 GB VPS, and a one-file edit re-syncing in about 4 seconds on the Swift repo. No hosted fees until the waitlisted platform prices itself.
Is CodeGraph safe for company data?
Code, the graph and searches stay local in .codegraph/codegraph.db. Telemetry sends daily counts of commands, agents and indexed languages unless disabled, and the server checks GitHub for a new version once a day. No security advisories are published; npm packages and release bundles have carried provenance attestations since July 2026.
What are the best CodeGraph alternatives?
The closest alternatives we have reviewed are GitNexus, code-review-graph, Serena, Semble and Project RAG.

Answers checked Oct 26, 2026.

Make CodeGraph? Show this rating on your siteCodeGraph rated 4.1 out of 5 on ReviewRamble