Skip to content

Instantly share code, notes, and snippets.

@ashokvarmamatta
Last active May 6, 2026 14:17
Show Gist options
  • Select an option

  • Save ashokvarmamatta/344a642e8b5bd286be605a8f439c3848 to your computer and use it in GitHub Desktop.

Select an option

Save ashokvarmamatta/344a642e8b5bd286be605a8f439c3848 to your computer and use it in GitHub Desktop.
๐Ÿง  Make Your AI Coding Assistant 500x Smarter โ€” Complete Guide to graphify + code-review-graph + MCP (Knowledge Graphs for Claude Code, Cursor, Windsurf)

๐Ÿง  Make Your AI Coding Assistant 500x Smarter

Stop Burning Tokens โ€” Use Knowledge Graphs + MCP to Give AI a Map of Your Code

Typing SVG

graphify code-review-graph MCP Claude Code Cursor


๐Ÿ“– What This Guide Covers

Your AI assistant reads your ENTIRE codebase every time you ask a question.
That's slow, expensive, and dumb.

This guide gives your AI a MAP of your code โ€” so it looks up answers
instead of reading everything from scratch.

         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚  1. What is MCP?                 โ”‚  โ† The "USB port" for AI
         โ”‚  2. Install graphify             โ”‚  โ† Builds the knowledge graph
         โ”‚  3. Install code-review-graph    โ”‚  โ† Fast code-only MCP server
         โ”‚  4. Connect via MCP              โ”‚  โ† Wire it to Claude Code
         โ”‚  5. Automate updates             โ”‚  โ† Graph stays fresh forever
         โ”‚  6. Use it                       โ”‚  โ† 500x less tokens
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค” Wait, What is MCP?

MCP = Model Context Protocol

Think of it like a USB port for AI.

USB lets ANY device talk to ANY computer:

  ๐Ÿ–จ๏ธ Printer โ”€โ”€โ”
  ๐Ÿ“ท Camera  โ”€โ”€โ”คโ”€โ”€ USB โ”€โ”€โ”€โ”€ ๐Ÿ’ป Computer
  ๐ŸŽฎ Gamepad โ”€โ”€โ”˜

MCP lets ANY tool talk to ANY AI assistant:

  ๐Ÿ“Š Graph DB    โ”€โ”€โ”
  ๐Ÿ’ฌ Slack       โ”€โ”€โ”คโ”€โ”€ MCP โ”€โ”€โ”€โ”€ ๐Ÿค– AI Assistant
  ๐Ÿ“ Code Graph  โ”€โ”€โ”˜

Without MCP:

You: "How does LlmRouter work?"

AI: "Let me read... *reads 143 files* ... *burns 362,000 tokens* ... here's what I found"
    โฑ๏ธ 30 seconds
    ๐Ÿ’ฐ $$$ tokens burned

With MCP:

You: "How does LlmRouter work?"

AI: "Let me check the graph..."
    โ†’ query_graph("callers_of", "LlmRouter")
    โ†’ gets back 10 precise connections in 0.2 seconds
    "LlmRouter has 47 connections. It's called by WebChatServer, ZeroClawService..."
    โฑ๏ธ 2 seconds
    ๐Ÿ’ฐ ~700 tokens (that's 500x less!)

The Restaurant Analogy ๐Ÿ•

WITHOUT MCP (reading files):
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                          โ”‚
โ”‚  You walk into a restaurant.             โ”‚
โ”‚  There's no menu.                        โ”‚
โ”‚  You go to the kitchen.                  โ”‚
โ”‚  You open EVERY fridge.                  โ”‚
โ”‚  You read EVERY ingredient label.        โ”‚
โ”‚  Then you decide what to order.          โ”‚
โ”‚                                          โ”‚
โ”‚  That's your AI reading your codebase.   โ”‚
โ”‚                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

WITH MCP (using graph):
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                          โ”‚
โ”‚  You walk into a restaurant.             โ”‚
โ”‚  There's a MENU on the table.            โ”‚
โ”‚  You pick what you want.                 โ”‚
โ”‚  Done.                                   โ”‚
โ”‚                                          โ”‚
โ”‚  The graph IS the menu.                  โ”‚
โ”‚  MCP IS the waiter.                      โ”‚
โ”‚                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿงฉ The Two Tools (And Why You Need Both)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                                 โ”‚
โ”‚   graphify                        code-review-graph             โ”‚
โ”‚   โ•โ•โ•โ•โ•โ•โ•โ•                        โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•             โ”‚
โ”‚                                                                 โ”‚
โ”‚   ๐Ÿ“š The FULL picture             โšก The FAST picture           โ”‚
โ”‚                                                                 โ”‚
โ”‚   โœ… Code (functions, classes)    โœ… Code (functions, classes)  โ”‚
โ”‚   โœ… Docs (README, guides)        โŒ No docs                   โ”‚
โ”‚   โœ… Images (screenshots)         โŒ No images                  โ”‚
โ”‚   โœ… Bugs & plans                 โŒ No docs                    โ”‚
โ”‚   โœ… Semantic connections         โŒ Only structural            โ”‚
โ”‚   โœ… Community clusters           โŒ Basic clusters             โ”‚
โ”‚   โœ… Interactive HTML viz         โœ… HTML viz                   โ”‚
โ”‚                                                                 โ”‚
โ”‚   ๐ŸŒ Needs LLM for docs/images   โšก Pure AST, no LLM needed   โ”‚
โ”‚   ๐Ÿ“Š 1,479 nodes example          ๐Ÿ“Š 1,411 nodes example       โ”‚
โ”‚                                                                 โ”‚
โ”‚   Best for:                       Best for:                     โ”‚
โ”‚   "How does feature X relate      "Who calls this function?"    โ”‚
โ”‚    to the bug in BUGS.md?"        "What imports this class?"    โ”‚
โ”‚                                   "Impact of changing this?"    โ”‚
โ”‚                                                                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

USE BOTH. They complement each other.
code-review-graph = your quick dictionary
graphify = your full encyclopedia

๐Ÿ“ฆ Step 1 โ€” Install Everything

1a. Install graphify

pip install graphifyy

Yes, it's graphifyy with two y's on PyPI.

1b. Install code-review-graph

pip install code-review-graph

1c. Verify both installed

graphify --version
code-review-graph --help

You should see version info and help text. If not, make sure Python is in your PATH.


๐Ÿ”จ Step 2 โ€” Build Your First Graph

2a. Build the graphify knowledge graph

Navigate to your project root and run:

cd /path/to/your/project

Then in Claude Code (or any AI assistant with graphify skill):

/graphify .

This will:

  1. Detect all files (code, docs, images)
  2. Parse code via AST (free, no LLM)
  3. Extract concepts from docs/images (uses LLM)
  4. Build a graph with nodes + edges
  5. Cluster into communities
  6. Generate graphify-out/graph.html (interactive viz!)
What happens:

  Your Project                          graphify-out/
  โ”œโ”€โ”€ src/                              โ”œโ”€โ”€ graph.json      โ† The graph data
  โ”‚   โ”œโ”€โ”€ auth.kt        โ”€โ”€โ”€โ”€โ”€โ”€โ–บ       โ”œโ”€โ”€ graph.html      โ† Open in browser!
  โ”‚   โ”œโ”€โ”€ router.kt      โ”€โ”€โ”€โ”€โ”€โ”€โ–บ       โ”œโ”€โ”€ GRAPH_REPORT.md โ† Audit report
  โ”‚   โ””โ”€โ”€ database.kt    โ”€โ”€โ”€โ”€โ”€โ”€โ–บ       โ””โ”€โ”€ cost.json       โ† Token usage
  โ”œโ”€โ”€ README.md           โ”€โ”€โ”€โ”€โ”€โ”€โ–บ
  โ”œโ”€โ”€ BUGS.md             โ”€โ”€โ”€โ”€โ”€โ”€โ–บ
  โ””โ”€โ”€ screenshots/        โ”€โ”€โ”€โ”€โ”€โ”€โ–บ
        All files become graph nodes
        with edges showing relationships

2b. Build the code-review-graph

code-review-graph build

This is instant โ€” it only parses code via AST (no LLM needed):

$ code-review-graph build
INFO: Progress: 50/140 files parsed
INFO: Progress: 100/140 files parsed
INFO: Progress: 140/140 files parsed
Full build: 140 files, 1411 nodes, 2801 edges

2c. Open the graph in your browser

# graphify interactive visualization
open graphify-out/graph.html    # macOS
start graphify-out/graph.html   # Windows
xdg-open graphify-out/graph.html # Linux

You'll see something like this:

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                                             โ”‚
    โ”‚    โ—‹ LlmRouter                              โ”‚
    โ”‚   /|\                                       โ”‚
    โ”‚  / | \                                      โ”‚
    โ”‚ โ—‹  โ—‹  โ—‹  WebChat  KeyManager  ToolSystem    โ”‚
    โ”‚ |  |  |                                     โ”‚
    โ”‚ โ—‹  โ—‹  โ—‹  Service  Agents  OfflineModel      โ”‚
    โ”‚                                             โ”‚
    โ”‚   Nodes colored by community                โ”‚
    โ”‚   Click any node to see connections          โ”‚
    โ”‚   Zoom, pan, drag                           โ”‚
    โ”‚                                             โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”Œ Step 3 โ€” Connect to Your AI via MCP

What are we doing here?

Right now:

  Claude Code โ”€โ”€โ”€โ”€ ??? โ”€โ”€โ”€โ”€ Your graph
  (can't see the graph)

After this step:

  Claude Code โ”€โ”€โ”€โ”€ MCP โ”€โ”€โ”€โ”€ code-review-graph server โ”€โ”€โ”€โ”€ Fast code lookups
       โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ MCP โ”€โ”€โ”€โ”€ graphify server โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Full knowledge graph

3a. Create .mcp.json in your project root

Create a file called .mcp.json (note the dot!) in your project's root directory:

{
  "mcpServers": {
    "code-review-graph": {
      "command": "code-review-graph",
      "args": ["serve"],
      "type": "stdio"
    },
    "graphify": {
      "command": "python",
      "args": ["-m", "graphify.serve", "graphify-out/graph.json"],
      "type": "stdio"
    }
  }
}

That's it. Claude Code reads .mcp.json on startup and connects to both servers automatically.

3b. What each server provides

code-review-graph MCP tools:

Tool What it does Example
semantic_search_nodes Find code by keyword "Find all auth-related classes"
query_graph Trace relationships "Who calls LlmRouter?"
get_impact_radius Blast radius of a change "What breaks if I change this?"
detect_changes Risk-scored code review "Review my last commit"
get_review_context Token-efficient snippets "Show me relevant code for review"
get_affected_flows Execution path analysis "Which flows does this change affect?"

graphify MCP tools:

Tool What it does Example
query_graph Search the full graph "How does auth relate to the API?"
get_node Get node details "Tell me about OfflineModelManager"
get_neighbors Find connected nodes "What's connected to LlmRouter?"
get_community See a cluster "Show me the memory subsystem"
god_nodes Most connected nodes "What are the core abstractions?"
graph_stats Graph overview "How big is the graph?"
shortest_path Find path between concepts "How does auth connect to database?"

3c. Restart Claude Code

# Close and reopen Claude Code, or start a new session
# The MCP servers will connect automatically

3d. Verify it works

In your new Claude Code session, ask:

"What are the most connected nodes in this codebase?"

If it uses MCP tools (you'll see tool calls like god_nodes or semantic_search_nodes) instead of running Grep/Read on your files โ€” it's working!

BEFORE MCP (what you DON'T want to see):
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ” Grep("class.*Router", **/*.kt)    โ”‚  โ† Reading files
โ”‚  ๐Ÿ“– Read(src/LlmRouter.kt)            โ”‚  โ† Reading files
โ”‚  ๐Ÿ“– Read(src/ProviderRouter.kt)        โ”‚  โ† Reading files
โ”‚  ๐Ÿ“– Read(src/WebChatServer.kt)         โ”‚  โ† More files...
โ”‚                                        โ”‚
โ”‚  ๐Ÿ’ฐ Used: ~50,000 tokens              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

AFTER MCP (what you WANT to see):
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ”Œ query_graph("callers_of",          โ”‚  โ† Graph lookup!
โ”‚       "LlmRouter")                     โ”‚
โ”‚                                        โ”‚
โ”‚  ๐Ÿ’ฐ Used: ~700 tokens                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค– Step 4 โ€” Automate Everything (Set and Forget)

This is the magic part. After this, your graphs update themselves every time you commit code.

4a. Install the graphify git hook

graphify hook install

Output:

post-commit: appended to .git/hooks/post-commit
post-checkout: appended to .git/hooks/post-checkout

4b. Add code-review-graph to the same hook

Open .git/hooks/post-commit and add at the bottom:

# code-review-graph: incremental update for MCP server
if command -v code-review-graph >/dev/null 2>&1; then
    code-review-graph update 2>/dev/null || true
fi

4c. What happens now on every commit

You type: git commit -m "add new feature"

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  git commit  โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚ post-commit  โ”‚
                    โ”‚    hook      โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ–ผ                         โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚    graphify      โ”‚     โ”‚  code-review-graph   โ”‚
    โ”‚                  โ”‚     โ”‚                      โ”‚
    โ”‚ Re-extracts only โ”‚     โ”‚ Re-parses only       โ”‚
    โ”‚ CHANGED files    โ”‚     โ”‚ CHANGED files        โ”‚
    โ”‚ (AST, no LLM)   โ”‚     โ”‚ (AST, no LLM)        โ”‚
    โ”‚                  โ”‚     โ”‚                      โ”‚
    โ”‚ Updates:         โ”‚     โ”‚ Updates:             โ”‚
    โ”‚ graph.json       โ”‚     โ”‚ internal graph       โ”‚
    โ”‚ GRAPH_REPORT.md  โ”‚     โ”‚ MCP serves new data  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    โšก Both take < 5 seconds for code-only changes
    โšก No LLM tokens consumed
    โšก No internet needed
    โšก Completely automatic

4d. What about docs and images?

Code changes auto-update (AST parsing, free). Docs/images need LLM โ€” run manually when you update docs:

/graphify . --update

This only re-extracts new/changed files (cached results are reused):

$ /graphify . --update
Cache: 165 files hit, 2 files need extraction
Semantic extraction: ~2 files โ†’ 1 agent, estimated ~45s
...done!

4e. Manual update (no commit needed)

Don't want to commit just to update the graph? Run these anytime:

# Update code-review-graph (instant, no LLM)
code-review-graph update

# Or full rebuild from scratch
code-review-graph build

For graphify, in Claude Code:

/graphify . --update
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                              โ”‚
โ”‚   HOW THE GRAPH STAYS FRESH                                  โ”‚
โ”‚                                                              โ”‚
โ”‚   Option 1: Automatic (git commit)                           โ”‚
โ”‚   โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                            โ”‚
โ”‚   git commit โ†’ hook runs โ†’ both graphs update                โ”‚
โ”‚   You do nothing. It just works.                             โ”‚
โ”‚                                                              โ”‚
โ”‚   Option 2: Manual (anytime)                                 โ”‚
โ”‚   โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•                                   โ”‚
โ”‚   code-review-graph update    โ† run in terminal              โ”‚
โ”‚   /graphify . --update        โ† run in Claude Code           โ”‚
โ”‚   No commit needed. Run after any edit.                      โ”‚
โ”‚                                                              โ”‚
โ”‚   Option 3: Full rebuild (switch branch, big changes)        โ”‚
โ”‚   โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•           โ”‚
โ”‚   code-review-graph build     โ† rebuild from scratch         โ”‚
โ”‚   /graphify .                 โ† full rebuild in Claude Code  โ”‚
โ”‚                                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary: What's automatic vs manual

Change Type Auto-updates? Cost
New .kt / .java / .py file โœ… On commit Free (AST)
Modified code file โœ… On commit Free (AST)
New/changed .md / .txt doc โŒ Manual: /graphify . --update LLM tokens
New screenshot / image โŒ Manual: /graphify . --update LLM tokens

๐Ÿ“Š Step 5 โ€” See the Token Savings

After graphify builds, it prints a benchmark:

graphify token reduction benchmark
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Corpus:          271,756 words โ†’ ~362,341 tokens (naive)
  Graph:           1,479 nodes, 1,326 edges
  Avg query cost:  ~706 tokens
  Reduction:       513.2x fewer tokens per query

  Per question:
    [787.7x] how does authentication work
    [469.4x] what is the main entry point
    [332.1x] how are errors handled
    [827.3x] what connects the data layer to the api
    [469.4x] what are the core abstractions

What does 500x mean in practice?

Without graph:
  10 questions ร— 362,341 tokens = 3,623,410 tokens
  ๐Ÿ’ฐ ~$10-15 in API costs

With graph:
  10 questions ร— 706 tokens = 7,060 tokens
  ๐Ÿ’ฐ ~$0.02 in API costs

  That's like paying $0.02 instead of $10.
  For the SAME answers.
  Actually BETTER answers (structural context).

๐ŸŽฏ Real Usage Examples

Example 1: "What does LlmRouter do?"

WITHOUT graph:
  AI reads LlmRouter.kt (500 lines)
  AI reads every file that imports it (20+ files)
  AI reads docs mentioning it
  Total: ~50,000 tokens, 30 seconds

WITH graph:
  AI calls: get_node("LlmRouter")
  AI calls: get_neighbors("LlmRouter")
  Gets back: 47 connections, callers, callees, related docs
  Total: ~700 tokens, 2 seconds

Example 2: "What breaks if I change OfflineModelManager?"

WITHOUT graph:
  AI greps for "OfflineModelManager" in all files
  AI reads each file to understand the dependency
  AI guesses at impact
  Total: ~30,000 tokens, maybe misses indirect deps

WITH graph:
  AI calls: get_impact_radius("OfflineModelManager")
  Gets back: direct deps, transitive deps, affected flows, test coverage
  Total: ~500 tokens, complete picture

Example 3: "Review my last commit"

WITHOUT graph:
  AI reads the diff
  AI reads surrounding code for context
  AI reads test files
  Total: ~40,000 tokens

WITH graph:
  AI calls: detect_changes()
  Gets back: risk score, affected communities, missing test coverage
  AI calls: get_review_context() for only the risky parts
  Total: ~2,000 tokens, better review

๐Ÿ—‚๏ธ Project Structure After Setup

your-project/
โ”œโ”€โ”€ .mcp.json                    โ† MCP server config (commit this!)
โ”œโ”€โ”€ .gitignore                   โ† Add: graphify-out/
โ”œโ”€โ”€ .git/hooks/post-commit       โ† Auto-update hook
โ”œโ”€โ”€ graphify-out/                โ† โš ๏ธ GITIGNORED
โ”‚   โ”œโ”€โ”€ graph.json               โ† The knowledge graph
โ”‚   โ”œโ”€โ”€ graph.html               โ† Interactive visualization
โ”‚   โ”œโ”€โ”€ GRAPH_REPORT.md          โ† Audit report (god nodes, surprises)
โ”‚   โ””โ”€โ”€ cost.json                โ† Token usage tracker
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ ... your code ...
โ””โ”€โ”€ README.md

What to commit, what to gitignore

File Commit? Why
.mcp.json โœ… Yes Team members get MCP servers too
graphify-out/ โŒ No Generated, can be rebuilt
.git/hooks/ โŒ No Local only (each dev runs graphify hook install)

Add to your .gitignore:

# Knowledge graph outputs (rebuild with: /graphify . )
graphify-out/

๐Ÿš€ Quick Start โ€” Set Up ANY Project in 2 Minutes

Copy-paste these commands in your project root:

# 1. Install (one-time, works for all projects)
pip install graphifyy code-review-graph

# 2. Build the code-review-graph (instant, no LLM)
code-review-graph build

# 3. Create MCP config for your AI editor
cat > .mcp.json << 'EOF'
{
  "mcpServers": {
    "code-review-graph": {
      "command": "code-review-graph",
      "args": ["serve"],
      "type": "stdio"
    },
    "graphify": {
      "command": "python",
      "args": ["-m", "graphify.serve", "graphify-out/graph.json"],
      "type": "stdio"
    }
  }
}
EOF

# 4. Install auto-update git hooks
graphify hook install

# 5. Add code-review-graph to the same hook
cat >> .git/hooks/post-commit << 'HOOK'

# code-review-graph: incremental update for MCP server
if command -v code-review-graph >/dev/null 2>&1; then
    code-review-graph update 2>/dev/null || true
fi
HOOK

# 6. Gitignore the output
echo -e "\n# Knowledge graph outputs\ngraphify-out/" >> .gitignore

# 7. Auto-configure your AI editor (pick ONE):
graphify claude install       # Claude Code
graphify cursor install       # Cursor
graphify gemini install       # Gemini CLI / Android Studio Gemini
graphify antigravity install  # Google Antigravity
graphify codex install        # OpenAI Codex
graphify copilot install      # GitHub Copilot CLI
graphify opencode install     # OpenCode
graphify aider install        # Aider
graphify droid install        # Factory Droid
graphify claw install         # OpenClaw
graphify trae install         # Trae
graphify trae-cn install      # Trae CN

8. Build the graphify knowledge graph

In Claude Code, just type:

/graphify .

This is a Claude Code skill (slash command). It reads all your code, docs, and images, then builds the full knowledge graph.

Not using Claude Code? You can still build the code graph (no LLM needed):

code-review-graph build

This gives you the AST-based graph with MCP. The full graphify graph (with docs/images/semantic connections) requires /graphify . in Claude Code or another AI editor with the graphify skill installed.

9. Start a new session

Close and reopen your AI editor. The MCP servers load on startup. Done!

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                    โ”‚
โ”‚  โœ… code-review-graph MCP    โ†’ code lookups        โ”‚
โ”‚  โœ… graphify MCP             โ†’ full knowledge graphโ”‚
โ”‚  โœ… git hook                 โ†’ auto-updates        โ”‚
โ”‚  โœ… CLAUDE.md / .cursorrules โ†’ AI knows to use it  โ”‚
โ”‚                                                    โ”‚
โ”‚  Your AI is now 500x smarter. For every project.   โ”‚
โ”‚                                                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”„ Setting Up Your NEXT Project

Already did the Quick Start once? For each new project, it's even faster:

cd /path/to/new/project

# Build + configure (30 seconds)
code-review-graph build
graphify hook install
graphify claude install    # or: cursor, gemini, antigravity, codex, copilot, etc.

# Create MCP config
cat > .mcp.json << 'EOF'
{
  "mcpServers": {
    "code-review-graph": {
      "command": "code-review-graph",
      "args": ["serve"],
      "type": "stdio"
    },
    "graphify": {
      "command": "python",
      "args": ["-m", "graphify.serve", "graphify-out/graph.json"],
      "type": "stdio"
    }
  }
}
EOF

echo -e "\ngraphify-out/" >> .gitignore

# Add code-review-graph to hook
cat >> .git/hooks/post-commit << 'HOOK'

if command -v code-review-graph >/dev/null 2>&1; then
    code-review-graph update 2>/dev/null || true
fi
HOOK

# Then in Claude Code: /graphify .

That's it โ€” 30 seconds per project after the first time.


๐ŸŒ Multi-Project Setup โ€” Query ALL Your Projects From ONE Session

Multi-Project Global MCP

๐Ÿ’ก The Problem: You graphified Project A and Project B separately. But when you open Claude Code in Project A, it only sees Project A's graph. How do you query both?

โœ… The Solution: Set MCP servers globally so they're available in EVERY session, from ANY folder.

๐Ÿค” Local vs Global โ€” What's the Difference?

LOCAL (.mcp.json in project folder)          GLOBAL (~/.claude.json in home folder)
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•          โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

  ๐Ÿ“ Project-A/                                ๐Ÿ  ~/.claude.json
  โ”‚  โ””โ”€โ”€ .mcp.json                             โ”‚
  โ”‚       โ””โ”€โ”€ graphify-A  โœ…                    โ”œโ”€โ”€ graphify-A  โœ…
  โ”‚                                             โ”œโ”€โ”€ graphify-B  โœ…
  ๐Ÿ“ Project-B/                                 โ””โ”€โ”€ graphify-C  โœ…
  โ”‚  โ””โ”€โ”€ .mcp.json
  โ”‚       โ””โ”€โ”€ graphify-B  โœ…                   Open Claude Code ANYWHERE:
  โ”‚                                             โ†’ ALL graphs available โœ…
  Open Claude Code in Project-A:
  โ†’ Only sees graphify-A โŒ
  โ†’ Can't query Project-B โŒ

๐Ÿš€ Step 1 โ€” Graphify Each Project First

# Project A
cd /path/to/project-A
code-review-graph build
# In Claude Code: /graphify .

# Project B
cd /path/to/project-B
code-review-graph build
# In Claude Code: /graphify .

# Project C ... repeat for each project

๐Ÿ”— Step 2 โ€” Register All Projects in code-review-graph

# code-review-graph has BUILT-IN multi-repo support ๐ŸŽ‰
code-review-graph register "/path/to/project-A" --alias projectA
code-review-graph register "/path/to/project-B" --alias projectB
code-review-graph register "/path/to/project-C" --alias projectC

# Check what's registered
code-review-graph repos
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                          โ”‚
โ”‚  $ code-review-graph repos                               โ”‚
โ”‚                                                          โ”‚
โ”‚  โœ… projectA  โ†’ /path/to/project-A  (1,411 nodes)       โ”‚
โ”‚  โœ… projectB  โ†’ /path/to/project-B  (892 nodes)         โ”‚
โ”‚  โœ… projectC  โ†’ /path/to/project-C  (2,100 nodes)       โ”‚
โ”‚                                                          โ”‚
โ”‚  ONE MCP server. ALL projects. ๐Ÿ”ฅ                        โ”‚
โ”‚                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ That's it for code-review-graph! The single code-review-graph serve MCP server now queries ALL registered repos automatically.

๐Ÿง  Step 3 โ€” Set graphify MCP Globally

For graphify, add each project's graph server to your global ~/.claude.json:

Tell your AI assistant:

"Set up global MCP servers for all my graphified projects"

Or manually add to ~/.claude.json:

{
  "mcpServers": {
    "code-review-graph": {
      "command": "code-review-graph",
      "args": ["serve"],
      "type": "stdio"
    },
    "graphify-projectA": {
      "command": "python",
      "args": ["-m", "graphify.serve", "/path/to/project-A/graphify-out/graph.json"]
    },
    "graphify-projectB": {
      "command": "python",
      "args": ["-m", "graphify.serve", "/path/to/project-B/graphify-out/graph.json"]
    },
    "graphify-projectC": {
      "command": "python",
      "args": ["-m", "graphify.serve", "/path/to/project-C/graphify-out/graph.json"]
    }
  }
}

โš ๏ธ Important: Each graphify server needs a unique name (graphify-projectA, graphify-projectB, etc.)

โœ… Result โ€” Everything Connected

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                                  โ”‚
โ”‚         ๐ŸŒ OPEN CLAUDE CODE FROM ANY FOLDER                      โ”‚
โ”‚                                                                  โ”‚
โ”‚                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                           โ”‚
โ”‚                    โ”‚   Claude Code   โ”‚                           โ”‚
โ”‚                    โ”‚   (any folder)  โ”‚                           โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                           โ”‚
โ”‚                             โ”‚                                    โ”‚
โ”‚              Global MCP Servers Load Automatically               โ”‚
โ”‚                             โ”‚                                    โ”‚
โ”‚         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚
โ”‚         โ”‚                   โ”‚                   โ”‚               โ”‚
โ”‚         โ–ผ                   โ–ผ                   โ–ผ               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚  โ”‚ ๐Ÿ“ฑ Project A โ”‚  โ”‚ ๐ŸŒ Project B โ”‚  โ”‚ ๐ŸŽฎ Project C โ”‚          โ”‚
โ”‚  โ”‚              โ”‚  โ”‚              โ”‚  โ”‚              โ”‚          โ”‚
โ”‚  โ”‚ graphify-A   โ”‚  โ”‚ graphify-B   โ”‚  โ”‚ graphify-C   โ”‚          โ”‚
โ”‚  โ”‚ code-review  โ”‚  โ”‚ code-review  โ”‚  โ”‚ code-review  โ”‚          โ”‚
โ”‚  โ”‚              โ”‚  โ”‚              โ”‚  โ”‚              โ”‚          โ”‚
โ”‚  โ”‚ 1,411 nodes  โ”‚  โ”‚ 892 nodes    โ”‚  โ”‚ 2,100 nodes  โ”‚          โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ”‚                                                                  โ”‚
โ”‚  ๐Ÿ” "How does auth work in Project A?"  โ†’ queries graphify-A    โ”‚
โ”‚  ๐Ÿ” "Compare Project B's DB to C's"    โ†’ queries both B and C   โ”‚
โ”‚  ๐Ÿ” "Impact of changing this class?"    โ†’ queries code-review    โ”‚
โ”‚                                                                  โ”‚
โ”‚         ALL PROJECTS. ANY SESSION. ZERO SETUP PER SESSION.       โ”‚
โ”‚                                                                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“Š Quick Reference

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚       Tool          โ”‚  Multi-Project How?  โ”‚  Where to Configure    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                     โ”‚                      โ”‚                        โ”‚
โ”‚  code-review-graph  โ”‚  Built-in!           โ”‚  code-review-graph     โ”‚
โ”‚                     โ”‚  register command    โ”‚  register <path>       โ”‚
โ”‚                     โ”‚  1 server = N repos  โ”‚                        โ”‚
โ”‚                     โ”‚                      โ”‚                        โ”‚
โ”‚  graphify           โ”‚  1 server per        โ”‚  ~/.claude.json        โ”‚
โ”‚                     โ”‚  project             โ”‚  (global mcpServers)   โ”‚
โ”‚                     โ”‚  unique name each    โ”‚                        โ”‚
โ”‚                     โ”‚                      โ”‚                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ’ก Pro tip: After graphifying a new project, just add one more graphify-newproject entry to ~/.claude.json and restart Claude Code. That's it โ€” the new project is connected to all your sessions.


โ“ FAQ

Q: Does this work with Cursor / Windsurf / other AI editors?

Yes! graphify supports 12 AI editors/agents out of the box:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                                      โ”‚
โ”‚  EDITOR / AGENT             INSTALL COMMAND          WHAT IT WRITES  โ”‚
โ”‚  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•            โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•          โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•  โ”‚
โ”‚                                                                      โ”‚
โ”‚  Claude Code                graphify claude install     CLAUDE.md    โ”‚
โ”‚  Cursor                     graphify cursor install     .cursorrules โ”‚
โ”‚  Gemini CLI / Android Studio graphify gemini install    GEMINI.md    โ”‚
โ”‚  Google Antigravity         graphify antigravity install .agent/     โ”‚
โ”‚  OpenAI Codex               graphify codex install      AGENTS.md   โ”‚
โ”‚  GitHub Copilot CLI         graphify copilot install    ~/.copilot/  โ”‚
โ”‚  OpenCode                   graphify opencode install   AGENTS.md   โ”‚
โ”‚  Aider                      graphify aider install      AGENTS.md   โ”‚
โ”‚  Factory Droid              graphify droid install       AGENTS.md   โ”‚
โ”‚  OpenClaw                   graphify claw install        AGENTS.md   โ”‚
โ”‚  Trae                       graphify trae install        AGENTS.md   โ”‚
โ”‚  Trae CN                    graphify trae-cn install     AGENTS.md   โ”‚
โ”‚                                                                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

MCP is a standard protocol. The .mcp.json config works with any editor that supports MCP.

Android Studio users: If you use Gemini in Android Studio, run graphify gemini install. The MCP config (.mcp.json) is project-level so the code-review-graph server is available too.

Q: What languages are supported?

code-review-graph: Kotlin, Java, Python, TypeScript, JavaScript, Go, Rust, C/C++, Ruby, Swift, Scala, PHP, Lua โ€” anything with AST parsing.

graphify: ALL files. Code via AST, docs/images via LLM semantic extraction.

Q: Does this cost money?

  • code-review-graph: 100% free. Pure AST parsing, no LLM.
  • graphify AST extraction: Free. No LLM needed for code files.
  • graphify semantic extraction: Uses your AI tokens for docs/images only. One-time cost, then cached.
  • Auto-updates on commit: Free (AST only for code changes).

Q: My graph is out of date after switching branches

code-review-graph build          # rebuild from scratch (instant)
# Then in Claude Code:
# /graphify . --update           # incremental update (only changed files)

Q: Can I query the graph without Claude Code?

Yes! graphify has a built-in CLI:

graphify query "how does authentication work?"
graphify query "how does authentication work?" --dfs    # depth-first trace
graphify query "how does authentication work?" --budget 1500  # limit tokens

And in Claude Code, you can use slash commands:

/graphify query "how does authentication work?"
/graphify path "AuthModule" "Database"
/graphify explain "LlmRouter"

Q: How big can the graph get?

Tested with 1,500+ nodes and 2,800+ edges without issues. The HTML visualization handles up to 5,000 nodes. Beyond that, use Obsidian vault (/graphify . --obsidian).


๐Ÿ”ง Troubleshooting

Problem Fix
graphify: command not found pip install graphifyy (two y's!)
code-review-graph: command not found pip install code-review-graph
MCP tools not showing in Claude Code Restart session (MCP loads at startup)
Graph out of date Run code-review-graph build + in Claude Code: /graphify . --update
UnicodeEncodeError on Windows Set PYTHONUTF8=1 environment variable
HTML viz won't open Try: python -m http.server 8080 in graphify-out/, open localhost:8080/graph.html
Hook not running on commit Check: ls -la .git/hooks/post-commit (must be executable)
Graph was built on different branch Run code-review-graph build to rebuild

๐ŸŽ Bonus: The Full Picture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                                  โ”‚
โ”‚                    YOUR DEVELOPMENT WORKFLOW                      โ”‚
โ”‚                                                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”‚
โ”‚  โ”‚  Write    โ”‚โ”€โ”€โ”€โ”€โ–บโ”‚  Commit  โ”‚โ”€โ”€โ”€โ”€โ–บโ”‚  Hook    โ”‚                โ”‚
โ”‚  โ”‚  Code     โ”‚     โ”‚  (git)   โ”‚     โ”‚  Runs    โ”‚                โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜                โ”‚
โ”‚                                          โ”‚                       โ”‚
โ”‚                            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”‚
โ”‚                            โ–ผ                           โ–ผ        โ”‚
โ”‚                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚                   โ”‚   graphify     โ”‚        โ”‚ code-review-    โ”‚ โ”‚
โ”‚                   โ”‚   updates      โ”‚        โ”‚ graph updates   โ”‚ โ”‚
โ”‚                   โ”‚   graph.json   โ”‚        โ”‚ internal graph  โ”‚ โ”‚
โ”‚                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚                           โ”‚                          โ”‚          โ”‚
โ”‚                           โ–ผ                          โ–ผ          โ”‚
โ”‚                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚                   โ”‚   graphify     โ”‚        โ”‚ code-review-    โ”‚ โ”‚
โ”‚                   โ”‚   MCP server   โ”‚        โ”‚ graph MCP       โ”‚ โ”‚
โ”‚                   โ”‚   (full graph) โ”‚        โ”‚ server (fast)   โ”‚ โ”‚
โ”‚                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚                           โ”‚                          โ”‚          โ”‚
โ”‚                           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ”‚                                      โ”‚                          โ”‚
โ”‚                                      โ–ผ                          โ”‚
โ”‚                             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                  โ”‚
โ”‚                             โ”‚  Claude Code   โ”‚                  โ”‚
โ”‚                             โ”‚  / Cursor /    โ”‚                  โ”‚
โ”‚                             โ”‚  Any AI Editor โ”‚                  โ”‚
โ”‚                             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ”‚
โ”‚                                      โ”‚                          โ”‚
โ”‚                                      โ–ผ                          โ”‚
โ”‚                             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                  โ”‚
โ”‚                             โ”‚  500x FASTER   โ”‚                  โ”‚
โ”‚                             โ”‚  500x CHEAPER  โ”‚                  โ”‚
โ”‚                             โ”‚  BETTER ANSWERSโ”‚                  โ”‚
โ”‚                             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ”‚
โ”‚                                                                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Made with ๐Ÿง  by Ashok Varma Matta

If this saved you time, star the gist and share it with your team!

graphify code-review-graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment