TL;DR
CodeGraph is a CLI tool that builds a pre-indexed knowledge graph of the semantic structure of a codebase, helping AI coding agents understand code with fewer tokens and tool calls.
Key features
Code knowledge graph construction: Analyzes the code structure (functions, classes, dependencies, etc.) of a project and generates a pre-indexed graph.
MCP server provision: Serves the generated graph as an MCP (Model Context Protocol) server, enabling various AI coding agents like Claude Code, Cursor, Codex, and Gemini to utilize it.
Local execution: All processing is done locally, with no need for external API calls.
Automatic installation and setup: The codegraph install command automatically detects supported agents and connects the MCP server.
Cost and efficiency improvement: Using the pre-indexed graph reduces token usage by about 16% and tool call count by about 58%.
When to use it
When using AI coding agents (Claude Code, Cursor, Codex, etc.) to explore or refactor large codebases.
When you want to reduce token costs and response time by helping the agent quickly understand the code structure.
When you want to perform code analysis locally and optimize agent performance without relying on external services.