Codex CLI hooks need a few easy-to-miss setup steps
Prompt Cup is a free penalty shootout game that only runs while Codex CLI is coding. The useful part is the setup detail for making Codex CLI hooks work in real projects. Hooks must be turned on and trusted before they run.
After setup, `~/.codex/config.toml` needs `[features]` with `hooks = true`, or Codex can be started with `codex --enable hooks`; then `/hooks` inside Codex must be used to trust the entries. Before trust is granted, hooks may simply fail to run without an obvious warning. The hook config must use a nested event-based shape, not a flat list; the flat version makes `/hooks` show zero installed hooks.
On Windows, a one-line `curl` hook can fail because PowerShell, cmd, and bash parse commands differently. A small Node forwarder that reads the event from standard input and posts it to a works more reliably across those shells. The tool maps `UserPromptSubmit`, `PostToolUse`, `PermissionRequest`, and `Stop`, runs only on `127.0.0.1`, and does not use accounts, paid tiers, outside , , or tracking.
Key points
- Codex CLI hooks must be enabled and then trusted in `/hooks`.
- The config can use `[features]` with `hooks = true`, or Codex can be started with `codex --enable hooks`.
- Hook config needs the nested event-based format; a flat list can make Codex show zero installed hooks.
- On Windows, a small Node forwarder can be more reliable than a one-line `curl` command.
- Prompt Cup on `127.0.0.1` and does not send data out or use tracking.