[BUG] Some hooks stopped working in version 2.1.47 on Windows

Resolved 💬 5 comments Opened Feb 26, 2026 by TedF-Analyst Closed Mar 31, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Hooks stopped working on Windows after upgrading from v2.1.45 to v2.1.47. The hooks are registered correctly in settings.json but are not being executed when triggered by Claude Code.

Affected Hook Types:

  • Notification
  • Stop
  • PermissionRequest

Root Cause:
The patch note "Fixed hooks (PreToolUse, PostToolUse) silently failing to execute on Windows by using Git Bash instead of cmd.exe (#25981)" appears to have changed how ALL hooks execute on Windows, not just PreToolUse and PostToolUse. This breaks hooks that were working fine in 2.1.45.

Workaround:
Downgrade to v2.1.45 where hooks work correctly.

What Should Happen?

Expected Behavior:
Hooks should execute as they did in v2.1.45, regardless of whether they use cmd.exe, PowerShell, or bash scripts.

Error Messages/Logs

Steps to Reproduce

Register hooks in ~/.claude/settings.json with PowerShell scripts:

{
"hooks": {
"PermissionRequest": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "powershell.exe -ExecutionPolicy Bypass -File C:\\Users\\username\\.claude\\hooks\\permission-notify.ps1"
}
]
}
]
}
}

Trigger a permission request in Claude Code
Expected: PowerShell script executes and plays notification sound
Actual: Script does not execute (no lock file created, no sound played)

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.45

Claude Code Version

2.1.59

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗