Skip to content
New · v0.9.35 is out
Integrations

Give OpenAI Codex a map of your codebase

Setup guide · AGENTS.md · $graphify

Codex is fast at executing changes once it knows where to make them; the expensive part is the orientation before that, where it greps and reads files to reconstruct how the repo fits together. Graphify replaces that reconstruction with a local knowledge graph Codex can query directly. On Codex the integration is instruction-file first: always-on rules in AGENTS.md, the file Codex already reads in every session, plus the skill behind the $graphify command.

What graphify codex install writes

  • An AGENTS.md section: query-first rules in your project's AGENTS.md. This is the always-on mechanism on Codex; the installer owns only its own section and leaves the rest of the file alone.
  • The skill: .codex/skills/graphify/SKILL.md, which is what $graphify triggers.
  • A PreToolUse entry in .codex/hooks.json, registered for Bash tool calls. Full honesty: its command, graphify hook-check, is deliberately a no-op today, because Codex Desktop rejects the additionalContext payload a nudge would need. It exists so installed hooks can never break a Bash call; the AGENTS.md rules do the actual steering.
AGENTS.md (section added by graphify codex install, excerpt)
## graphify This project has a knowledge graph at graphify-out/ with god nodes,community structure, and cross-file relationships. Rules:- For codebase questions, first run `graphify query "<question>"`  when graphify-out/graph.json exists. Use `graphify path "<A>" "<B>"`  for relationships and `graphify explain "<concept>"` for focused  concepts.- After modifying code, run `graphify update .` to keep the graph  current (AST-only, no API cost).

Set it up

  1. Install the CLI. If graphify is not found afterwards, run uv tool update-shell and open a new terminal.
  2. From the project root: graphify codex install (or graphify install --project --platform codex to keep every file inside the repo).
  3. Enable parallel extraction in ~/.codex/config.toml:
~/.codex/config.toml
# ~/.codex/config.toml[features]multi_agent = true
terminal
$ uv tool install graphifyy$ graphify codex install

Then build the graph from inside a Codex session. Note the invocation: Codex uses $graphify instead of /graphify.

in Codex
$graphify .

The build writes graphify-out/ with graph.json (the queryable graph), graph.html (interactive view), and GRAPH_REPORT.md (highlights and suggested questions).

How Codex uses the graph

With the AGENTS.md rules in place, a structural question makes Codex reach for the graph before the file tree: graphify query "<question>" returns a scoped subgraph under a token budget, graphify path "<A>" "<B>" walks the dependency route between two symbols, and graphify explain "<concept>" lists everything connected to one node. Results carry file:line citations, and every edge is tagged EXTRACTED (parsed from the AST), INFERRED (a model connected it), or AMBIGUOUS (evidence, not fully resolved). The rules also tell Codex to run graphify update . after modifying code, so the graph tracks its own edits.

Because Codex cannot hard-block a tool call, there is no strict mode here (that exists only on Claude Code, whose hook API supports a deny decision). On Codex, the instruction file is the mechanism, the same approach the OpenCode integration builds on.

Optional: the MCP server in config.toml

The skill plus the CLI is the complete default setup; nothing about it requires MCP. If you would rather expose the graph to Codex as native MCP tools (query_graph, shortest_path, god_nodes, and more; see the MCP tools reference), register the server in ~/.codex/config.toml:

~/.codex/config.toml
# ~/.codex/config.toml[mcp_servers.graphify]command = "python"args = ["-m", "graphify.serve", "graphify-out/graph.json"]

The stdio server ships as an extra: uv tool install "graphifyy[mcp]".

Troubleshooting

  • $graphify does nothing: confirm .codex/skills/graphify/SKILL.md exists and AGENTS.md contains the graphify section, then start a new Codex session so both are picked up. And it is $graphify, not /graphify, on Codex.
  • graphify: command not found: the uv or pipx tool bin dir (~/.local/bin) is not on PATH. Run uv tool update-shell (or pipx ensurepath) and open a new terminal.
  • Extraction feels slow on a big repo: check that multi_agent = true is set under [features] in ~/.codex/config.toml; that is what allows parallel subagent extraction on Codex.
  • A partial install (say, AGENTS.md written but .codex/hooks.json missing): just re-run graphify codex install. It is idempotent and fills in whatever is missing without duplicating the AGENTS.md section.
  • Codex greps anyway: expected while graphify-out/graph.json does not exist. The rules only apply once a graph is built, so run $graphify . first.

Codex FAQ

Why $graphify and not /graphify?

Codex uses $graphify instead of /graphify; that is its convention for invoking this kind of command. Everything the skill does afterwards is identical to the other assistants, and the graph it builds in graphify-out/ is the same one every other tool queries.

Does Codex get hooks like Claude Code does?

Not usefully, and Graphify is honest about that. The installer does register a PreToolUse entry in .codex/hooks.json, but the command it runs (graphify hook-check) is deliberately a no-op, because Codex Desktop rejects the additionalContext payload a nudge would need. The always-on AGENTS.md rules carry the graph-first guidance on Codex instead.

What is multi_agent = true for?

Graph extraction can fan out to parallel subagents, which is much faster on large repos. On Codex that requires multi_agent = true under [features] in ~/.codex/config.toml. Without it, extraction still works, just without parallel dispatch.

Does graphify codex install overwrite my AGENTS.md?

No. It replaces or appends only its own graphify section and leaves the rest of the file alone. Re-running the install refreshes that section idempotently, and graphify codex uninstall removes exactly that section plus the .codex/hooks.json entry.

Should I commit the AGENTS.md section?

Yes. AGENTS.md is a plain project file, so committing the graphify section means one install covers the whole team. Teammates need the graphifyy CLI installed and a built graph (graphify-out/graph.json) for the queries to work.

Does my code leave my machine?

Source code is parsed locally with tree-sitter (36 language grammars); building code edges never requires an API call. Non-code files such as docs and PDFs are read by the model you already use in Codex. Nothing is sent to Graphify: there is no telemetry and no account.

Next steps

The quickstart covers the full CLI, and the MCP tools reference documents every tool the optional server exposes. The same graph serves every assistant you run: see Graphify + Claude Code, Graphify + Gemini CLI, or browse the full list on the integrations page.

We use privacy-friendly analytics to improve Graphify. Cookies only load if you accept. Privacy policy