[BUG] Windows: Shell hooks (.sh files) no longer execute correctly, prompt file association dialog instead
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?
---
Title: Windows: Shell hooks (.sh files) no longer execute correctly, prompt file association dialog instead
Labels: bug, windows
---
Describe the bug
After a recent Claude Code update, shell hook scripts (.sh files) from plugins are no longer being executed via bash on Windows. Instead, Windows prompts to choose how to open the file or launches it incorrectly.
This was working correctly for several weeks prior to the update.
To reproduce
- Install Claude Code on Windows
- Install the superpowers plugin which has SessionStart hooks as .sh files
- Start a session or trigger a skill
- Observe that Windows tries to "open" the .sh file instead of executing it via bash
Expected behavior
Hook scripts should execute via bash (Git Bash or similar) as they did previously, not trigger Windows file association prompts.
Environment
- OS: Windows 10/11
- Claude Code version: (latest)
- Plugin: superpowers (but likely affects any plugin using .sh hooks)
- Bash available: Yes (Git Bash installed, was working before)
Additional context
The hook script itself is valid bash - the issue is how Claude Code invokes it on Windows. Previous versions handled this correctly.
Example hook that fails to execute:
#!/usr/bin/env bash
# SessionStart hook for superpowers plugin
set -euo pipefail
# ... rest of script
What Should Happen?
- Claude Code should detect that .sh hook files need to be executed via a bash interpreter on Windows
- On Windows systems with Git Bash installed, hooks should be invoked using the Git Bash executable (e.g., "C:\Program Files\Git\bin\bash.exe" -c script.sh) rather than relying on file associations
- The hook script should execute silently in the background and return its JSON output to Claude Code
- The superpowers skill context should load into the conversation without any Windows dialogs appearing
- This should work the same way it did in previous versions (approximately 2-3 weeks ago)
Error Messages/Logs
Steps to Reproduce
- Install Claude Code on Windows
- Install the superpowers plugin which has SessionStart hooks as .sh files
- Start a session or trigger a skill
- Observe that Windows tries to "open" the .sh file instead of executing it via bash
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
1.31/1.32
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Cursor
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗