Unclear Whether scripts with these blocks now get the added exit code check or now skip it is not clear.
Hooks are commands you set up for Claude Code to run at certain moments. A hook reports back through its exit code, the number a program returns when it finishes, and exit code 2 has a special meaning. For hooks written in PowerShell, Claude Code can add a short line to the end of the script so that, when the last command failed with code 2, the hook also exits with code 2.
The rule for when that line is added has changed. It now depends on whether the script contains begin, process, end, clean or dynamicparam blocks. The rule for PermissionRequest hooks is unchanged.
PowerShell scripts that use these block keywords now have their exit codes handled differently. If you have such a hook, check that it still reports exit code 2 the way you expect.
Whether scripts with these blocks now get the added exit code check or now skip it is not clear.