Skip to main content
To understand a new codebase fast, build a graph of it first, then read the code in the order the graph suggests. Graphify turns a repository into a knowledge graph of files, functions, classes and the calls between them. In 30 minutes you go from git clone to a list of the code that matters most, a wiki you can browse, and answers that point at real lines.

What you’ll build

  • A graphify-out/ folder with graph.json, GRAPH_REPORT.md and graph.html.
  • A ranked list of the hub functions everyone else depends on.
  • A Markdown wiki with one article per community of related code.
  • A habit: ask the graph before you grep.
This recipe uses the open-source Graphify-Labs/graphify repository as the “new” codebase. Swap in your own.

Setup

You need Python 3.10 or later and uv.
The package is graphifyy. The command it installs is graphify.

Step 1: Build the graph

extract --code-only parses source with tree-sitter and needs no LLM or API key. On this repository it took about 26 seconds:
cluster-only writes the report and the HTML view from that graph. --no-label skips LLM community names, so communities show as numbers.

Step 2: Read the report

Open graphify-out/GRAPH_REPORT.md. The top tells you how much to trust the graph:
EXTRACTED edges come straight from the syntax tree. INFERRED edges were resolved by heuristics and carry a confidence score. The commit line tells you whether the graph matches your checkout.

Step 3: Find the hub nodes

These are the functions to read first. Most of the codebase calls into them, so understanding them explains a large share of everything else.

Step 4: Explain one node

Arrows show direction: --> is what this node calls, <-- is what calls it. Every edge has a file and line, so you can jump straight to the source.

Step 5: Ask questions

The answer is a list of nodes and edges, each with its source location. --budget caps the tokens returned. When the result is cut, Graphify says so and tells you the budget that would fit everything:

Step 6: Export a wiki

This writes one article per community plus graphify-out/wiki/index.md (904 articles for this repository). Start at the index and open the communities that hold your god nodes.

When it goes wrong

graphify explain says no node matches. Names are matched against labels like _rebuild_code(). If a name exists in several files, graphify path and similar commands list the candidates in path::symbol form, for example graphify/cli.py::dispatch_command(). Use that form. graph.html shows blobs instead of functions. Above 5,000 nodes the HTML view is aggregated by community. Use explain, query and the wiki for detail.

Production patterns

  • Commit nothing yet. Add graphify-out/ to .gitignore while you explore. The shared team graph recipe covers committing it.
  • Give the graph to your agent. See Give Claude Code a graph of your monorepo.
  • Keep it fresh with graphify update . after you pull. It re-extracts code without an API cost.

Complete example

What you built

You have a graph of the repository, a ranked reading list, a wiki, and a way to ask questions that cite real lines. In Graphify, the hosted product, the same graph is built for you when you connect a repository, and your agent queries it over MCP.

Next steps

Query the graph

Every way to ask the graph a question, with budgets and filters.

Plan a refactor

Use the same graph to see what a change reaches.

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.