Same question, same codebase, two different runs. The first run burned through tokens. The second used up to 72× fewer. The only thing that changed was one free tool, and Claude Code set it up itself.
Why Claude Code wastes tokens
When you ask Claude Code about your project, it doesn't actually know the project. It searches for files, reads them, and loads them into context every time you ask a question. On a small repo that's cheap. On a big one, you pay to reread the same files over and over, session after session.
Graphify fixes the lookup. You point it at your project and it builds a knowledge graph of everything: every file, every function, and the connections between them. Then, instead of querying the files, Claude queries the graph.
flowchart LR Q[Your question] --> CC[Claude Code] CC -->|queries| G[graph.json\nknowledge graph] G -->|scoped subgraph| CC CC -.->|only when needed| F[Source files]
What Graphify generates
One command produces three files:
graph.htmlis an interactive map of your codebase you open in the browser. You can zoom, search nodes, and follow the connections between files and functions.GRAPH_REPORT.mdhas the highlights of your code: key concepts, surprising connections, and suggested questions.graph.jsonis the full graph Claude queries at any time without rereading your files. This is the one that saves the tokens.
Setting it up
I did this the way you would on a real project. The demo repo is Flask: clone it, open the folder, start Claude Code.
1. Let Claude install it
Open a Claude Code session and prompt:
Set up Graphify from https://github.com/safishamsi/graphify in this repo.
Claude fetches the repo, reads the instructions, and handles the install. Takes a minute or two.
2. Start a fresh session
Run /clear (or close and reopen). You don't want the setup conversation sitting in context when you start asking real questions.
3. Build the graph
graphify .
It walks every file and function and builds the map. On a new project it builds the full pipeline from scratch; how long depends on the size of the repo. When it finishes you'll find the three files in a graphify-out/ folder.
4. Make Claude always use it
Check your CLAUDE.md. If there's a Graphify section, you're done: every new session will know the graph exists. If it's missing, the Graphify repo has a "make the system always use the graph" section. Find the command for your platform (Claude Code in this case) and run it once.
The graph explorer
Before the token test, open graphify-out/graph.html. It's the full map of the codebase: every node searchable, every connection visible. Searching "test request processing" jumps straight to the function and shows the file it lives in and what it's related to. It's faster than grepping through the code yourself, and it's the same shortcut Claude gets.
The token test
Same question, asked twice in fresh sessions: trace the request lifecycle from the Flask call to the final response, and name the core internal methods that handle routing.
With the graph: Claude answers "I'll query the knowledge graph first," responds in 48 seconds, and /context shows messages using 6.2% of the context window.
Without it (same question, but told not to use Graphify): Claude falls back to listing directories, pattern-searching, and reading whole files like ctx.py. The answer takes 59 seconds and messages fill 70% of the context.
Honest numbers
The savings depend on how big your repository is and how it's linked together. The headline figure is up to ~72× fewer tokens; on this Flask demo the realistic difference was closer to 3×. The graph can also go stale after a big refactor, so rebuild it when the structure changes.
Still, on big projects, especially research-heavy ones where Claude does a lot of reading, this one command pays for itself fast.
Links
- Graphify
- Claude Code
- Flask (the demo repo)
If you're setting up Claude Code for your team and want the token bill under control from day one, get in touch. See our AI consulting service for how we work.