MCP server and CLI that index codebases into a local knowledge graph and provide impact analysis
CodeGraph, developed by Colby McHenry, indexes a codebase into a local knowledge graph ahead of time. The graph updates automatically as the code changes, so agents don’t have to rediscover files in every session through cycles of grepping and reading. A single query returns call chains, the impact of a change, and structural context. One codegraph install command detects and configures Claude Code, Codex, Gemini CLI, Cursor, OpenCode, Antigravity, Kiro, and Copilot.
harrisonsec.com ran an independent test on the Hono repository (about 280 files, 5 questions, 4 runs each). Tool calls fell by 55%, latency by 20%, and tokens by 23%. Costs, however, rose by 6.8%. The 35% cost reduction reported in the publisher’s benchmark across 7 repositories did not hold up on this small repository. The most important finding was in the worst-case results, not the average. Without indexing, the agent made as many as 52 tool calls in some runs; with CodeGraph, no run exceeded 16. For plain-text searches, the agent never used CodeGraph and went straight to grep.
It has 76k stars, an MIT license, and receives updates almost daily. Like Serena and codebase-memory-mcp, it serves the same purpose using a different approach. The main benefits are for large repositories and structural questions. Don’t expect to save money on small repositories.
Teams working in repositories with thousands of files, multiple packages, or multiple runtimes. Those looking to speed up architectural questions and impact analysis while limiting the agent’s discovery loop.
Can increase costs on small repositories and simple questions. The structural context it loads upfront may outweigh the few grep steps it saves. It collects anonymous usage statistics; it asks during setup, and telemetry can be disabled with codegraph telemetry off or DO_NOT_TRACK=1. There are 233 open issues.
curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh npm i -g @colbymchenry/codegraph codegraph install codegraph init