---
n: 9
title: Codex hooks: config and payloads, measured
abstract: What a Codex hook is given and may answer, read from a live codex-cli 0.142.5 run: the hooks.json shape, the stdin fields per event, and the decisions that worked
status: final
track: *
source: the agent
at: 2026-09-18T09:58:11+00:00
---
Measured on 2026-09-18 against codex-cli 0.142.5 with `codex exec --dangerously-bypass-hook-trust -s workspace-write`, a hook script that dumped its stdin to a file and answered per event, in a scratch git repo with `.codex/hooks.json`. Every event fired that could fire in an exec run: SessionStart, UserPromptSubmit, PreToolUse (twice: one denied, one allowed), PostToolUse, Stop (twice: blocked, then re-entered with stop_hook_active true). SessionEnd did not fire for an exec run. The headline: the payload and the decision JSON are the same shape Claude Code's hooks use, field for field, so hook.py needs almost no adapter for Codex — what differs is the transcript (a rollout file under ~/.codex/sessions) and the trust step.
