Skip to content

Claude Code

In Claude Code, a “block” hook could let commands through

2 min read

Written by an AI model from the linked sources and checked against them by a second model. How we work

All about: Claude Code versions and changes →

Some Claude Code prompt and agent hooks were letting through the very actions they existed to stop. Version 2.1.294 fixes this, according to the release notes on GitHub dated October 8. The failure hit hooks written as instructions, the notes say, with “Block commands that...” as the example. So a guard written the most natural way, as a plain order, could approve exactly the commands it named.

The second change covers prompt hooks on Stop and SubagentStop that are written as instructions, such as “Carry on if the build is broken”. The release changes how those hooks are judged, so Claude is less likely to stop early. A Stop hook runs when Claude finishes a turn and can refuse to let the turn end. When it blocks, Claude is told to keep working and gets the hook’s reason as its instruction, as Amit Kothari describes it. Kothari also points to a stop_hook_active flag that prevents infinite loops. Without a check on that flag, he says, a stop gate can stay shut forever. A misjudged “carry on” hook failed in the opposite direction: it let Claude quit while the build was still broken.

The fix arrived two releases after a security fix for PreToolUse hook approvals in 2.1.292. More hook changes followed. Releases 2.1.299, 2.1.300 and 2.1.301 came out on October 14 and 15 with seven “Changed” lines that alter how existing hooks behave, a DEV Community write-up counted. The same write-up traces one of the fixes it covers back to 2.1.294.

On October 16, the Claude Code changelog added another limit: at most 12 prompt or agent hooks of one event now run at a time, and the rest wait their turn.

No comments yet. Be the first.

Join the conversation

Sign in to leave a comment. It appears after moderation.