OMX
Oh My CodeXv0.18.9

Codex-Native Hooks

How OMX uses the Codex CLI native hook interface directly, and the boundary between native coverage and runtime fallback.

Codex CLI reads registrations from .codex/hooks.json and invokes external handlers at defined lifecycle points when [features] codex_hooks = true is set in .codex/config.toml. OMX uses this interface directly rather than wrapping the Codex binary in a shell script.

Installation structure

omx setup writes two files.

  • .codex/config.toml — enables codex_hooks
  • .codex/hooks.json — registers the OMX handler dist/scripts/codex-native-hook.js

User-managed hook entries already present in .codex/hooks.json are preserved during installation. omx uninstall removes only the OMX-managed entries and leaves user hooks in place.

The shell wrapper around the Codex binary is still supported via omx tmux-hook, but it is not the primary path for native events.

Coverage matrix

OMX concernCodex eventStatus
Session bookkeeping, wiki startup contextSessionStartNative
Keyword detection, skill state seedingUserPromptSubmitNative
Bash safety checks, commit format guardPreToolUse (Bash only)Native-partial
Command-not-found guidance, exit-code reviewPostToolUse (Bash only)Native-partial
Ralph / autopilot / ultrawork / ultraqa continuationStopNative-partial
Auto-nudge on stalled turnsStopNative-partial
Session-end wiki capture, session-idleRuntime-fallback
Non-Bash tool interceptionRuntime-fallback

"Native-partial" means the native path handles the common case; edge cases fall back to the notify-hook or tmux runtime path.

How to verify

Check that hooks are installed correctly:

omx doctor

Smoke test that the native hook path executes end-to-end:

omx exec --skip-git-repo-check -C . "Reply with exactly OMX-EXEC-OK"

Plugin dispatch logs are written to .omx/logs/hooks-YYYY-MM-DD.jsonl.

On this page