Hooks reference changedhooks
Nearest release: v2.1.261, published 10 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+1added
Lines−1removed
From line
2,746
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits129to this page, all time
The whole hunk
from line 2746, 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 2746
27462746
27472747* You pass a directory with the `--add-dir` startup flag; [SessionStart](#sessionstart) covers those directories
27482748* You add a directory on the `/permissions` Workspace tab
2749* You add a directory that is already a working directory; the add fails with an error
2749* You add a directory that is already a working directory or inside one
27502750
27512751Claude Code fires DirectoryAdded after refreshing sandbox and permission state, so sandboxed tools already see the new directory when your hook runs. Hook commands themselves run unsandboxed.
27522752
from line 2813
28132813}
28142814```
28152815
2816The hook reads the changed file's absolute path from the `file_path` field of the [JSON input](#filechanged-input) on stdin. Its `grep` guard tests for the same thing `perl` remo
2816The hook reads the changed file's absolute path from the `file_path` field of the [JSON input](#filechanged-input) on stdin. Its `grep` guard tests for the same thing `perl` removes, a CR at th
No line in this hunk matches that.