| block-dangerous-bash | PreToolUse (^Bash$) | Denies rm -rf / ~ *, force pushes to main/master/production, git reset --hard, git clean -fdx, curl | sh, chmod 777, mkfs/dd to disks, DROP DATABASE from a CLI, terraform destroy, kubectl delete namespace. Normal commands (rm -rf node_modules, force push to a feature branch) pass. |
| protect-files | PreToolUse (^apply_patch$|^Bash$) | Stops edits to .env*, keys, secrets/, .git/ and the hooks themselves, through apply_patch (Add/Update/Delete/Move) or shell writes (>, >>, sed -i, tee, cp, mv, rm). .env.example stays editable. |
| mcp-guard | PreToolUse (^mcp__) | Allowlist / denylist for MCP tools (mcp__github__*, mcp__*__delete_*) and a secret check on tool arguments. |
| approve-safe-commands | PermissionRequest (^Bash$) | Answers approval prompts for read-only commands you list (git status, npm test, rg ...), denies dangerous ones, stays silent for the rest. Rejects anything with redirects, $( ), backticks or sudo. |
| scan-prompt-secrets | UserPromptSubmit | Blocks prompts that contain OpenAI, Anthropic, AWS, GitHub, Slack, Stripe or Google keys, JWTs or private keys, without echoing the secret. |
| session-context | SessionStart (startup|resume|compact) | Hands Codex the branch, uncommitted files, last 5 commits and .codex/notes.md, capped in size. |
| subagent-brief | SubagentStart | Gives every subagent the first lines of AGENTS.md, the protected paths and a "report changed files" instruction. |
| stop-require-tests | Stop | If code changed, runs your tests before Codex finishes; on failure returns decision: block so Codex keeps fixing. Never loops (stop_hook_active). Always prints JSON, as Stop requires. |
| precompact-notes | PreCompact (manual|auto) | Writes a checkpoint (branch, diff stat) to .codex/notes.md before compaction; session-context feeds it back after. |
| audit-log | PostToolUse (all, async) | One JSON line per tool call in .codex/logs/audit.jsonl, secrets redacted. Runs in the background. |