Use when reviewing, creating, enabling, disabling, or troubleshooting Codex hooks; when hooks may be adding context noise, hidden state, stale disabled entries, or surprise behavior; or when proposing a guardrail hook. Keeps hooks mechanical, low-noise, PreToolUse-first, deterministic, and separate from skill decision logic.
التثبيت
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Use when reviewing, creating, enabling, disabling, or troubleshooting Codex hooks; when hooks may be adding context noise, hidden state, stale disabled entries, or surprise behavior; or when proposing a guardrail hook. Keeps hooks mechanical, low-noise, PreToolUse-first, deterministic, and separate from skill decision logic.
Hook Hygiene
Overview
Review hooks as mechanical guardrails, not workflow brains. Skills decide what good work looks like; hooks block dangerous actions cheaply.
Policy
Prefer no hook over a noisy hook.
Prefer PreToolUse hooks for narrow blocking guards.
Avoid SessionStart, UserPromptSubmit, PostToolUse, Stop, PreCompact, and PostCompact unless there is strong low-noise proof.
Hooks must be deterministic, fast, local, and side-effect-minimal.
Hooks should not inject large context, perform broad scans, call network APIs, or decide complex workflow routing.
Do not encode full proof, diagnosis, issue routing, or PR closeout logic in hooks. Use skills for that.
Good Hook Candidates
Blocking dangerous write surfaces, such as production-looking env writes or guarded worktree mutations.
Blocking forbidden command shapes, such as direct pushes to protected branches or unsafe bulk env replacement.