Cut Cursor and Claude Code token costs by turning your codebase into a deterministic knowledge graph with Graphify.
How much of your coding assistant budget goes to re-explaining the same codebase every session?
Large language models charge by token. Every file you paste, every broad @codebase query, and every repeated architecture explanation adds cost and latency. Graphify reduces that overhead by building a deterministic knowledge graph from your repository, source code, docs, SQL schemas, config files, and PDFs. The assistant navigates structured relationships instead of re-ingesting large context windows on every turn.
This guide covers installation on Windows, macOS, and Linux, then shows how to wire Graphify into Cursor and other coding assistants. For broader token-reduction tactics, see 50 Ways to Reduce LLM Token Usage. For tool selection context, see 22 Coding Assistants and Their Capabilities.
Why a Knowledge Graph Beats Raw Context
Vector search retrieves similar chunks but can miss structural dependencies: who calls whom, which config activates a feature, or how a schema change propagates. Graphify extracts symbols and edges from your project AST and indexes them for targeted queries such as graphify query "where is authentication handled" or graphify path "UserService" "Database".
The graph lives locally under graphify-out/. Cursor rules generated by graphify cursor install instruct the assistant to query the graph before reading entire directories. On large repos, teams report lower token consumption, faster responses, and fewer hallucinated file paths.
Install on Windows
Install winget if needed: https://aka.ms/getwinget
Ensure
C:\Users\<you>\AppData\Local\Microsoft\WindowsAppsis in yourPATHInstall uv:
winget install astral-sh.uvRestart PowerShell and verify:
uv --versionInstall Graphify:
uv tool install graphifyAdd
C:\Users\<you>\.local\binto yourPATHif the shell cannot findgraphifyFrom your project root, install Cursor integration:
graphify cursor installBuild the initial graph:
graphify . --code-only
For Claude Code, Codex, and Gemini CLI, follow the integration steps in the Graphify repository documentation.
Install on macOS
Install Homebrew if needed: https://brew.sh
Install uv:
brew install uvVerify:
uv --versionInstall Graphify:
uv tool install graphifyEnsure
~/.local/binis in yourPATH. Add to~/.zshrcif required:export PATH="$HOME/.local/bin:$PATH"Install assistant integration and build the graph:
cd /path/to/your/project graphify cursor install graphify . --code-only
On Apple Silicon and Intel Macs, uv handles architecture-specific wheels automatically.
Install on Linux
Install uv using the official installer:
curl -LsSf https://astral.sh/uv/install.sh | shReload your shell or source your profile, then verify:
uv --versionInstall Graphify:
uv tool install graphifyConfirm
~/.local/binis on yourPATHFrom your project directory:
graphify cursor install graphify . --code-only
For Debian or Fedora systems without curl, download the uv release binary from the Astral documentation and place it on your PATH.
Configure Cursor and Keep the Graph Current
After graphify cursor install, Graphify creates .cursor/rules/graphify.mdc with instructions to query the graph before broad file reads. The cached index under graphify-out/cache/ speeds repeated lookups.
Operational habits that preserve token savings:
- Run
graphify query "<question>"yourself when exploring unfamiliar modules - Use
graphify update .after meaningful code changes (AST-only, no API cost) - Prefer
--code-onlyfor large monorepos when docs and PDFs are not needed - Combine Graphify with the scoping practices in 50 Ways to Reduce LLM Token Usage: narrow
@references, smaller rules files, and concise prompts
Rebuilding the full graph on every save is unnecessary. Schedule updates after merges or run graphify update . as a pre-commit or CI optional step for teams that want always-fresh symbols.
When Graphify Fits Enterprise Repositories
Graphify delivers the most value when:
- The codebase spans dozens or hundreds of packages
- Onboarding assistants without dumping entire trees into context
- Cross-language projects where grep alone misses inferred dependencies
- Compliance-sensitive environments that prefer local indexing over uploading code to third-party embedding services
It complements, not replaces, good prompt discipline and assistant configuration covered in 22 Coding Assistants and Their Capabilities.
Related Reading
- 50 Ways to Reduce LLM Token Usage
- 22 Coding Assistants and Their Capabilities
- 86 Most Popular Open Source AI Tools
Contact Sea Wing AI to reduce LLM token costs across your engineering teams.