A free risk hook for Claude Code: make the agent flag prod, data and money commands before it runs them A developer published a free Node.js risk hook for Claude Code that intercepts every Bash command the agent is about to run and sorts it into three tiers โ€” high risk (prod/staging changes, data writes, DDL, sudo, deploys), warning (paid APIs, cloud spend, backfills), and caution (recoverable local or outward-facing actions). Risky commands are denied until the agent writes a plain risk flag in chat and re-runs with an explicit RISK_ACK acknowledgement, with a quote-aware parser that follows bash -c, eval and $() up to two levels deep. It's late, the agent has been working well for an hour, and you have started approving things on reflex. The next command in the queue is this: kubectl delete deployment api -n production Maybe that is what you asked for. Maybe the agent read "clean up the old deployment" more broadly than you meant. Either way, the moment to notice is before it runs, and by hour two your attention is the weakest part of the setup. The risk hook is a small Node script that makes that moment hard to miss. It reads every Bash command Claude Code is about to run, sorts risky ones into three tiers, and denies them until the agent has written a plain risk flag in the chat and re-run the command with an explicit acknowledgement. This post shows how to install it, what a flag looks like, how to tune it, and where it stops. The hook sits on two Claude Code events: RISK ACK=