Skip to content

AI Compass / Knowledge cards

A second opinion before risky commands

yes/no guards

Checked Automation Prompting Costs

A hook is a script that Claude Code runs automatically at fixed points, for example before a command runs or before the agent stops. If a decision model is attached to that hook, it answers a yes/no question, and Claude has to abide by the answer. This way a different model from the one doing the work does the checking.

What it is for

An agent that works without asking back gets a second opinion on risky commands, rule violations and a premature “done”, without a person having to sit next to it.

Steps

  1. Choose the question: May the command run? Does the change violate a project rule? Is the task demonstrably done?
  2. Check whether a fixed rule without a model is enough, for example a list of forbidden commands in the hook. If so, use that.
  3. Clarify what the checker gets to see. Commands, conversation history or file contents go to a model provider.
  4. Read third-party hook code before installing it, and at first use it only in a test project.
  5. Set a confidence threshold, that is, the minimum certainty at which the answer counts. In the video, Belay uses 75%. Turn on the decision log.
  6. Watch for false alarms. In the test, Toolgate stopped a dangerous delete command, but also deletions that were intended.
  7. After the test phase, decide whether the guard stays, is adjusted, or goes again.

Tools from the video

Limits

Open alternative: fixed hook rules without a model, or Claude Code’s built-in auto mode. Neither sends content to a further provider.

Sources

Status

Checked 9 October 2026 · Maturity new (tools in beta, tried only in the channel’s test run)

Want to try this with your team? That’s what the AI Lab is for. See the AI Lab