OpenAI Codex trace viewer and verified capture¶
agent-trace records Codex command-hook events into a local trace store, then replays them in the terminal or a self-contained HTML viewer.
Verification is version-specific¶
The capture matrix is the source of truth for
the Codex version and date last exercised with a real provider run. A
verified entry applies to that tested release and fixture, not every Codex
release. The current matrix verifies codex-cli 0.167.0-alpha.3.2.
agent-strace setup --cli codex --verify performs a static installation check.
It validates the hooks file, the Codex hooks feature setting, and the local
agent-trace executable. The hooks file is the user-level one, or the plugin's
when the agent-trace Codex plugin is enabled. After one
harmless local run, --verify --live adds a check of the newest matching
recorded session. It does not start Codex or make a model request.
Install and check hooks¶
agent-strace setup --cli codex
agent-strace setup --cli codex --verify
agent-strace setup --cli codex --verify --live
Codex must trust each generated command hook in its Hooks UI. Headless
codex exec can skip untrusted hooks without a warning. Re-run setup after
upgrading from an older agent-trace configuration so newer session-end,
subagent and model-request hooks are present, then trust the hooks setup names
as new or changed. With the Codex plugin,
update the plugin instead, then trust its hooks
again. Live verification reports observed event types,
boundaries, redaction, evidence health, and packaged capture-matrix gaps. It
returns non-zero when matching reviewable evidence is unavailable.
View a trace¶
agent-strace list
agent-strace health SESSION_ID
agent-strace replay SESSION_ID
agent-strace replay SESSION_ID --format html -o codex-session.html
agent-strace tree SESSION_ID
agent-strace stats SESSION_ID
Codex subagent events and their tool calls are stored in the parent session. Replay and statistics label them by the provider-supplied agent identity.
On Codex 0.164.0 and later, each model request is recorded as an
llm_response event with the model, status and token usage, a subagent's
included. input_tokens already includes cached input and output_tokens
already includes reasoning, so total_tokens is their sum.
Known capture gaps¶
- Hidden reasoning is not available.
- Token usage is recorded only on Codex
0.164.0and later, once thePostModelRequesthook is trusted. Model requests have no request event or duration, because setup does not registerPreModelRequest. - A failed shell command can arrive as a normal tool result rather than an error event.
- No recorded event directly links a subagent identity to the
spawn_agenttool call that started it. - File and command detail depends on provider tool payloads.
- Provider upgrades can change event shape or timing.
See the capture matrix for the complete current list.