Inside Codex: CLI and agent architecture

The official Codex architecture docs do not quite match the code, so I redrew this diagram.

An architecture map compiled from the code as of 2026-10-1.

An interactive map of the Codex CLI and agent runtime: architecture, execution flow, and example paths for a tool call, an approval wait, and a direct answer. Nodes can be dragged, zoomed, and opened to their source entry.