diff --git a/src/pages/guides/claude-code.astro b/src/pages/guides/claude-code.astro index a80c1de..1521aa1 100644 --- a/src/pages/guides/claude-code.astro +++ b/src/pages/guides/claude-code.astro @@ -45,19 +45,19 @@ const precall = SETS.find((one) => one.id === 'precall'); "hooks": { "PreToolUse": [ { - "matcher": "Bash|PowerShell|Edit|Write|WebFetch", + "matcher": "Bash|PowerShell|Monitor|Edit|Write|NotebookEdit|WebFetch", "hooks": [{ "type": "command", "command": "agent-chaperone hook pre" }] } ], "PostToolUse": [ { - "matcher": "Bash|PowerShell|Read|WebFetch", + "matcher": "Bash|PowerShell|Read|Grep|WebFetch", "hooks": [{ "type": "command", "command": "agent-chaperone hook post" }] } ], "PostToolUseFailure": [ { - "matcher": "Bash|PowerShell|Read|WebFetch", + "matcher": "Bash|PowerShell|Read|Grep|WebFetch", "hooks": [{ "type": "command", "command": "agent-chaperone hook post" }] } ] @@ -79,6 +79,15 @@ const precall = SETS.find((one) => one.id === 'precall'); in the post list but not the pre list, because the risk in reading a file is what the file says, not that it was read.

+

+ Three more are there for reasons that are easy to miss. Monitor runs a command in + the background under the same permission rules as Bash, so it is screened before + it runs. NotebookEdit writes a notebook cell, which is code that runs later, and + a cell like !rm -rf ~ is a shell command. Grep returns matching + lines from files, so it sits in the post list beside Read. A matcher made only of + names and | matches each name exactly, so Edit does not cover{' '} + NotebookEdit, and each tool has to be named. +

diff --git a/src/pages/guides/ecc.astro b/src/pages/guides/ecc.astro index 0609116..643dcb1 100644 --- a/src/pages/guides/ecc.astro +++ b/src/pages/guides/ecc.astro @@ -81,8 +81,9 @@ const AGENTSHIELD = 'https://www.npmjs.com/package/ecc-agentshield'; /plugin install agent-chaperone@agent-chaperone`}

That registers three hooks: one before shell commands, file edits and web fetches, and two - after shell commands, file reads and web fetches, including ones that failed. It brings the - agent-chaperone skill as well, which tells the agent what to do when a call is held. + after shell commands, file reads and searches, and web fetches, including ones that failed. It + brings the agent-chaperone skill as well, which tells the agent what to do when a call is + held.

If agent-chaperone is installed globally the plugin uses that. Otherwise the