Cut Cursor and Claude Code token costs by turning your codebase into a deterministic knowledge graph with Graphify.
Want to reduce your LLM token usage (and your AI bill)?
If you’re using Cursor, Claude Code, Codex, or Gemini CLI, I recently came across Graphify, and it’s a clever approach to reducing context size without relying on vector databases.
Instead of sending large portions of your codebase to the LLM, Graphify builds a deterministic knowledge graph from your project—including source code, documentation, SQL schemas, configuration files, and PDFs. The AI can then navigate the graph instead of repeatedly consuming huge amounts of context.
Quick setup
Install winget (if you don’t already have it).
https://aka.ms/getwingetEnsure
C:\Users\HP\AppData\Local\Microsoft\WindowsAppsis in yourPATH.Install uv:
winget install astral-sh.uvRestart PowerShell and verify:
uv --versionInstall Graphify:
uv tool install graphifyIf needed, add
C:\Users\HP\.local\binto yourPATH.Open Cursor and run:
graphify cursor install(For Claude Code, Codex, and Gemini CLI, see the Graphify documentation.)
From your project folder, build the graph:
graphify . --code-only
Graphify creates a .cursor/rules/graphify.mdc file so Cursor automatically uses the project graph. It also generates a cached graph (such as graphify-out/cache/stat-index.json) that helps the AI understand your codebase more efficiently.
For larger repositories, this can mean:
- Lower token consumption
- Lower API costs
- Faster responses
- Better understanding of large codebases
If you’re building AI-powered software or working with enterprise-scale repositories, it’s definitely worth exploring.
Have you tried Graphify or another approach to reducing LLM token usage? I’d love to hear your experience.