Regression in 0.142.5 on macOS: hooks.json is discovered neither in exec nor TUI; no hook/started emitted even with --dangerously-bypass-hook-trust
Open 💬 2 comments Opened Jul 1, 2026 by Ray0213
What issue are you seeing?
On macOS with codex-cli 0.142.5, hooks configured in ~/.codex/hooks.json do not run at all.
This reproduces in both:
codex exec --json- interactive TUI (
codex)
Even with --dangerously-bypass-hook-trust, no hooks fire, no hook/started or hook/completed events are emitted, and file-probe hooks produce no side effects.
Environment
- macOS
codex-cli 0.142.5which codex=>/Users/hooray0213/.local/bin/codex
Minimal reproduction
Configured ~/.codex/hooks.json with minimal file-writing probes:
{
"hooks": {
"userPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "/bin/sh -c 'date >> /Users/hooray0213/.codex/state/user-prompt-hook.log'"
}
]
}
],
"preToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "/bin/sh -c 'date >> /Users/hooray0213/.codex/state/pretool-hook.log; exit 2'"
}
]
}
]
}
}
Then ran:
codex exec --dangerously-bypass-hook-trust --json "pwd"
And also tested interactive TUI by sending a prompt that should trigger a Bash tool call.
Expected behavior
userPromptSubmitshould write~/.codex/state/user-prompt-hook.logpreToolUsewith matcherBashshould write~/.codex/state/pretool-hook.logpreToolUseshould block the Bash tool call because the hook exits non-zerocodex exec --jsonshould emithook/started/hook/completed
Actual behavior
pwdruns successfully- no
hook/startedorhook/completedevents appear - interactive TUI also does not run
userPromptSubmitorpreToolUse ~/.codex/stateremains empty- no file-probe logs are created at all
Why this does not appear to be trust/config related
--dangerously-bypass-hook-trustwas used- minimal
~/.codex/hooks.jsonwas tested - both
execand interactive TUI paths fail - file-probe hooks produce no side effects
- this was also reproduced earlier with isolated minimal hook setups
Additional notes
This looks like a hooks discovery/dispatch regression rather than a trust failure, because the runtime appears to skip hook execution entirely.
2 Comments
Additional confirmation after updating and re-testing on July 1, 2026:
codex-cli 0.142.5codex --version=>codex-cli 0.142.5which codex=>/Users/hooray0213/.local/bin/codexcodex exec --dangerously-bypass-hook-trust --json "pwd"runs successfully, but still emits nohook/startedorhook/completedeventsI also re-tested in the interactive TUI with a minimal file-probe hook config:
Expected:
UserPromptSubmitshould create~/.codex/state/user-prompt-hook.logPreToolUseforBashshould create~/.codex/state/pretool-hook.logPreToolUseshould block the Bash tool call because it exits non-zeroActual:
~/.codex/stateremains empty after the TUI testThat makes this look stronger than a trust/UI problem:
--dangerously-bypass-hook-trustwas used for theexec --jsonrepro/hooksUI visibilityexecand interactive TUI paths fail to dispatch hooksSo at this point the issue appears to be in hook discovery/dispatch/runtime execution itself, not just hook trust or review UX.
Additional confirmation after updating again and re-testing on July 21, 2026:
codex-cli 0.144.6codex --version=>codex-cli 0.144.6which codex=>/Users/hooray0213/.local/bin/codexI re-ran the same minimal isolated file-probe setup under a separate
CODEX_HOME:Expected:
UserPromptSubmitshould createuser-prompt-hook.logPreToolUseforBashshould createpretool-hook.logPreToolUseshould block the Bash tool call because it exits non-zeroActual in
codex exec --dangerously-bypass-hook-trust --json:hook/startedorhook/completedevents are emittedActual in interactive TUI (
codex --no-alt-screen):So this is still reproducible in
0.144.6across bothexecand interactive TUI paths: tool execution works, but hook dispatch/runtime execution still does not occur.