← Academy colbymchenry /codegraph79,110MITTypeScript

CodeGraph

Give Claude Code a map of your code instead of a search

CodeGraph builds a local map of every function, call and import in your project. Claude Code asks the map instead of opening file after file. In its own test, that meant 88% fewer tool calls and answers 53% faster. Here is how to set it up, and the one cost to watch.

Ask Claude Code how a request reaches your database and watch what it does: search, open a file, search again, open three more. It rebuilds the structure of your code by hand every time. CodeGraph, by Colby McHenry, builds that structure once, on your own computer, as a map of every function, every call and every import. Claude Code asks the map and gets back the exact code and the path between the pieces in one call.

fewer tool calls
88%
faster answers
53%
files opened on all seven test repos
0
stars on GitHub
78K+
colbymchenry /codegraphPublicPre-indexed code knowledge graph, auto syncs on code changes, for Claude Code and other agents: fewer tokens, fewer tool calls, 100% local
Language
TypeScript
Stars
79,110 on 29 Nov 2026
License
MIT
Best for
Medium and large codebases where Claude Code spends its first minutes searching
Needs
macOS, Linux or Windows; Node.js not required
Open on GitHub ↗

How it works

Read

  1. 01Your code: a fast parser reads every file, in 20+ languages

→ functions, classes, calls, imports

Store

  1. 02Map: a local SQLite database in .codegraph/ in your project

→ the graph

Ask

  1. 03Claude Code: one question, for example "how does a request reach the database?"

→ one call to the map

Answer

  1. 04Map: the exact source, the call path between the pieces and what a change would affect

→ no file-by-file search

Sync

  1. 05Watch: every file change updates the map within seconds

→ never stale

Where the numbers come from

The figures are CodeGraph's own benchmark, re-measured on 5 August 2026: Claude Code answering one architecture question on seven open-source repos, from VS Code to Gin, four runs each, with and without CodeGraph. With it, Claude answered in one to four calls and opened no files. Without it, it needed up to 43 tool calls. The cost saving depended on the question: 57 to 78% where the plain agent needed many calls, about even on a small Go repo.

The README is just as clear about the other side. CodeGraph's answers are dense and stay in the context window, so at the end of a long session about 80% more retrieved context is sitting there than with a file-reading agent. If you work in long sessions, keep that in mind.


(01)Install the tool

npm i -g @colbymchenry/codegraph

Without Node.js, the README has a one-line installer for macOS, Linux and Windows. Open a new terminal afterwards so the command is found.

(02)Connect it to Claude Code

codegraph install

It finds Claude Code and the other agents you use and adds CodeGraph to each. This step only connects; it does not map any code yet.

(03)Map a project

cd your-project
codegraph init

This builds the map in .codegraph/. From then on it updates itself while you and your agent edit.

(04)Or remove it all

codegraph uninstall

It shows what it will remove from each agent and the tool itself before deleting anything. Project maps stay until you run codegraph uninit in each project.


Before you start

How you know it is done

  • Everything runs on your computer. The map is a local database in your project.
  • Anonymous usage counts (which commands, which languages) are sent by default. Never code, paths or names. codegraph telemetry off turns it off.
  • Answers from the map stay in your context window. On long sessions in a small window, plan for it.
  • The numbers are CodeGraph's own benchmark on one question per repo. Your codebase and questions will differ.
Stars
79,110 on 29 Nov 2026
License
MIT
Install
npm i -g @colbymchenry/codegraph
Connect
codegraph install
Map a project
codegraph init
Remove
codegraph uninstall

Common questions

Got any questions left?

Is it free?

Yes, MIT. A hosted product is announced separately; the tool here is free and local.

Does my code leave my computer?

No. The map is built and stored locally. Only anonymous usage counts are sent, and you can turn those off.

Does it work with other agents?

Yes. codegraph install sets up Cursor, Codex, Gemini CLI, GitHub Copilot and more besides Claude Code.

Do I have to rebuild the map after changes?

No. It watches your project and updates the map on every file change.

Will it make every session cheaper?

Usually fewer tool calls and faster answers. Cost savings vary by question, and its answers take more room in your context window.

Build systems that run your brand__

info@hybrdstudio.com
Share article X LinkedIn

Discover more