[BUG] Windows hook paths incorrectly converted to Unix-style, causing "No such file or directory" errors
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?
When Claude Code executes stop hooks (and also startup hooks, prompt hooks, etc) on Windows, it's incorrectly converting Windows file paths to Unix-style paths, causing the hook to fail even though the file exists.
Expected Behavior:
Stop hook should execute successfully at the Windows path.
Actual Behavior:
Hook fails with error:
Stop hook error: Failed with non-blocking status code: /bin/bash:
/c/Users/.claude/plugins/cache/1.0/hooks/stop-hook.sh: No such file or directory
The file exists at the correct location: C:\Users\.claude\plugins\cache\1.0\hooks\stop-hook.sh
Root Cause:
The hook execution system is converting the Windows absolute path C:\Users\... to /c/Users/... before executing with bash, but the actual file path on disk is the Windows path. This conversion is incorrect or incomplete.
What Should Happen?
Should know to use correct WIndows path for hooks.
Error Messages/Logs
Hook fails with error:
Stop hook error: Failed with non-blocking status code: /bin/bash:
/c/Users/.claude/plugins/cache/1.0/hooks/stop-hook.sh: No such file or directory
Steps to Reproduce
Steps to Reproduce:
- On Windows, install a plugin that includes stop hooks
- Run Claude Code
- End the session (trigger the Stop hook event)
- Observe the hook error
Environment:
- OS: Windows (win32)
- Claude Code: Latest
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.11
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗