Claude Code prompt hook: 30 s default, a model checks a Sume render

A prompt hook asks a model to review a tool call, with a 30-second default timeout. When that suits a Sume render and when a script check is the better gate.

3 min readSume
All posts

A Claude Code prompt hook sends the hook input to a model with your instruction and waits up to 30 seconds by default. The hooks reference lists five handler types: command, http, mcp_tool, prompt and agent. Defaults differ: 600 seconds for command, http and mcp_tool, 30 for prompt and 60 for agent. For a Sume render, use a prompt hook for fuzzy judgments and a plain script for exact ones.

The reference shows the shape: {"type": "prompt", "prompt": "Is this command safe? $ARGUMENTS", "model": "..."}, where $ARGUMENTS carries the hook input. It does not spell out in the excerpt I read how the model's answer maps to a decision, so check the reference before you depend on it.

Handler types compared

All values are from the hooks reference.

Hook handler types and default timeouts (read 2026-10-08)
TypeRunsDefault timeoutGood for a Sume call
commandA script600 sExact checks: idempotency_key present, max_spend_usd set
httpA POST to a URL600 sCentral audit log
mcp_toolA tool on a connected MCP server600 sCalling a read tool such as a balance check
promptA model call30 sFuzzy review of what the render asks for
agentA subagent60 sA review that must look something up

Where a model check helps

Some questions a script cannot answer. Does this video prompt ask for a real person's likeness? Does this batch of ten generate_video calls look like one idea repeated by mistake? A prompt hook can read the arguments and say so. Keep its instruction narrow and give it only the tool input, not the whole conversation.

Some questions a script answers better. Sume requires an idempotency_key on write and paid tools; whether it is there is a yes or no. Use a command hook, which is faster and gives the same answer every time.

Steps

Start with a command hook for the exact gates. Add a prompt hook only for the judgment you cannot script, matched to the paid tools. Test with dry_run=true, which Sume documents as an admission and cost preview that does not submit the job, so a mistaken hook costs nothing while you tune it.

  • Raise the prompt hook's timeout only if you see it cut off; a slow gate in front of every render is its own cost.
  • Choose the cheapest model that follows the instruction.
  • Log what the hook decided, so you can see false alarms.

What Sume does not do

Sume does not call your hook and cannot see its verdict. Its own gates are the key requirement, the optional max_spend_usd that it enforces only when sent, and wallet admission. A model reviewer adds a human-like check on your side, and it can be wrong, so keep the exact gates in place underneath.

Sources

Related posts

More in Agents

All Agents posts

Written by Sume