Repository navigation
Run a handler once when a monitor call selects it as Monitor and as Bash - #450
Merged
Merged
Conversation
A monitor call runs the PreToolUse groups that meet Monitor and, as a Bash call, the groups that meet Bash only. Handlers were deduplicated within each pass, so a command declared under "Bash|Monitor" (or "*") and again under "Bash" ran twice on one monitor call, once with each payload. Claude Code 2.1.325 runs it once, with the Monitor payload. A handler both passes select now runs once, as the Monitor call. The Bash-pass copy runs instead where it comes from a higher-precedence settings source, so a project's async copy under "*" does not replace a managed blocking guard under "Bash".
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



A monitor call runs the PreToolUse groups whose matcher meets Monitor and, as a Bash call, the groups whose matcher meets Bash only. Handlers were deduplicated within each of the two passes, not across them.
PreToolUse hook runs for one monitor call, with
auditdeclared underBash|Monitorand again underBash:auditoncePerCallinextensions/hooks/decisions.tsdrops from the Bash pass a handler the Monitor pass already selected.Where the Bash-pass copy has the higher
sourceRank, it runs and the Monitor-pass copy is dropped, so a lower-precedenceasynccopy under*does not replace a managed or--settingsblocking guard underBash.handlerKeyinextensions/hooks/matcher.tsis the dedup keykeepOncealready used, now shared.npm run checkpasses (Biome, strict tsc, Vitest)Tests cover the change