Follow Discord
Sweep 24 Nov 2026 · 22:58Z Build v2.1.332 549 read Stable v2.1.326 Latest v2.1.332 Next v2.1.332 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Hooks reference changedhooks

Nearest release: v2.1.331, published under an hour before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Upstream edited this page at 23 Nov 2026 18:50 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 23 Nov 2026 19:02 UTC.

Upstream edited
Recorded here
Lines+4added
Lines−4removed
From line 1,030 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits161to this page, all time

The whole hunk

from line 1030, old and new numbered
/
lines

This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.

from line 1030
10301030| Hook event | Can block? | What happens on exit 2 |
10311031| :- | :- | :- |
10321032| `PreToolUse` | Yes | Blocks the tool call |
1033| `PermissionRequest` | No | Exit code 2 isn't honored for this event and the permission flow proceeds unchanged. Deny through the [`decision` object](#permissionrequest-decision-control) instead |
1033| `PermissionRequest` | No | Not read as a decision. Deny through the [`decision` object](#permissionrequest-decision-control) instead |
10341034| `UserPromptSubmit` | Yes | Blocks the prompt. See [What a blocked prompt leaves behind](#what-a-blocked-prompt-leaves-behind) |
10351035| `UserPromptExpansion` | Yes | Blocks the expansion |
10361036| `Stop` | Yes | Prevents Claude from stopping, continues the conversation |
from line 1440
14401440 
14411441### Setup
14421442 
1443Fires only when you launch Claude Code with `--init-only`, or with `--init` or `--maintenance` in [non-interactive mode](https://code.claude.com/docs/en/headless.md) with the `-p` flag. It doesn't fire on normal startup. Use it for one-time dependency installation or scheduled cleanup that you trigger explicitly from CI or scripts, separate from normal session startup. For per-session initialization, use [SessionStart](#sessionstart) instead.
1443Fires only when you launch Claude Code with `--init-only`, or with `--init` or `--maintenance` in [non-interactive mode](https://code.claude.com/docs/en/headless.md) with the `-p` flag. Use it for one-time dependency installation or scheduled cleanup that you trigger explicitly from CI or scripts. For per-session initialization, use [SessionStart](#sessionstart) instead.
14441444 
14451445The matcher value corresponds to the CLI flag that triggered the hook:
14461446 
from line 2212
22122212 
22132213To allow or rewrite a Monitor command, see [Match Monitor commands](#match-monitor-commands).
22142214 
2215A hook that exits 2 without a `decision` object leaves the permission flow unchanged, and its stderr is discarded. To grant or deny the request, return the `decision` object.
2215Claude Code doesn't read exit code 2 as a decision on this event. To grant or deny the request, return the `decision` object.
22162216 
22172217```json theme={null}
22182218{
from line 3707
37073707 
37083708SessionEnd hooks have a default timeout of 1.5 seconds. It applies when you exit, run `/clear`, or switch sessions with interactive `/resume`. You can give a hook more time in two ways:
37093709 
3710* **Per-hook `timeout`**: set `timeout` in that hook's configuration. The overall budget rises automatically to match the highest per-ho
3710* **Per-hook `timeout`**: set `timeout` in that hook's configuration. The overall budget rises automatically to match the highest per-hook `timeout` in your settings files, up to 60 seconds. If you raise the budget this way, a hook without its own `timeout` still keeps the default. Timeouts set on plugin-provided hook
Feedback