CodeGraph: give Claude Code a map of your project, and a one-line check for when it's worth it
The short version
When you ask Claude Code a question about your project, it finds the answer the slow way: it searches, opens a file, reads it, opens the next one. Every file it reads uses up part of your usage limit and adds waiting time. CodeGraph, by Colby McHenry (a solo developer, "15+ years of experience building software" per his GitHub profile), builds a map of how your code connects: which function calls which, which file imports which. Claude Code asks the map instead of opening file after file. The README's own words: it "hands the agent the exact code it needs in one call". It's free and open source (MIT), runs on your own computer, and has 74,730 stars on GitHub. The map updates itself every time a file changes, so there is nothing to re-run. Source: the repo's README and GitHub page, checked 23 Oct 2026.
| What | The number |
|---|---|
| Stars on the repo | 74,730 (checked 23 Oct 2026) |
| Files Claude opened, maker's big test (~640 files) | 18 → 0 |
| Time, same question | 2 min 42 s → 45 s |
| Cost on the maker's small test (~110 files) | about even |
| Extra context left in Claude's short-term memory | about 80% more (README) |
| Commands to set it up | 3 |
The maker's own test
These are Colby McHenry's own numbers from the README, not an independent test. Setup: Claude Code run headless on Claude Opus 4.8, the same question asked with and without CodeGraph, median of 4 runs each, re-measured 5 August 2026.
- Big project: Excalidraw (a drawing app, about 640 files), question "How does Excalidraw render and update canvas elements?". Without the map: 18 files opened, 43 tool calls, 2 min 42 s, USD 2.43. With the map: 0 files opened, 2 tool calls, 45 s, USD 0.54.
- Small project: Gin (about 110 files). Without: 4 files opened, 46 s, USD 0.31. With: 0 files opened, 28 s, USD 0.31. Faster, but the cost came out about even.
The README explains why: the saving tracks how much searching the question needed. Little searching, little to save. (Its other ~110-file test, Alamofire, needed a lot of searching and came out 57% cheaper, so size is a rough guide, not a rule.)
Worth it yet? The one-line check
In your project folder, in the terminal, run:
git ls-files | wc -l
It prints how many files git tracks in your project (it needs the project to be a git repo). Read it against the maker's two tests:
- Around 110 or fewer: the maker's small test came out about even on cost. Skip it for now.
- Somewhere in between: try it on the questions where Claude opens the most files, and see if it helps.
- Around 640 or more: that's the size of the maker's 18 → 0 test. Worth trying.
This is our rule of thumb, not the repo's. The file counts are the README's; reading them as "wait" or "try it" is ours.
Install (as the README states it)
- Install the tool. macOS / Linux:
Windows (PowerShell):curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh
Already have Node?irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iexnpm i -g @colbymchenry/codegraphworks instead. Then open a new terminal, so thecodegraphcommand is found. - Plug it into Claude Code. In the new terminal:
It finds Claude Code (and other coding tools you have) and connects CodeGraph to them. It also adds a short, marked CodeGraph section to your CLAUDE.md. It does not map any code yet. Restart Claude Code afterwards so it loads.codegraph install - Draw your project's map. Once per project:
That builds the map in acd your-project codegraph init.codegraph/folder in your project. From then on it updates itself when files change.
A word on step 1: curl … | sh downloads a script and runs it straight away. That's normal for developer tools, but you are
running someone else's script, so only use the exact line from the README.
The catch
- Small projects barely gain. On the maker's ~110-file test the cost came out about even (above).
- It fills more of Claude's short-term memory. The README says so itself: its answers leave about 80% more sitting in the context window (Claude's short-term memory for the conversation) at the end of a session than reading files does. On VS Code that was 67k tokens against 18k. Its advice: "If you run long sessions in a small window, budget for it."
- The numbers are the maker's. Nobody independent has re-run this exact test that we found.
- Anonymous usage stats are on unless you say no. The README says it collects which tools and commands get used and which languages get indexed, never your code, paths or file names. The installer asks up front.
How to turn it off
- Stop the usage stats:
codegraph telemetry off(or setCODEGRAPH_TELEMETRY=0orDO_NOT_TRACK=1). - Remove it from one project:
codegraph uninitin that project (removes its map). - Remove it completely:
codegraph uninstall. It shows you what it found first, then removes CodeGraph from Claude Code and your other tools, and thecodegraphcommand itself. Add--keep-clito keep the command. Your projects' maps stay until youcodegraph uninitthem.
Sources
- The repo and README (install, benchmark table, "A note on context", telemetry, uninstall): https://github.com/colbymchenry/codegraph (checked 23 Oct 2026; 74,730 stars; MIT)
- Docs site: https://colbymchenry.github.io/codegraph/
- Per-repo context measurements (the 80% note): https://github.com/colbymchenry/codegraph/blob/main/docs/benchmarks/residual-context-occupancy.md
- Telemetry field list: https://github.com/colbymchenry/codegraph/blob/main/TELEMETRY.md
- Maker's GitHub profile: https://github.com/colbymchenry