Follow Discord
Sweep 30 Oct 2026 · 21:36Z Build v2.1.315 533 read Stable v2.1.308 Latest v2.1.314 Next v2.1.315 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.315 ·

PowerShell hooks using script blocks get different exit code handling

Whether Claude Code adds its exit code 2 check to a PowerShell hook now depends on whether the script uses begin, process, end, clean or dynamicparam blocks

You'll notice Improvements
JSON All of v2.1.315
You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
1Signal: worth watching, 1 to 5
ElsewhereArea: what it touches
ImprovementsKind: in v2.1.315,
ImprovementsSection of the release

Unclear Whether scripts with these blocks now get the added exit code check or now skip it is not clear.

What

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.

Why

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.

How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtWhether scripts with these blocks now get the added exit code check or now skip it is not clear.

See this entry in the whole of v2.1.315 →

Feedback