AI coding agents can read code, but reading is not the same as understanding the map of an entire project. CodeGraph builds a semantic knowledge graph of your repository so agents like Claude Code, Codex, Cursor, OpenCode, and Hermes Agent can navigate large codebases faster, wi…
AI coding agents can read code, but reading is not the same as understanding the map of an entire project. CodeGraph builds a semantic knowledge graph of your repository so agents like Claude Code, Codex, Cursor, OpenCode, and Hermes Agent can navigate large codebases faster, with fewer tokens and fewer wasted tool calls.
CodeGraph is an open-source tool that pre-indexes a codebase into a semantic knowledge graph, stored locally in a SQLite database. It uses tree-sitter to parse source code into abstract syntax trees, extracts symbols like functions, classes, and methods, creates edges for calls, imports, inheritance, and references, and exposes all of this through MCP tools that AI coding agents can query.
The metaphor is simple: CodeGraph is Google Maps for your codebase. Without a map, an AI agent entering a large repository has to walk every street, opening every file, to find the right address. With a map, the agent can ask where the login logic lives and immediately see the route, controller, service, and related files. The repository has been gaining stars rapidly and showed approximately 17.6 thousand stars on GitHub at the time of research, with around 320 commits. It is MIT-licensed.
CodeGraph parses your codebase with tree-sitter, extracts symbols and their relationships, and stores them in a local SQLite graph database at .codegraph/codegraph.db. When running as an MCP server, it exposes tools like search, , , , , , , , and . An agent can search for a symbol, build context around a task, find who calls a function, trace what a function calls, and analyze the blast radius of a change before making it.
contextcallerscalleesimpactnodeexplorefilesstatusThe installer can auto-configure the MCP server and instructions for supported agents. A file watcher with auto-sync keeps the graph up to date as you edit code. The tool indexes according to .gitignore and skips files larger than 1 MB, so it focuses on source code rather than generated or binary files.
According to the project's README, benchmarks across seven real-world open-source codebases in seven languages (four runs per arm, median reported) show averages of 35 percent cheaper, 59 percent fewer tokens, 49 percent faster, and 70 percent fewer tool calls.
CodeGraph is most useful for large repositories or agent workflows that require significant exploration. For small repos, native search and read operations may already be cheap enough that the overhead of indexing does not pay off. The agent must actually use the CodeGraph tools -- if it ignores them and reads files at random, the benefit evaporates. The benchmark numbers are claims from the project's own README, not independently verified, so you should test them in your own workflow before trusting them. The rapid star growth is a strong signal of community interest, but it is not proof that the tool is perfect. And because CodeGraph respects .gitignore and skips large files, you should understand why a symbol might be missing from the graph before assuming the graph is broken.
CodeGraph is for developers, indie hackers, and teams using AI coding agents on large or complex repositories. If your agent workflow involves significant codebase exploration, if you are burning tokens on file scanning, or if you need impact analysis before making changes, this is directly relevant. For small projects where native search is sufficient, the value is lower.
CodeGraph does not replace Claude, Codex, or Cursor. It gives them a local map so they understand your repo faster, explore less, and burn fewer tokens doing it.