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.

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.
| Type | Runs | Default timeout | Good for a Sume call |
|---|---|---|---|
| command | A script | 600 s | Exact checks: idempotency_key present, max_spend_usd set |
| http | A POST to a URL | 600 s | Central audit log |
| mcp_tool | A tool on a connected MCP server | 600 s | Calling a read tool such as a balance check |
| prompt | A model call | 30 s | Fuzzy review of what the render asks for |
| agent | A subagent | 60 s | A 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
- Which Sume MCP tools to leave undeferred when Claude searches tools
Anthropic says to keep 3 to 5 frequently used tools non-deferred. Which Sume hosted MCP tools to pin and which to defer.
- Codex background tasks keep their turn's permissions: paid Sume calls
Codex 0.161.0 background tasks retain the permissions of the turn that started them. What that means for a Sume render started from a background task.
- Codex 0.161 defaults to GPT-6.1 Sol: recheck how it calls Sume tools
Codex 0.161.0 makes GPT-6.1 Sol the default model in bundled and Amazon Bedrock catalogs. Re-run a free Sume read and a dry run before trusting paid calls.
- dry_run or generation_admission_preview first for 12 Sume clips?
Use dry_run on a paid call for its estimate, and generation_admission_preview before a burst of 12 clips to check balance and queue room. Neither submits a job.
Written by Sume