ralph-loop plugin stop-hook causes infinite loop when Windows username contains spaces
Resolved 💬 3 comments Opened Mar 12, 2026 by Guiquan-27 Closed Mar 16, 2026
Bug Description
The ralph-loop plugin's stop-hook.sh causes an infinite error loop when the Windows username contains spaces (e.g., Guiquan Wang). Every response from Claude triggers the hook, which fails, and the error feedback triggers another response, creating an unbreakable infinite loop.
Environment
- OS: Windows 11 Pro 10.0.26200
- Shell: Git Bash (via VSCode extension)
- Windows Username:
Guiquan Wang(contains a space) - HOME path:
/c/Users/Guiquan Wang/ - Plugin:
ralph-loop@claude-plugins-official
Error Message (repeating infinitely)
Stop hook feedback:
[${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh]: /c/Users/Guiquan: line 1: syntax error near unexpected token `('
/c/Users/Guiquan: line 1: `[F14C:C390][2025-07-04T23:18:52]i001: Burn v3.14.1.8722, Windows v10.0 (Build 26100: Service Pack 0), path: C:\WINDOWS\Temp\{386C9DBA-8BF0-4D12-A9BC-223877FDF90E}\.cr\VC_redist.x64.exe'
Root Cause Analysis
- The
${CLAUDE_PLUGIN_ROOT}variable resolves to a path containing a space (e.g.,/c/Users/Guiquan Wang/.claude/plugins/...). - When the plugin system invokes the hook, the path is not properly quoted, causing bash to split it at the space.
- Bash then tries to execute
/c/Users/Guiquanas a script (the first half of the split path), which is not a valid script. - A VC++ Redistributable installer log (or other system output) appears to be fed into stdin, further confusing the shell.
- The hook error is treated as user feedback, triggering another Claude response, which triggers the hook again — creating an infinite loop that cannot be broken from within the session.
Impact
- Severity: High — the session becomes completely unusable
- The loop cannot be stopped from within Claude Code. The user must manually close the terminal/VSCode window.
- Even replacing
stop-hook.shcontent withexit 0and clearinghooks.jsondid not help during the active session, because the hook path was already cached in memory with the unquoted path. - The fix only took effect after restarting the session.
Steps to Reproduce
- Use Windows with a username that contains a space (e.g.,
Guiquan Wang) - Install and enable the
ralph-loopplugin - Start a Claude Code session (VSCode extension)
- Send any message and wait for a response
- Observe the infinite stop-hook error loop
Expected Behavior
The hook path should be properly quoted to handle spaces in file paths on Windows.
Suggested Fix
In the plugin system's hook invocation code, ensure the resolved ${CLAUDE_PLUGIN_ROOT} path is properly quoted when passed to bash, e.g.:
# Instead of:
bash ${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh
# Use:
bash "${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh"
Workaround
- Disable
ralph-loopinsettings.jsonby setting"ralph-loop@claude-plugins-official": false(or removing it) - Replace all
stop-hook.shfiles with#!/bin/bash\nexit 0 - Clear
hooks.jsonregistration:{"description":"disabled","hooks":{}} - Restart the Claude Code session (changes don't take effect in the current session)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗