# Hook Timeout

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

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** timeout

## Think of it like

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

## 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

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

## Example code

```json
{
  "type": "command",
  "command": "./slow-check.sh",
  "timeout": 120
}
```

Stop the check after two minutes.

## Why it matters

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

## Common mistake

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

## Three principles

- **In seconds.** Per hook.
- **Defaults differ.** 600, 30, 60.
- **Lower on prompts.** 30 seconds.

## Related terms

- [SessionEnd Hook](https://learn.benibix.com/term/ai/sessionend-hook)
- [UserPromptSubmit Hook](https://learn.benibix.com/term/ai/userpromptsubmit-hook)
- [Async Hook](https://learn.benibix.com/term/ai/async-hook)

![The five hook types, what each one runs, and its default timeout.](https://learn.benibix.com/diagrams/hook-handler-types.svg)

---

Source: https://learn.benibix.com/term/ai/hook-timeout
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
