From 9c0d31c55cfdcf8282d821faba110e8ab2dc18cf Mon Sep 17 00:00:00 2001 From: sepehr-safari Date: Wed, 23 Sep 2026 14:07:49 +0300 Subject: [PATCH] fix: name Monitor, NotebookEdit and Grep in the Claude Code hook configuration The tool repository now screens NotebookEdit and Monitor before they run and Grep after, and this guide carries a copy of that configuration. Monitor runs a command under the same rules as Bash, a notebook cell is code that runs later, and Grep returns lines from files, and a matcher of plain names is exact, so none of them was covered by the names already there. The ECC guide's summary of what the plugin registers says searches as well as reads, for the same reason. --- src/pages/guides/claude-code.astro | 15 ++++++++++++--- src/pages/guides/ecc.astro | 5 +++-- 2 files changed, 15 insertions(+), 5 deletions(-) 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