3️⃣ Guide Claude Code (.claude.md)
Create or open the .claudemd file in the root of your project directory. Add the following rules so Claude automatically uses the graph instead of wasting tokens scanning raw files:
"
This project has a knowledge graph at graphify-out/ with god nodes,
community structure, and cross-file relationships.
Rules:
- For codebase questions, first run `graphify query ""`
when graphify-out/graph.json exists.
- Use `graphify path "" ""` for relationships and
`graphify explain ""` for focused concepts.
- After modifying code, run `graphify update .` to keep the graph current.
"
4️⃣ Automate Updates (Git Hook)
To ensure your graph never falls out of sync, add a background hook that automatically updates the graph on every commit:
graphify hook --type git-commit
5️⃣ How to Use It
Once set up, just launch Claude Code as usual (claude).
Claude will read your .claudemd file, detect the graph, and use the graphify query terminal command behind the scenes to find answers.
If you want to run queries manually in your terminal, simply use:
graphify query "How does the authentication flow work?"