hook-development
Installation
SKILL.md
Hook Development (Codex)
Overview
Codex CLI does not provide Claude-style hook events. To replicate hook behavior, implement a hook runner (wrapper script or CI job) that:
- Runs hook scripts before/after
codex exec. - Optionally parses
codex exec --jsonoutput to detect tool usage. - Applies a
hooks.jsonconfiguration to decide which hooks to run.
This skill defines a Codex hook contract and provides utilities for validating, testing, and linting hooks.
This repository ships a reference runner at scripts/codex-hook-runner (installed by install.sh) that implements the contract described below. Hooks are enabled by default in codex-autonomous; set CODEX_DISABLE_HOOKS=1 to disable.
Hook Types
Prompt Hooks (LLM-driven)
Use an LLM (Codex or another model) to make contextual decisions.