AI Coding Agent Hooks
A hook is a shell script your AI coding agent runs automatically at a defined event — before a tool call, after a file edit, before a shell command executes. Used well, hooks enforce the policy you can't rely on a prompt alone to guarantee: block a secret before it's committed, log every tool call for an audit trail, or require a second check before a production command runs. Every hook below is real, copy-paste code — not a concept.
🔒 Secrets & Credentials
8 hooksStop a secret from ever leaving your machine — block it before a commit, or block the agent from reading the file in the first place.
🛑 Production Guardrails
8 hooksForce a human-in-the-loop check before a command that touches production infrastructure, or block a destructive command outright.
📋 Audit & Compliance Logging
8 hooksA durable, independent record of what an agent did in a session — the evidence an SR 11-7 or SOX change-control review actually asks for.
🧩 MCP & Config Safety
9 hooksDefensive hooks against the exact pattern behind real CVEs: a cloned repo's own config file silently auto-approving tools or servers.
🏦 Financial & Model-Risk Controls
11 hooksControls built for the exact things a bank, insurer, or asset manager's own model-risk, SOX, and information-barrier reviews ask about — not generic security hygiene.
🕵️ Data Privacy & PII
8 hooksCatch customer PII before it leaves the machine, gets logged in the clear, or ends up re-identified across two datasets that were never supposed to be joined.
🧭 Model & Permission Governance
6 hooksWho or what is allowed to switch models, override a deny, or run in bypass mode — and whether that decision left a trace.
🕸️ Subagent & Multi-Agent Safety
7 hooksDelegation chains, parallel subagents, and shared task queues each need their own guardrail — a hook on the root session doesn't see what a spawned agent does.
⏱️ Session Lifecycle & Continuity
6 hooksWhat happened at session start, resume, fork, compaction, and end — the moments a transcript alone doesn't make easy to reconstruct.
📁 File & Environment Change Monitoring
6 hooksCatches drift on disk and in config that a tool-call log alone won't show — a file edited outside the agent, a directory added mid-session, a symlink swapped underneath a watched path.
🌳 Worktree & Git Safety
5 hooksIsolated worktrees are supposed to make parallel agent work safer — these close the gaps around creating and tearing them down.
✍️ Prompt & Input Safety
6 hooksThe user's own prompt is an input surface too — a pasted secret, an injection pattern, or an untrusted slash-command expansion all arrive before the agentic loop even starts.
💳 Cost & Usage Controls
6 hooksBudget ceilings, model-tier escalation, and runaway subagent fan-out — the hooks that keep an unattended agent from becoming an unattended bill.
🔔 Notification & Escalation Routing
6 hooksWhere Claude Code's own notifications go — a pager, a dedupe filter, a redacted terminal — instead of just whatever's watching stdout.
Tell us what you want enforced automatically and we’ll build it — free and public.
Request a hook →