Skip to main content
Claude Code on a large monorepo spends most of its context reading files to find the few lines that matter. Give it a Graphify knowledge graph and it asks the graph first, then reads only what the graph points at. This recipe installs the skill, adds always-on hooks that steer Claude to the graph, connects a local MCP server, and measures the difference.

What you’ll build

  • A graph of your monorepo in graphify-out/.
  • A CLAUDE.md section and PreToolUse hooks that nudge Claude to query before it greps.
  • The /graphify skill for building and updating graphs from Claude Code.
  • A local MCP server with graph tools.
  • A token benchmark for your own repository.

Setup

On the open-source Graphify-Labs/graphify repository this writes 19,602 nodes and 44,439 edges in about 26 seconds, with no API key.

Step 1: Install the skill

This copies the Graphify skill to ~/.claude/skills/graphify/SKILL.md. In Claude Code, /graphify . builds a full graph, including docs and images, and /graphify . --update refreshes it.

Step 2: Turn on the always-on hooks

This adds a ## graphify section to CLAUDE.md. Its first rule tells Claude to run graphify query "<question>" before its first grep or source read, and to use graphify path and graphify explain for relationships. It also writes PreToolUse hooks to .claude/settings.json:
The installed command uses the full path to your graphify. When a fresh graph exists, the guard adds a reminder to use it. It never blocks a tool call unless you opt in to strict mode with hook-guard read --strict, which blocks the first raw read in a session.

Step 3: Connect a local MCP server

graphify-mcp serves the graph over stdio by default. Claude Code then has tools such as query_graph, get_node, get_neighbors, shortest_path and god_nodes. Run /mcp in Claude Code to check the server is connected.

Step 4: Ask Claude a question

Try a prompt that would usually trigger a long search:
Claude should run graphify query or call query_graph first, then open only the files and lines in the answer.

Step 5: Measure it

On the Graphify repository it estimated:
This compares a graph query with a naive baseline that reads the whole corpus. It’s an estimate, not a measurement of a real Claude session, and your number depends on repository size.

When it goes wrong

Claude ignores the graph. Check that graphify-out/graph.json exists at the repository root, and that .claude/settings.json has the hooks. The guard only nudges when the graph is fresh, so run graphify update . after pulling. The MCP server fails to start. Install the mcp extra: uv tool install "graphifyy[mcp]". Pass the graph path relative to where Claude Code starts, or use an absolute path. Answers are cut short. Ask with a larger budget, for example graphify query "..." --budget 3000, or name a specific symbol.

Production patterns

  • Commit CLAUDE.md and .claude/settings.json so the whole team gets the hooks. Each clone needs Graphify installed.
  • Install the git hooks with graphify hook install so the graph stays current. See Keep docs in sync.
  • To remove everything, run graphify claude uninstall.
  • For a monorepo too big to rebuild on every laptop, use Graphify, the hosted product: Cloud coding agents with hosted MCP.

Complete example

What you built

Claude Code now has a map of your monorepo. It queries the graph before it searches, reads less, and you have a benchmark to show the difference.

Next steps

Claude Code integration

Every Claude Code option, local and hosted.

Fully local with Ollama

Keep extraction on your machine too.

Try it in Graphify

We build and host the graph for you. Start with a 14-day Pro trial, then keep up to 3 repositories on Free. No card required.