The Problem Graphify Solves
If you've used Claude Code on a real codebase — one with hundreds of files — you've hit the same frustration: Claude greps every file to answer a simple question. You ask "where do we handle payment retries?" and Claude does a wall of Grep(...) calls, reads 20 files, blows through your context window, and then gives an answer that misses the retry logic hiding in a utility file nobody thought to search.
The underlying issue is that Claude Code has no persistent understanding of your codebase's structure. Every conversation starts from zero. Every question becomes a file-scan.
Graphify is an open-source tool that fixes this by building a persistent knowledge graph of your code, then making Claude read the graph before grepping. It works as a Claude Code skill plus a PreToolUse hook. One install, and Claude stops wandering.
What Graphify Actually Does
In one sentence: Graphify indexes your codebase into a queryable knowledge graph that captures not just "which files exist" but "which functions depend on which," "which modules are central (god nodes)," and "which files form clusters of related concern (communities)."
Technically, it combines:
- Tree-sitter static analysis — parses your source code into ASTs across 40+ languages
- LLM-driven semantic extraction — uses the LLM you're already paying for to extract intent and relationships that static analysis can't see
- Multi-modal support — can ingest not just code but docs, research papers, images, and videos into the same graph
The output is a graph you can query. For Claude Code specifically, the integration ships a GRAPH_REPORT.md file that summarizes the graph's structure — which Claude reads before deciding what to grep.
The Claude Code Integration (The Important Part)
The deepest Graphify integration is for Claude Code. Here's what one install command configures:
- A
CLAUDE.mddirective that tells Claude: "If a knowledge graph exists for this project, consult it first." - A PreToolUse hook on file-search tools. Before Claude calls
GreporGlob, the hook injects: "graphify: Knowledge graph exists. Read GRAPH_REPORT.md for god nodes and community structure before searching raw files."
The result: Claude navigates by structure. Instead of greping 40 files to find "payment retry logic," it reads the graph, sees that payment/ is a community with a god node processPayment, reads only that file, finds the retry wrapper, and answers in one round-trip.
Reported token savings (from the maintainer's benchmarks and independent tests):
- 6.8x fewer tokens on code review tasks
- Up to 49x fewer tokens on daily coding tasks in large repos
Your mileage depends heavily on repo size. Small repos (<30 files) won't see much benefit — Claude could just read everything. Large repos (500+ files) see the biggest win because the alternative is pathological grepping.
Installation (Claude Code)
The package is published to PyPI as graphifyy (double-y, the single-y package is a different library):
pip install graphifyy
Then in your project root, run the skill's init command:
/graphify
Inside Claude Code. This triggers Graphify to:
- Walk the codebase
- Build the graph (10-60 seconds for most repos, longer for 1000+ files)
- Write
GRAPH_REPORT.mdto your project root - Add the CLAUDE.md directive
- Register the PreToolUse hook
After that, Claude consults the graph automatically. You don't have to remember to use it.
When to Use Graphify (And When Not To)
Good fit:
- Repos with 100+ files where Claude keeps grepping everything
- Codebases with non-obvious module boundaries (Claude can't see the architecture from file names alone)
- Teams doing AI-assisted code review on large PRs
- Anyone burning through $200/month on Claude API because context is bloated
Bad fit:
- Tiny prototypes (<30 files) — overhead isn't worth it
- Greenfield projects where the code is changing hourly — the graph goes stale between builds
- Codebases that are mostly YAML/JSON config (Tree-sitter analysis adds little value there)
- One-shot scripts where you'd rather just paste the file
Other Tools in the Same Space
Graphify isn't the only knowledge-graph-for-Claude tool:
- code-review-graph by tirth8205 — narrower focus on code review specifically. Similar token-savings claims.
- Native Claude Code skills — you can get ~60% of the benefit by writing your own
codebase-mapskill that generates a summary file on project open. Less elegant but zero external dependencies.
For most teams, Graphify is the path of least resistance. If you're the type who doesn't trust third-party tools with code access, rolling your own map skill is the fallback.
Combining Graphify With Our Skills Library
One pattern that works well: use Graphify for the project structure layer, and pull targeted skills from the CLSkills browse library for the domain-specific knowledge Claude needs. Graphify tells Claude where things are in your codebase. Skill files tell Claude what rules to apply when touching them.
Example stack for a payments service:
- Graphify (understands the codebase topology)
- A PCI-compliance skill file (understands the compliance rules)
- The Claude guide covers how to stack skills + MCP + hooks — 40 pages, free
The token savings from Graphify compound with the behavior guardrails from skills. Claude both reads less AND makes fewer dumb mistakes.
A Common Gotcha: Graph Staleness
The graph is a snapshot of your code at build time. When your code changes substantially, the graph goes stale. Claude will happily read a stale graph and give you an answer that was correct 3 weeks ago.
Two mitigations:
- Re-run
/graphifyafter major refactors (it's fast — seconds to minutes) - Add a CI step that rebuilds the graph on merges to main. Stale graphs on feature branches are usually fine.
The Graphify maintainer has an open issue (#146) for native MCP integration that would auto-refresh the graph on file change. When that ships, staleness becomes a non-issue. For now: manually re-run after big changes.
FAQ
Does Graphify send my code to a third party?
The static analysis (Tree-sitter parsing) is fully local. The semantic extraction layer calls the LLM you've configured — which, for Claude Code users, is Anthropic. So your code goes wherever you were already sending it. No new third party involved.
How big can the codebase be?
Real-world reports: codebases up to ~5,000 files handle fine with reasonable hardware. Beyond that, graph build times become noticeable (5+ minutes). For monorepos of that size, running Graphify per sub-package is usually the right call.
Does it work with languages other than Python and JavaScript?
Yes. Tree-sitter supports 40+ languages including Go, Rust, Java, Ruby, C++, TypeScript, Kotlin, Swift, and more. The semantic layer is language-agnostic (it operates on the extracted symbols, not raw syntax).
Is there a non-Claude-Code version?
Yes. Graphify supports Codex, OpenCode, Cursor, Gemini CLI, GitHub Copilot CLI, OpenClaw, Factory Droid, Trae, Google Antigravity, and a few others. The /graphify command works in all of them.
Does it replace Claude Code's native Grep tool?
No. Claude still uses Grep when it needs to — but only after reading the graph first. Think of it as a planning layer: Claude now plans "which files to grep" instead of "let me grep everything."
Is this the same as MCP servers?
Not exactly. MCP servers are long-running services Claude talks to during a session. Graphify is a build-time tool that produces artifacts Claude reads (the GRAPH_REPORT.md file and the hook injection). An MCP version is on the roadmap (issue #146) but not shipped yet.
Does it help with the 5-hour Claude Code session limit?
Indirectly, yes. Every token you don't spend grepping is a token available for actual reasoning. Users running up against the 5-hour window often report the window stretches meaningfully after installing Graphify.
The Short Version
Graphify is the closest thing the Claude Code ecosystem currently has to a native "understand my codebase" layer. If you work on a repo with more than 100 files and you've been frustrated by Claude grepping everything, it's worth the 60-second install. Token savings are real (6.8x-49x depending on task) and the install is low-risk — you can uninstall by deleting the hook and CLAUDE.md directive if it doesn't fit.
For bigger teams: bake the /graphify rebuild into CI and the staleness problem goes away.