Skip to content
BENIBIX Learn

Hook Timeout

AI⌨️ Claude CodeConfiguration

Also known as timeout

How many seconds a hook may run before Claude Code stops it.

Think of it like

It is like an egg timer. When it rings, the job stops.

Example

Emma's lint check sometimes hangs. She sets a timeout of 120 seconds, so a stuck run cannot hold Claude for ten minutes.

Why it matters

A stuck hook stalls the whole session until its timeout ends.

Definition

A hook timeout is the timeout field, in seconds, after which Claude Code cancels a hook. The defaults are 600 seconds for command, HTTP and MCP tool hooks, 30 for prompt hooks and 60 for agent hooks. On UserPromptSubmit the first three drop to 30, since every prompt waits. SessionEnd hooks get 1.5 seconds unless you raise it.

Example code

json
{
  "type": "command",
  "command": "./slow-check.sh",
  "timeout": 120
}
Stop the check after two minutes.
Each type has its own default timeout.

Common mistake

Counting on a stuck guard to block. A hook that times out on PreToolUse lets the call go on.

Key takeaways

  1. 1
    In seconds. Per hook.
  2. 2
    Defaults differ. 600, 30, 60.
  3. 3
    Lower on prompts. 30 seconds.