← Back to Resources

Prompts

Graphify — Slash Claude Code Token Usage with a Knowledge Graph

💡 What is this? Graphify is a free, open-source tool that builds a knowledge graph of your entire codebase — so Claude Code navigates relationships instead of re-reading files every session. The result: up to 70% fewer tokens consumed.

🧠 The Problem It Solves

ProblemImpact
Claude re-reads every file on each new sessionThousands of tokens burned before you ask a question
Large codebases = instant token drainMost users exhaust their plan in 2 days
$20 plan feels underpoweredLimits creativity and productivity

⚙️ How Graphify Works

Step 1 — Run it once on your codebase
Graphify scans every file and function across your entire project.

Step 2 — It builds a full knowledge graph
Every connection and relationship between files, functions, and modules is mapped.

Step 3 — Claude navigates, not reads
In future sessions, Claude traverses the graph instead of re-reading raw files — slashing token usage by up to 70x.


🚀 Setup Guide

📦 Installation & First Run
  1. Open the GitHub link: https://github.com/safishamsi/graphify
  2. Clone the repo into your project root:
git clone https://github.com/safishamsi/graphify
cd graphify
  1. Run the indexer on your codebase:
python graphify.py --path /your/project/path
  1. Point Claude Code to the graph — follow the repo README for the Claude integration step
  2. Start a new Claude Code session — token usage should drop dramatically from the first query
✅ Verifying It's Working
  • Compare token counts before and after on a sample session
  • Claude should answer structural questions ("where is X called?") without reading source files
  • First session after indexing will still consume setup tokens — savings appear from session 2 onward

💬 Prompts to Use with Graphify

🗺️ Explore Your Codebase via the Graph
Using the knowledge graph, give me an overview of how [feature or module name] is structured. What are the key files, functions, and dependencies involved? Don't read files — navigate the graph.
🔍 Find Relationships Between Components
Without reading source files, use the graph to tell me: what calls [function name], what does it depend on, and where does its output go?
🛠️ Targeted Debugging with Minimal Tokens
I'm seeing an issue with [describe bug]. Using the graph, identify the most likely files and functions involved. Only read a file if you can't answer from the graph alone.

📊 Token Savings at a Glance

PlanBefore GraphifyAfter Graphify
Claude Pro ($20/mo)Exhausted in ~2 daysLasts the full month
Claude Max ($100/mo)Needed for large projectsReplaced by $20 plan
Token burn per sessionHigh (full re-read)~70% lower