Skip to content

[Ralph Wiggum Plugin] Windows 11 Compatibility Fixes for Stop Hook #16377

@oinani0721

Description

@oinani0721

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions