Claude Code Fixes Prompt and Agent Hooks That Failed to Block Actions
Claude Code 2.1.294 fixes a gap where prompt and agent hooks written as instructions, such as "Block commands that...", could allow the very actions they were meant to block. The release also changes how Stop and SubagentStop prompt hooks written as instructions, such as "Carry on if the build is broken", are judged. Claude is now less likely to stop early.
Key Takeaways
- Instruction-style hooks could allow what they should block, a gap in a guardrail that users set up themselves.
- The fix covers both
promptandagenthooks written as instructions such as "Block commands that...". - Stop and SubagentStop
prompthooks are now judged better, so Claude is less likely to stop early. - A hook like "Carry on if the build is broken" now works as intended, keeping unfinished work going.
- The hooks were meant as guardrails, so a failure to block is a permission-boundary issue rather than cosmetic.
- Updating to 2.1.294 is the remedy, and hooks phrased as instructions should be re-tested afterward.
Hooks Written as Instructions Now Block Reliably
Claude Code lets users attach prompt and agent hooks, where a model judges whether a tool call should proceed. Many users write these hooks as plain instructions, for example "Block commands that delete files outside the project". Claude Code 2.1.294 fixes a bug where hooks phrased this way could allow what they were supposed to block. The hook's text read as an instruction rather than a yes-or-no question, and the judgment could come out inverted. Because these hooks act as a guardrail, the fix matters for anyone who relies on them to keep Claude within limits they set.
Better Judgment on Stop Hooks
The same release improves how prompt hooks on Stop and SubagentStop are judged when they are written as instructions. An example is "Carry on if the build is broken". Previously, an instruction like this could be misread, which let Claude stop while work was still unfinished. After the change, Claude is less likely to stop early when such a hook says it should keep going.
What to Check
Users who wrote instruction-style prompt or agent hooks should update to 2.1.294. The earlier behavior could have let actions through that the hook was meant to stop.