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 💬 1 comment 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.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗