Graph Engineering for AI Coding Agents: Graphify, Claude Code, and Codex
“Use a graph” can mean two very different things in AI coding. A code knowledge graph maps what is connected inside a repository: functions, modules, routes, imports, calls, and documentation. An agent workflow graph maps what happens during a task: which worker investigates, which one changes code, when tests run, and who reviews the evidence.
The distinction matters. Graphify is an example of the first kind. It can help Claude Code or Codex find a path through a codebase. A multi-stage review flow is an example of the second kind. It can use Graphify's evidence, but Graphify does not turn one coding session into a reliable multi-agent process by itself.
The practical rule: use a code graph when relationship questions are expensive to answer by reading files; use a workflow graph when handoffs, independent checks, or routing have become hard to control. For a small, well-scoped edit, ordinary search and one agent may be enough.
Two graphs, two questions
| Code knowledge graph | Agent workflow graph | |
|---|---|---|
| Nodes | Files, functions, classes, routes, docs, or concepts | Steps such as discover, implement, test, review |
| Edges | Imports, calls, references, dependencies | Allowed transitions and handoffs |
| Question | “What connects this route to the database?” | “What runs after the tests fail?” |
| Example | Graphify's graph of a repository | A staged implementer → verifier → reviewer process |
| Main risk | Missing, stale, or inferred relationships | Extra coordination, cost, and unclear ownership |
The Graphify project builds a local code graph from source and exposes commands for querying a concept or tracing a path. The Claude Code Graph Engineering Masterclass uses “graph” for explicit control flow between specialized agents. Both are useful ideas, but their nodes and edges represent different things.
What a code graph gives an agent
A text search can find the name of a function. It does not immediately tell you whether a call crosses a service boundary, which other modules import it, or which route eventually reaches the changed code. A code graph stores such relationships as typed edges so an agent can traverse a small relevant neighborhood before opening source files.
For example, imagine a bug report: “Password resets sometimes return success without storing a token.” A useful exploration path is not “read every file with reset in its name.” It is:
HTTP route → reset handler → token service → persistence adapter
└──────────→ notification queueThe graph helps locate a plausible path and its side branches. The agent must still read the cited source and run tests before claiming a root cause. A path is a navigation aid, not proof that the runtime took that exact route.
Graphify's documented output includes graph.json, an interactive graph.html, and a GRAPH_REPORT.md overview. It marks relationships as EXTRACTED, INFERRED, or AMBIGUOUS and returns file-and-line references for inspection. Treat those labels as a reason to verify an edge, not as a universal confidence score. Static extraction can miss dynamic dispatch, generated code, runtime configuration, and relationships that are present only in deployment. Graphify: repository and query examples
This is also different from vector search. A vector index retrieves text likely to be semantically relevant to a question; a code graph answers relationship and path questions about entities it has extracted. Neither replaces the other or a source read.
Use Graphify in Claude Code
Graphify's official Python package is named graphifyy (double y); the executable is graphify. The project warns that similarly named PyPI packages are not affiliated. The documented local setup is:
uv tool install graphifyy
graphify install --projectRun the second command from the repository root if you want the skill and configuration under the project rather than your user profile. Review the files it proposes before committing them. In Claude Code, start a new session and build the map with:
/graphify .Then ask a structural question, or call the CLI directly:
graphify query "What connects the login route to session storage?"
graphify path "LoginHandler" "SessionStore"
graphify explain "SessionStore"These are example questions, not a claim that those symbols exist in your repository. Replace them with names from your own code and inspect the returned file:line references. After changing code, run graphify update . so your next query does not describe yesterday's repository. Graphify documents a Claude Code skill and PreToolUse hooks that *nudge* the assistant toward graph queries; a stricter project option can block the first raw source read and redirect it to the graph. Start with the default soft behavior—forcing graph-first exploration is not helpful for every task. Graphify: Claude Code setup
You do not need an MCP server for this workflow. The skill and CLI are sufficient. Graphify offers an optional MCP server when you want native graph-query tools inside the agent; that requires its separate MCP extra and a server configuration. Graphify: Claude Code integration
Can Codex use the same graph? Yes—with a different integration
Graphify documents a Codex-specific install. From your project root, use the project-scoped variant:
uv tool install graphifyy
graphify install --project --platform codexThen open a new Codex session and invoke $graphify .—not Claude Code's /graphify .—to build graphify-out/. You can ask Codex to run the same graphify query, path, and explain commands, and to read cited source before editing. Graphify's Codex instructions live in AGENTS.md; they tell the agent to consult the graph when one exists and refresh it after modifications. Graphify: Codex integration
There is a meaningful limitation: Graphify says its Codex PreToolUse entry is currently a no-op in Codex Desktop, so AGENTS.md guidance is a *request*, not a hard guarantee that every file read will go through Graphify first. Claude Code's hook-based strict mode is not equivalent. Codex can use the graph, but the enforcement story differs. Graphify: Codex FAQ
Codex can also connect to MCP servers. The official OpenAI Docs on Codex MCP configuration confirm that MCP servers can be configured for its CLI and IDE extension. Graphify supplies an optional stdio MCP recipe, but it is not needed to answer ordinary code-graph questions with the CLI. Prefer the simpler skill-plus-CLI path first. If you use a hosted graph endpoint instead, check its account, network, and data policy separately from the local open-source engine.
Three real tasks worth trying
The commands below are reproducible task patterns. They are not results from a benchmark we ran.
1. Orient in a new repository
Build the graph, open GRAPH_REPORT.md, and ask: “Which modules connect the HTTP layer to the database, and which are the high-degree hubs?” Then verify two or three suggested hubs by opening their source. This is useful when a repository has many directories but few architecture documents. Do not assume a high-degree node is the most important product concept; it may simply be a shared utility.
2. Trace a change's likely blast radius
Before changing an authentication helper, run graphify explain on the symbol and path queries from public routes to it. Ask the agent to list affected call sites, tests, and any unresolved edges. Then use ordinary code search to check dynamic uses and run the relevant tests. This narrows investigation; it is not a substitute for dependency analysis by a compiler or runtime.
3. Review a cross-cutting PR
Map changed symbols to callers and nearby tests. Give a reviewer the diff, Graphify paths, original task, and CI output. Ask them to verify whether the change crosses an authorization or persistence boundary and whether the affected tests cover it. If an edge is inferred or stale, the reviewer must inspect the source instead of promoting that edge to a fact.
Graphify's worked example demonstrates a small Python project with a central storage module, cross-module calls, and documentation linked to code. Those are vendor-provided outputs; the steps above are designed so readers can produce and check their own results.
The other graph: a workflow with explicit handoffs
The Claude Code masterclass describes a graph of specialized stages and shared state. The useful principle is explicit ownership: each stage receives a defined input, produces a defined artifact, and has a clear next step. You do not need a graph framework for a first version. A checklist and two independent agent sessions can implement a small directed workflow:
Task and acceptance criteria
↓
Explore relevant code (Graphify + source reads)
↓
Implement scoped change
↓
Run deterministic checks ── failure → repair, then rerun
↓ pass
Fresh review of diff + cited source + test evidence
↓
Human merge decisionThe exploration and review stages can have separate contexts. That reduces the chance that the implementer merely approves its own explanation. Claude Code's subagent documentation describes separate context windows for specialized work; Codex's official skill and MCP documentation provides reusable guidance and tool integrations on its side. But separate context does not make a reviewer independent of the evidence. It only changes what it has seen so far.
The masterclass's demo gives its final reviewer a findings report without the source code. That can test whether a report is clear and internally consistent. It cannot verify that a specific vulnerability exists at a specific line. The article also says the bug hunter never sees raw files while its own prompt instructs that agent to read them. Treat its reported findings as a demonstration by the author, not an independently established performance result.
For a stronger workflow, give the reviewer a fresh context and the minimum evidence needed to challenge a claim: repository revision, file:line references, relevant diff, test output, and permission to inspect source. Require “verified,” “unsupported,” or “needs human judgment” for each finding. Put deterministic tests before model review, and keep the merge decision with a person or protected repository policy. Our coding-agent evaluation guide explains how to measure whether this added process pays for itself.
When the graph layer is worth the overhead
Use a code graph when you repeatedly ask cross-file or cross-service relationship questions, especially in a large or unfamiliar repository. Use a workflow graph when routing, parallel checks, or independent verification would otherwise live in an opaque prompt. Combine them when both problems exist: Graphify supplies scoped structural evidence, while the workflow decides who uses that evidence and when.
Skip both for a one-file edit where a search, source read, and test run answer the question quickly. Every graph has a maintenance cost. Refresh it after changes, inspect inferred relationships, measure whether it actually saves investigation time, and never let an attractive diagram outrank the code.
For adjacent context, see our guides to agent harness design, context engineering in Claude Code and Codex, and AI coding-agent security.



