Hooks reference changedhooks
Nearest release: v2.1.335, published 8 hours 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 3 Dec 2026 05:54 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 3 Dec 2026 06:07 UTC.
Upstream edited
Recorded here
Lines+1added
Lines−1removed
From line
426
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits177to this page, all time
The whole hunk
from line 426, old and new numbered
/
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 426
426426
427427The `if` field holds exactly one permission rule. There is no `&&`, `||`, or list syntax for combining rules; to apply multiple conditions, define a separate hook handler for each.
428428
429In an `if` condition for a file tool, a single-segment directory pattern like `"Edit(src/**)"` matches only the `src` directory in the working directory and the files under it. To match a directory named `src` at any depth, write `"Edit(**/src/**)"`.
429In an `if` condition for a file tool, a `dir/**` pattern such as `"Edit(src/**)"` matches only the `src` directory in the working directory and the files under it. To match a directory named `src` at any depth, write `"Edit(**/src/**)"`.
430430
431431#### How `if` patterns match Bash commands
432432
from line 3663
36633663
36643664#### PreModelSwitch decision control
36653665
3666`PreModelSwitch` hooks can cancel the switch, ask the user to confirm it, or let it proceed.
3666`PreModelSwitch` hooks can cancel the switch, ask the user to confirm it, or let it proceed. Exit code 2 o
No line in this hunk matches that.