[Ralph Wiggum Plugin] Windows 11 Compatibility Fixes for Stop Hook
a## Summary
The Ralph Wiggum plugin stop hook does not work on Windows 11 due to multiple compatibility issues. This issue documents the problems found and provides complete fixes.
Environment
- OS: Windows 11
-
- Terminal: Windows Terminal + PowerShell
-
-
- Git Bash: C:\Program Files\Git\usr\bin\bash.exe
-
Issues Found and Fixes
Issue 1: WSL bash Path Resolution
Symptom: WSL ERROR: execvpe(/bin/bash) failed: No such file or directory
Root Cause: On Windows, the bash command resolves to WSL bash, but WSL may not be configured.
Fix in hooks.json: Use Git Bash full path
"command": "\"C:\\Program Files\\Git\\usr\\bin\\bash.exe\" ${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh"
Issue 2: PATH Not Complete
Symptom: cat: command not found, jq: command not found
Root Cause: Git Bash subprocess PATH doesn't include /usr/bin.
Fix: Add at beginning of stop-hook.sh:
export PATH="/usr/bin:/bin:/mingw64/bin:$PATH"
Issue 3: Non-ASCII Path Encoding (Chinese, Japanese, etc.)
Symptom: Path with Unicode characters becomes garbled
Fix: Add UTF-8 locale and use cygpath:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
CWD=$(cygpath -u "$CWD" 2>/dev/null || echo "$CWD" | sed 's/\\/\//g')
Issue 4: Incorrect Output Format
Symptom: Stop hook doesn't trigger iteration continuation
Fix: Output to stderr and exit 2:
jq -n ... >&2
exit 2
Issue 5: Multiple Hooks Race Condition
Symptom: rm: No such file or directory
Fix: Use rm -f instead of rm
Test Results
After all fixes applied:
- Iteration 1 -> 2 -> 3 -> Normal exit SUCCESS
-
- W## Summary The Ralph Wiggum plugin stop hook does not work on Windows 11 due to multiple compatibility issues. This issue documents the problems found and provides complete fixes.
Environment
- OS: Windows 11
-
- Terminal: Windows Terminal + PowerShell
-
-
- Git Bash: C:\Program Files\Git\usr\bin\bash.exe
-
Issues Found and Fixes
Issue 1: WSL bash Path Resolution
Symptom: WSL ERROR: execvpe(/bin/bash) failed: No such file or directory
Root Cause: On Windows, the bash command resolves to WSL bash, but WSL may not be configured.
Fix in hooks.json: Us
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/14817
- https://github.com/anthropics/claude-code/issues/16116
- https://github.com/anthropics/claude-code/issues/15128
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and ๐ the existing issue instead
- To prevent auto-closure, add a comment or ๐ this comment
๐ค Generated with Claude Code
This is not a duplicate of the referenced issues.
Key differences:
-
Complete solution provided - This issue includes a fully tested fix with PR #127 ready for merge
-
Covers 5 distinct issues comprehensively:
- PATH fix for Git Bash subprocess environment
- UTF-8 encoding for non-ASCII paths (Chinese characters)
- Absolute path handling via cwd extraction
- cygpath normalization for Windows paths
- rm -f to avoid race condition errors
-
The referenced issues only report problems, while this issue provides the actual working fix
The fix has been tested successfully on Windows 11 with Git Bash, including non-ASCII (Chinese) paths.
Please keep this issue open as it serves as the documentation for the comprehensive Windows 11 compatibility fix.
โ Solution Verified Working
I've tested the complete fix and confirmed all issues are resolved:
Test Results (2026-01-15)
/ralph-loop "็ฎๅๆต่ฏไปปๅก" --max-iterations 2
Output:
- โ Iteration 1/2 executed successfully
- โ
Stop hook returned
{"decision": "block"}correctly - โ Iteration 2/2 continued and completed
- โ State file cleaned up properly
- โ No script content displayed
Additional Discovery
Found that plugin cache versions override inline hooks!
Even with a fixed local hook, outdated versions in these locations still execute:
-
~/.claude/plugins/cache/claude-plugins-official/ralph-wiggum/ -
~/.claude/plugins/marketplaces/*/plugins/ralph-wiggum/
Solution: Delete all plugin cache directories to use only the fixed inline hook.
Summary of All Fixes Applied
- โ
PATH export:
export PATH="/usr/bin:/bin:/mingw64/bin:$PATH" - โ
UTF-8:
export LC_ALL=en_US.UTF-8 - โ cygpath: Windows path conversion
- โ
Exit code:
exit 2for continuation - โ Absolute paths in settings.local.json
- โ Deleted plugin cache directories
- โ CLAUDE_CODE_GIT_BASH_PATH environment variable
The PR #127 to claude-code-plugins contains all these fixes. Awaiting merge.
I've also posted a comprehensive guide in #9758 for broader visibility.