Ralph Loop plugin: stop-hook.sh fails on Windows - cat command not found
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 8 comments · opened Jan 7, 2026 · closed Jan 16, 2026
Bug Description
The Ralph Loop plugin's stop-hook.sh fails on Windows with Git Bash because the cat command is not found in PATH when the hook executes.
Error Message
Stop hook error: Failed with non-blocking status code:
hooks/stop-hook.sh: line 10: cat: command not found
Root Cause
Line 10 of hooks/stop-hook.sh uses:
HOOK_INPUT=$(cat)
When Claude Code executes bash scripts on Windows, the PATH doesn't include Git Bash's /usr/bin directory where cat resides.
Suggested Fix
Use the full path to cat:
HOOK_INPUT=$("/usr/bin/cat")
Environment
- OS: Windows 10/11
- Shell: Git Bash
- Claude Code version: Latest
Workaround
Manually edit the cached hook script:
sed -i '10s/.*/HOOK_INPUT=$("\/usr\/bin\/cat")/' ~/.claude/plugins/cache/claude-plugins-official/ralph-loop/*/hooks/stop-hook.sh
8 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
👎
Related Windows issue: On Windows with PowerShell, the
.shhook opens in VS Code (or the default .sh file handler) instead of executing.Root cause: Windows doesn't know how to execute
.shfiles natively - it defers to file associations.Workaround: Edit the plugin's
hooks.jsonto explicitly invoke bash:This relies on
bashbeing in PATH (typically works if Git Bash is installed and added to PATH).After editing, clear the plugin cache (
.claude/plugins/cache/claude-plugins-official/ralph-loop/) and restart Claude Code.Suggested proper fix: The plugin itself should handle Windows compatibility - either by detecting the platform or by having Claude Code resolve
.shexecution automatically on Windows.Workaround
For those facing this issue: manually edit the
hooks.jsonfile in the plugin cache after installation.---
Details
On Windows, the stop hook fails to execute because the
hooks.jsonspecifies the shell script path directly without explicitly invokingbash:Windows does not recognize the
#!/bin/bashshebang and instead attempts to open the.shfile with a default application (such as File Explorer or a text editor) rather than executing it.---
Fix
Explicitly invoke
bashin the command:---
File Location
---
Full Corrected
hooks.jsonI submitted a comprehensive fix for this issue. PR Ready: https://github.com/anthropics/claude-plugins-official/pull/127 - Fixes PATH (including cat/jq not found), UTF-8 encoding, cygpath, output format, and race conditions. No manual hooks.json editing needed. Tested on Windows 11. See #16377 for details.
The "cat command not found" issue is caused by missing PATH in Git Bash subprocess.
Fix: Add this at the beginning of your hook scripts:
This also fixes
jq,rm, and other command not found errors.Full solution with all Windows 11 fixes: #9758
Related: #16377 #17257 #14817
Working Solution for Windows
Found a working fix for this issue. The problem is that Claude Code on Windows doesn't execute
.shfiles through bash - it tries to run them directly, which fails silently.Root Cause Analysis
\r\n) line endings which break bash scripts (bash interprets\ras part of the command).shfiles through bash on Windows/usr/binisn't in PATH, so commands likecat,sed,grepfailSolution: .cmd Wrapper
Create a
stop-hook.cmdfile alongside the.shfile:Then update
hooks.jsonto use the.cmdfile:Additional Fixes Applied to .sh File
``
bash
``sed -i 's/\r$//' stop-hook.sh
``
bash
``export PATH="/usr/bin:/bin:$PATH"
Suggested Plugin Update
The ralph-loop plugin should ship with both
.shand.cmdfiles for cross-platform compatibility. Thehooks.jsoncould either:.cmdon Windows (auto-detected)This solution has been tested and confirmed working on Windows 10/11 with Git Bash.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.