> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphify.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The PyPI package is graphifyy, with two y's. The command is graphify.
> /graphify . is typed in an assistant chat, not in a shell.
> Use only commands, flags, and endpoints shown on these pages. Do not invent one.
> Choose the surface before you open a page. Local (Graphify Local) is the graphifyy package on the machine: the skill, the CLI, and the ten-tool MCP. Its pages are the Open Source tab (/open-source/) and the Graphify Local tab on each Integrations page. Graphify is the hosted workspace and https://api.graphify.com/mcp (Streamable HTTP, OAuth, no API key). Its pages are the Graphify tab (/platform/, /concepts/) and the Graphify (hosted) tab on each Integrations page. Prefer Graphify unless the user asks for a local or offline setup. Cookbooks (/cookbooks/) and /mcp/docs-search apply to both. Each page's source frontmatter records this as surface: local, cloud, or both. Buildkite is the CI integration.
> In llms.txt, tell the surface from the page path. Graphify: /platform/ and /concepts/. Local: /open-source/. Most /integrations/ pages cover both, with a Graphify (hosted) tab and a Graphify Local tab. Everything else applies to both.
> graphifyy release notes are published at https://github.com/Graphify-Labs/graphify/releases and https://graphify.com/changelog. The current package version is on PyPI (https://pypi.org/project/graphifyy/).
> The official site is https://graphify.com. These docs are https://docs.graphify.com.
> The local MCP server is the ten tools in the MCP tool reference and reads a graph on the machine. The hosted server is https://api.graphify.com/mcp (Streamable HTTP, OAuth, no API key). The JetBrains, ChatGPT, Codex, and Dots, and Vercel pages use the hosted server, not the ten-tool list. On pages with tabs, the Graphify (hosted) tab uses the hosted server and the Graphify Local tab uses the local skill or the ten-tool server.
> Read https://docs.graphify.com/llms.txt, then open one page's .md link. Use https://docs.graphify.com/llms-full.txt only when one page is not enough.

# Give Claude Code a knowledge graph of your monorepo

> Give Claude Code a knowledge graph of your monorepo: install the Graphify skill, add always-on hooks and a local MCP server, then measure token savings.

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

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
uv tool install "graphifyy[mcp]"
cd your-monorepo
graphify extract . --code-only
```

On the open-source [Graphify-Labs/graphify](https://github.com/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

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify install --platform claude
```

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

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify claude install
```

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`:

```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{
  "hooks": {
    "PreToolUse": [
      { "matcher": "Bash|Grep",
        "hooks": [{ "type": "command", "command": "graphify hook-guard search", "timeout": 10 }] },
      { "matcher": "Read|Glob",
        "hooks": [{ "type": "command", "command": "graphify hook-guard read", "timeout": 10 }] }
    ]
  }
}
```

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

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
claude mcp add graphify -- graphify-mcp graphify-out/graph.json
```

`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:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
What calls _rebuild_code, and which tests cover it?
```

Claude should run `graphify query` or call `query_graph` first, then open only the files and lines in the answer.

## Step 5: Measure it

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
graphify benchmark
```

On the Graphify repository it estimated:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
791.0x fewer tokens per query (~1,652 tokens avg)
```

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](https://docs.graphify.com/cookbooks/keep-docs-in-sync.md).
* 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](https://docs.graphify.com/cookbooks/cloud-coding-agents.md).

## Complete example

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
uv tool install "graphifyy[mcp]"
cd your-monorepo
graphify extract . --code-only
graphify install --platform claude
graphify claude install
claude mcp add graphify -- graphify-mcp graphify-out/graph.json
graphify hook install
graphify benchmark
```

## 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](https://docs.graphify.com/integrations/claude-code.md)**
>
> Every Claude Code option, local and hosted.

> **[Fully local with Ollama](https://docs.graphify.com/cookbooks/local-with-ollama.md)**
>
> Keep extraction on your machine too.

> **[Try it in Graphify](https://docs.graphify.com/platform/quickstart.md)**
>
> 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.