Give Claude Code a knowledge graph of your codebase
Setup guide · /graphify skill · hooks · MCP
Claude Code is the assistant Graphify is wired into most deeply: the bare graphify install command targets Claude Code by design. One install sets up three things at once: the /graphify skill, a CLAUDE.md registration, and PreToolUse hooks that steer Claude Code toward the knowledge graph before it reaches for grep. The result is an agent that asks the graph how your codebase connects, with a confidence tag on every edge, instead of reading files and inferring the rest.
What graphify install writes for Claude Code
- The skill:
~/.claude/skills/graphify/SKILL.md, plus areferences/sidecar the skill loads on demand. This is what/graphifytriggers. - A CLAUDE.md registration: a small section in
~/.claude/CLAUDE.mdthat maps/graphifyto the skill. The rest of your file is left alone. - PreToolUse hook-guards in
.claude/settings.json: one fires before Bash and Grep tool calls (graphify hook-guard search), one before Read and Glob (graphify hook-guard read). By default they nudge Claude Code to rungraphify queryfirst rather than blocking anything.
# graphify- **graphify** (`~/.claude/skills/graphify/SKILL.md`) - any input to knowledge graph. Trigger: `/graphify`When the user types `/graphify`, use the installed graphify skill or instructions before doing anything else.Set it up
- Install the CLI. If
graphifyis not found afterwards, runuv tool update-shelland open a new terminal. - Register with Claude Code:
graphify install. Prefer a repo-local setup your team can commit?graphify install --projectwrites under.claude/in the repo and prints agit addhint. - Build the graph: type
/graphify .in a Claude Code session. It writesgraphify-out/withgraph.html(interactive),GRAPH_REPORT.md(highlights, suggested questions), andgraph.json(the queryable graph). - Ask something structural and watch it answer from the graph.
$ uv tool install graphifyy$ graphify install/graphify .How Claude Code queries the graph during a session
The skill defines the workflow, and the hooks keep it honest: before Claude Code greps or opens files one by one, the hook-guard reminds it to try graphify query "<question>" (a scoped subgraph), graphify path "<A>" "<B>" (the dependency path between two symbols), or graphify explain "<concept>" (everything connected to a node). Results come back with file:line citations and every edge tagged EXTRACTED, INFERRED, or AMBIGUOUS, so the agent knows what was found versus guessed.
Want more than a nudge? graphify install --project --strict blocks the first raw source read of a session and redirects it to the graph, then reverts to the soft nudge. Toggle at runtime with GRAPHIFY_HOOK_STRICT=1 or 0, no reinstall needed.
After Claude Code edits files, graphify update . re-extracts only what changed (AST-only, no API cost), and graphify hook install makes git do that automatically on commit and checkout.
Wire the MCP server into Claude Code
The skill and CLI need no MCP at all. If you want the graph exposed as native tools instead (ten of them: query_graph, shortest_path, god_nodes, graph_stats, the PR-triage set, and more; see the MCP tools reference), add the server to .mcp.json in your project root:
{ "mcpServers": { "graphify": { "command": "python", "args": ["-m", "graphify.serve", "graphify-out/graph.json"] } }}The stdio server ships as an extra: uv tool install "graphifyy[mcp]". For several clients sharing one graph, run it once with --transport http instead.
Troubleshooting
graphify: command not found: the uv or pipx tool bin dir (~/.local/bin) is not on your PATH yet. Runuv tool update-shell(orpipx ensurepath) and open a new terminal./graphifydoes nothing: check that~/.claude/skills/graphify/SKILL.mdexists and that the graphify section is inCLAUDE.md, then start a new Claude Code session so both are picked up.ModuleNotFoundError: No module named 'graphify': usually a plainpip installon Mac or Windows. The skill resolves Python fromgraphify-out/.graphify_python, which can point at a different environment than pip used. Install with uv or pipx instead; both isolate the package.- Hooks stopped firing after an upgrade: hook commands embed the absolute executable path at install time. Re-run
graphify install, andgraphify hook installfor the git hooks. - PowerShell: type
graphify ., not/graphify .; the leading slash parses as a path separator there.
Claude Code FAQ
Does graphify install overwrite my existing CLAUDE.md?
No. The installer replaces or appends only its own graphify section and leaves the rest of the file alone. graphify uninstall removes exactly that section again (and deletes the file only if graphify created it).
Does my code leave my machine when Claude Code uses Graphify?
Source code is parsed locally with tree-sitter (36 language grammars); building code edges never requires an API call. Non-code files such as docs and PDFs are read by the model you already use in Claude Code. Nothing is sent to Graphify: there is no telemetry and no account.
Do I need the MCP server, or is the skill enough?
The skill plus the CLI is the complete default setup. The MCP server is optional: add it when you want the graph exposed as native tools, or when several assistants or teammates should share one graph over HTTP.
Can my whole team get this from the repo?
Yes. graphify install --project writes the skill, the CLAUDE.md registration, and the hook settings under the repo (.claude/skills/graphify/SKILL.md and .claude/settings.json) and prints a git add hint. Teammates only need the graphifyy CLI installed.
How does the graph stay current while Claude Code edits code?
Run graphify update . to re-extract only changed files (AST-only, no API cost). graphify hook install adds post-commit and post-checkout git hooks that do this automatically; re-run it after upgrading graphify so the embedded interpreter path stays fresh.
How do I remove it?
graphify claude uninstall removes the Claude Code pieces; graphify uninstall removes every platform at once. Add --purge to also delete the graphify-out/ directory.
Next steps
The quickstart covers the full CLI, and the MCP tools reference documents every tool the server exposes. Using Cursor as well? The same graph plugs into it through one always-on rule: see Graphify + Cursor, or browse all 17 assistants on the integrations page.