G
Graphify
graphify.homes
Codex context

Codex codebase context without rereading the repository

Codex gets reliable codebase context when repository rules live in AGENTS.md and structural relationships live in a queryable graph. Graphify gives Codex graph.html, graph.json, and GRAPH_REPORT.md so it can follow imports, calls, communities, and documentation links across sessions instead of repeatedly rebuilding context from search results.

Published Updated

Graphify outputs
graph.html
graph.json
GRAPH_REPORT.md

Graphify stores inspectable artifacts so codebase knowledge can be reviewed by humans and reused by AI coding assistants.

A Codex-style context window connected to a persistent codebase graph

Rules

AGENTS.md

Keep durable instructions, commands, constraints, and ownership hints close to the repository.

Structure

graph.json

Store reusable code and documentation relationships that are expensive to reconstruct from search.

Interface

Skill or MCP

Expose graph queries as repeatable tools instead of relying on a single long prompt.

What is Codex codebase context?

Codex codebase context is the set of repository facts, instructions, and relationships available while Codex works. It includes files Codex reads, AGENTS.md guidance, tool results, prior artifacts, and any graph or MCP service that exposes repository structure.

  • Source files provide implementation detail.
  • AGENTS.md provides durable working rules and commands.
  • A code graph provides relationships between symbols, files, docs, and design rationale.

Why does a larger context window not solve repository understanding?

A larger context window increases capacity, but it does not guarantee that Codex chooses the right files or preserves relationships between them. Architecture work needs explicit edges: who calls a function, which modules import a package, which document explains a subsystem, and what changes together.

  • Flat retrieval can miss a distant caller that explains a regression.
  • Repeated grep and file reads spend tokens on rediscovery.
  • A graph preserves the relationship across separate tasks and assistant sessions.

How should AGENTS.md work with a code graph?

AGENTS.md should tell Codex when and how to use the graph; the graph should contain project relationships. Put build commands, coding rules, review requirements, and graph usage instructions in AGENTS.md, then keep the graph itself machine-readable in graph.json.

  • State which artifact is authoritative and where it lives.
  • Tell Codex to query the graph before broad repository scans for architecture questions.
  • Require source verification when a graph edge is labeled INFERRED or AMBIGUOUS.

How does Graphify improve Codex answers?

Graphify gives Codex a compact map of the project before it reads full files. Codex can use paths, communities, god nodes, and report sections to decide which source files deserve detailed inspection, which reduces repeated exploration and makes handoffs more consistent.

  • Trace a symbol or subsystem through graph paths.
  • Use community structure to explain architectural boundaries.
  • Carry the same project evidence into planning, review, and implementation sessions.

How do you connect Graphify to Codex?

Generate Graphify artifacts inside the repository, register the graph instructions in AGENTS.md, and expose graph queries through the Graphify skill or MCP when your installation provides it. Some Graphify distributions include a Codex installer; if graphify codex install is available, it can write the recommended registration for you.

  • Build the graph before the first Codex task that needs architecture context.
  • Add a clear AGENTS.md instruction describing when to query graph.json.
  • Prefer MCP tool calls when you need repeatable queries, paths, and explanations.

When should Codex use grep instead of the graph?

Use grep for exact strings, recent edits, configuration values, and files the graph may not cover. Use the graph for ownership, dependencies, call paths, subsystem boundaries, and questions that require evidence from multiple files.

  • Grep answers 'where does this string appear?'
  • The graph answers 'what is connected to this behavior?'
  • Source inspection answers 'is the recorded relationship still correct?'

How should you verify a graph-assisted Codex answer?

Inspect the graph edge labels and open the cited source files before accepting an architectural change. EXTRACTED edges come from deterministic parsing; INFERRED and AMBIGUOUS edges need extra review because they may reflect semantic interpretation rather than direct syntax.

  • Check that graph.json matches the current commit.
  • Open every high-impact caller or dependency cited in the answer.
  • Refresh the graph after large refactors or generated-code changes.
Working commands

How do the setup commands fit together?

A Graphify instruction for AGENTS.md

Markdown
## Repository context
- For architecture, dependency, or blast-radius questions, query graphify-out/graph.json first.
- Verify INFERRED and AMBIGUOUS edges against source before editing.
- Refresh the graph after large refactors.
FAQ

Frequently asked questions

Does Codex support AGENTS.md?

Yes. AGENTS.md is the open repository-instruction format used by Codex and several other coding agents to keep project guidance versioned with the code.

Is graph.json a replacement for source files?

No. graph.json is a navigation and relationship layer. Codex must still open source files for exact implementation details and verification.

Can Codex use Graphify without MCP?

Yes. Codex can read graph artifacts and follow AGENTS.md instructions directly. MCP adds structured, repeatable tool calls for querying the graph.

Which Graphify artifact should AGENTS.md reference?

Reference graph.json for machine queries and GRAPH_REPORT.md for a concise human-readable overview. Link to graph.html when a reviewer needs the interactive view.

Key takeaways

What should you remember?

  • AGENTS.md stores working rules; Graphify stores code relationships.
  • Codex should query the graph for architecture and dependency questions, then verify important edges in source.
  • Refresh the graph after large changes so structural answers do not drift from the repository.
Sources

Where can you verify the details?

Related Graphify guides

Continue through the Graphify topic cluster with pages that explain assistant context, architecture review, documentation, and graph-based codebase understanding.

Turn this concept into a real project graph

Start from the use cases page or upload a project ZIP to build a graph that your team can inspect and reuse.