Follow Discord
Sweep 08 Oct 2026 · 18:53Z Build v2.1.295 516 read Stable v2.1.286 Latest v2.1.295 Next v2.1.295 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

React to events with a mod changedplugins/mods/events

Nearest release: v2.1.295, published 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 8 Oct 2026 19:43 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 8 Oct 2026 20:07 UTC.

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

The whole hunk

from line 316, old and new numbered
/
lines
from line 316
316316on('tool.call', { tool: 'Bash' }, guard).catch(async ($, e, next) => {
317317 // guard had already called next, so return what came back
318318 if (next.called) return next(e)
319 // next.error.kind is 'throw' or 'timeout', which says how guard failed
319 // next.error.kind says why the handler was asked, such as 'throw' or 'timeout'
320320 return { deny: 'The command guard failed, so this command was not run: ' + next.error.kind }
321321})
322322```
323323 
324While `guard` works, the handler never runs. When `guard` throws or times out on a Bash call, Claude Code calls the handler with the same event:
324When `guard` throws or times out on a Bash call, Claude Code calls the handler with the same event:
325325 
326* **`guard` failed before it called `next`**: the command doesn't run, and Claude reads the `deny` text with `throw` or `timeout` at the end
326* **`guard` failed before it called `next`**: the command doesn't run, and Claude reads the `deny` text with the kind at the end
327327* **`guard` failed after it called `next`**: the handler's `next(e)` resolves to the result that `guard`'s call produced without running the command again, and Claude reads that result
328328 
329329The handler has a shorter [time limit](/docs/en/plugins/mods/reference#limits) of its own. If the handler itself throws or times out, Claude Code skips the hook as if it had no handler. When `guard` hadn't called `next`, the command then goes on as it would without the mod.
Feedback