{"version":"2.1.309","anchor":"powershell-hooks-propagate-exit-code-2","canonical_anchor":"powershell-hooks-propagate-exit-code-2","heading":"PowerShell hooks can now block an action with exit code 2","tier":"notice","area":"Hooks","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.309\/e\/powershell-hooks-propagate-exit-code-2","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.309","markdown":"### PowerShell hooks can now block an action with exit code 2\n\nA PowerShell hook that ends with exit code 2 now blocks the action, the same as a bash hook\n\n**What**\n\nA hook is a command you configure to run at certain points, and ending it with exit code 2 tells Claude Code to block the action. For hooks run in PowerShell, Claude Code now adds a short line to the end of the command that passes exit code 2 through. Before, the command ran unchanged and an exit code 2 did not block.\n\nThis is not added to `PermissionRequest` hooks, or to some commands that pass an extra check.\n\n**Why**\n\nBlocking hooks now behave the same on Windows PowerShell as in bash.\n\n- Area: Hooks\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: yes"}