Skip to content
BENIBIX Learn

Prompt Hook

AI⌨️ Claude CodeConfiguration

Also known as type: prompt, $ARGUMENTS

A hook that asks a Claude model a yes or no question.

Think of it like

It is like you ask a friend a yes or no question. Then you go on.

Example

Lucy cannot write a script that knows if a task is finished. A prompt hook on Stop asks a model to judge it.

Why it matters

Some checks are about meaning. A model can judge them where a script cannot.

Definition

A prompt hook is a hook whose type is prompt, so it sends a prompt to a Claude model for a single answer. $ARGUMENTS in the prompt is swapped for the event's JSON. The model replies with ok true to allow, or ok false with a reason. It is used where the check needs judgment, not a fixed rule. Its default timeout is 30 seconds.

Example code

json
{
  "type": "prompt",
  "prompt": "Check if every task the user asked for is done: $ARGUMENTS"
}
Ask a model if Claude is really done.

Common mistake

Leaving out $ARGUMENTS. Then the model judges with no idea of what took place.

Key takeaways

  1. 1
    Asks a model. One answer.
  2. 2
    ok true or false. With a reason.
  3. 3
    For judgment. Not fixed rules.

Compare