colbymchenry/codegraph
AI EngineeringBuilds a local code knowledge graph that gives coding agents exact symbols, call paths and change impact in one query.
What it does
CodeGraph indexes a codebase into a local SQLite knowledge graph of symbols, call edges, imports, inheritance and framework routes, then exposes it to AI coding agents through an MCP server. Instead of having an agent grep and read files one at a time to answer "how does X work" or "what breaks if I change Y", the agent makes one codegraph_explore call and receives verbatim source grouped by file, call paths between symbols, and a blast-radius summary. Everything runs locally, and the index updates automatically as files change.
The project targets developers already using agentic coding tools — Claude Code, Cursor, Codex CLI, opencode, Gemini CLI, Copilot, Windsurf, Kiro and others — especially on larger or multi-language codebases where file-by-file discovery burns tool calls and tokens. Parsing is handled by a native Rust kernel using tree-sitter grammars, with coverage for 20+ languages and framework-aware detection of routes, including Expo Router and Next.js navigation edges and iOS/React Native bridging.
Quick start
The documented flow has three stages: install the CLI, wire it into your agents, then index each project.
- Install the CLI. The installer needs no separate Node.js runtime because it bundles one:
# 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
If you already have Node, npm i -g @colbymchenry/codegraph is an alternative. Open a new terminal afterwards, since the installer does not modify your current shell.
-
Connect your agents. In the new terminal run
codegraph install; it detects installed agents and writes the CodeGraph MCP server entry into each one (plus a short section in files likeCLAUDE.md/AGENTS.md). This step configures agents only and does not index code. -
Index a project:
cd your-project
codegraph init
This creates .codegraph/ and builds the graph. Auto-sync is on by default, so later edits are picked up without rerunning anything. Restart your agent once after wiring, then it uses CodeGraph automatically in projects that have an index.
Configuration and data handling
Language detection is automatic from file extensions, so no per-language setup is needed. Dependency and build directories (node_modules, dist, vendor, .venv and similar) are skipped by default, and .gitignore is honored. Files over 1 MB are excluded. To keep committed directories out of the graph, use an exclude list in a project-level codegraph.json; to map non-standard extensions such as .dota_lua to a supported language, use the same file's extensions map.
The index lives in a per-project .codegraph/ directory and is never pushed by the tool, but whether it appears in version control depends on your .gitignore; codegraph init --local-only keeps it out of git. Running as a library requires Node 22.5+ for node:sqlite, while the CLI and MCP server run on the bundled runtime. Anonymous usage telemetry is enabled by default and can be disabled with codegraph telemetry off, CODEGRAPH_TELEMETRY=0 or DO_NOT_TRACK=1. The project is MIT licensed and supports Windows, macOS and Linux on x64 and arm64 Get Started.
HotRepo's take
Between 2026-05-18 and 2026-05-26 the repository went from 3,855 to 26,683 stars in the daily all-language snapshots, with single-day gains of 1,869 to 4,294; by the 2026-10 snapshots it was at 72k+ stars and it held the 10th spot on the TypeScript daily list on 2026-11-18. That scale of adoption is unusual for a project whose stated purpose is saving agent tool calls.
The README's benchmark is the part worth reading critically: 88% fewer tool calls and 62% fewer tokens are measured against Claude Opus 4.8 on seven open-source repos, with the CLI deliberately blocked in both arms. That is a narrow measure — one architecture question per repo, medians of four runs — and says nothing about whether the graph helps on messy, dynamically typed code. The self-reported cross-file coverage (95.8% on its own repo, 100% on requests) is more telling for where the graph's usefulness stops than any aggregate win. The HN discussion is thin, but one reply characterizes the approach as basically an AST wrapper around filesystem I/O rather than a fix for context persistence HN thread, which is a fair framing: CodeGraph reduces discovery work, not model context limits.
For teams with large multi-language repos and a configured coding agent, the setup cost is low — one installer, one init per project. The main things to check before relying on it are language coverage for your stack, whether auto-sync keeps up on very large repos, and the telemetry default.
Written by AI from the project's README, updated . The project's own docs are the source of truth.
Hacker News
You might also like
- xingkongliang/skills-managerA desktop app for people who use several coding agents at once and need one place to store, deploy and sync their skills.
- Alishahryar1/free-claude-codeRoute existing coding agents and IDEs through a shared catalog of free model providers, with fallback and token-saving options.
- ScottDuncanAI/PID-to-Knowledge-GraphClaude skill that turns P&ID and PFD PDFs into a queryable process knowledge graph of flows, instruments and control loops.
- Graphify-Labs/graphifyBuilds a local, queryable knowledge graph of a codebase so coding agents can navigate it instead of grepping.
- abhigyanpatwari/GitNexusIndex a codebase into a queryable knowledge graph that coding agents and editors can search via MCP.