[BUG] `/ralph-wiggum:ralph-loop` has a problem with newline characters.
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 I use the /ralph-wiggum:ralph-loop command from the Claude Code plugin marketplace, my input is always judged as Command contains newlines that could separate multiple commands.
It seems that normal input in the Claude Code input box has issues — it gets automatically wrapped onto a new line 🤔.
What Should Happen?
Proceed correctly according to the plan.
Error Messages/Logs
Error: Bash command permission check failed for pattern "!
"/home/joker/.claude/plugins/marketplaces/claude-code-plugins/plugins/ralph-wiggum/scripts/setup-ralph-loop.sh" "Build a MacOS-style
frontend project that can open and run normally. Use liquid glass material effect, you can refer to
@液态玻璃效果技术原理深度分析报告.md , think deeply, allow using various MCPs" --completion-promise Done --max-iterations 5
# Extract and display completion promise if set
if [ -f .claude/ralph-loop.local.md ]; then
PROMISE=$(grep '^completion_promise:' .claude/ralph-loop.local.md | sed 's/completion_promise: *//' | sed 's/^"\(.*\)"$/\1/')
if [ -n "$PROMISE" ] && [ "$PROMISE" != "null" ]; then
echo ""
echo "═══════════════════════════════════════════════════════════"
echo "CRITICAL - Ralph Loop Completion Promise"
echo "═══════════════════════════════════════════════════════════"
echo ""
echo "To complete this loop, output this EXACT text:"
echo " <promise>$PROMISE</promise>"
echo ""
echo "STRICT REQUIREMENTS (DO NOT VIOLATE):"
echo " ✓ Use <promise> XML tags EXACTLY as shown above"
echo " ✓ The statement MUST be completely and unequivocally TRUE"
echo " ✓ Do NOT output false statements to exit the loop"
echo " ✓ Do NOT lie even if you think you should exit"
echo ""
echo "IMPORTANT - Do not circumvent the loop:"
echo " Even if you believe you're stuck, the task is impossible,"
echo " or you've been running too long - you MUST NOT output a"
echo " false promise statement. The loop is designed to continue"
echo " until the promise is GENUINELY TRUE. Trust the process."
echo ""
echo " If the loop should stop, the promise statement will become"
echo " true naturally. Do not force it by lying."
echo "═══════════════════════════════════════════════════════════"
fi
fi
": Command contains newlines that could separate multiple commands
Steps to Reproduce
Run 2.0.50 (Claude Code) in Windows Terminal on Win 11 and enter /ralph-wiggum:ralph-loop "Build a MacOS-style frontend project that can open and run normally. Use liquid glass material effect, you can refer to @液态玻璃效果技术原理深度分析报告.md , think deeply, allow using various MCPs" --completion-promise Done --max-iterations 5
Claude Model
Other
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.50 (Claude Code)
Platform
Other
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
36 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The issue they mentioned is not the same as the one I'm referring to.
Yes, the issue they mentioned is different. By the way, I can reproduce the issue too 😕
I can also reproduce same in Claude Code on Mac.
me too on macos, is there any workaround?
I asked Claude to update the plugin based on https://github.com/anthropics/claude-code/pull/12642 and it works @frees11 @mqofori for information
I can also reproduce the issue.
I can also reproduce the issue.
can also reproduce same in Claude Code w11
can also reproduce this issue
can also reproduce this issue
in frustration, I forked it: https://github.com/jes5199/chief-wiggum
Has anyone found a solution to this? I tried some workarounds but none of them worked :(
Can reproduce on Linux
Environment:
Affected commands:
/ralph-wiggum:ralph-loop/ralph-wiggum:cancel-ralph← also affected, same root causeError message for
/cancel-ralph:Root cause analysis:
The Skill tool is passing the raw markdown block (including the
`!code fence markers) directly to the Bash permission checker, instead of:`!syntax as an executable blockWorkaround:
Manually run
rm -f .claude/ralph-loop.local.mdto cancel the loop.@dhollman @dicksontsai (as the original author/reviewer) could you take a look/approve the fix? this bug is blocking a lot of folks from using the stop hook.
Same issue here. Even when the prompt is inlined, it seems like a new line is still added that triggers this error.
The only way I have been able to run this is by doing:
"/path/to/setup-ralph-loop.sh" "<task description>" --max-iterations <number> --completion-promise "<promise text>"Can reproduce this issue too. A workaround is to use the bypassPermissions. It's not ideal.
I can also reproduce the issue. on macos tahoe 26.1, apple m5 chips
Same issue on Archlinux
Same here, OSX Sequoia 15.6.1, Claude Code 2.0.76 running in zsh.
Alternative Fix: No Bash Execution in Command Files
There's an open PR for this issue (#12642). Meanwhile, users keep filing duplicates:
I've published a working reimplementation with a different architectural approach:
github.com/dial481/ralph
Why PR #12642's Approach May Not Be Enough
The PR moves multi-line bash into
setup-ralph-loop.sh, but the command file still uses ````bash``` with instructions for Claude to execute it. This still involves bash execution from the command context.Alternative Approach: Zero Bash in Command Files
The command file is pure markdown instructions. Claude uses its Write tool to create the state file—no bash execution in the command at all:
The stop hook (which runs outside Claude's permission system) handles all the loop logic.
Result: No newlines, no
$(), no permission conflicts. Works with current Claude Code security restrictions.Tested On
The fix is to run claude with --dangerously-skip-permissions (claude --dangerously-skip-permissions) which means you should only run this in a sandbox or a separate VM.
Does not work for me.
I'm using arch + ghostty terminal.
Additional data point: Manual patching doesn't work
Environment: macOS (Darwin 25.1.0), Claude Code latest
I'm experiencing the same issue and attempted the workaround from PR #12642 / PR #114 by manually patching the local plugin files.
What I tried:
Patched all three local copies of
ralph-loop.mdto remove the multi-line bash (keeping only the single-line script call):~/.claude/plugins/cache/claude-plugins-official/ralph-wiggum/6d3752c000e2/commands/ralph-loop.md~/.claude/plugins/cache/claude-plugins-official/ralph-wiggum/unknown/commands/ralph-loop.md~/.claude/plugins/marketplaces/claude-plugins-official/plugins/ralph-wiggum/commands/ralph-loop.mdAlso updated the corresponding
setup-ralph-loop.shscripts to include the completion promise display logic.Result:
Still fails with the same error, even after:
Conclusion:
Claude Code appears to be loading the plugin content from somewhere other than these local files - possibly:
The patches are definitely on disk (verified with
cat), but Claude Code still shows the old multi-line content in the error message.Suggestion: The fix in PR #114 needs to be merged to the remote registry for local patches to be ineffective.
Please use the official plugin in https://github.com/anthropics/claude-plugins-official
I am getting the bug with the official plugin:
<img width="1509" height="384" alt="Image" src="https://github.com/user-attachments/assets/47260c83-16ba-4431-8e56-958eef1d404e" /> @amorriscode
@amorriscode still an issue. i just reinstalled the plugin and have the same error
His commit fixes the issue
But you can also
``
`---
!``"${CLAUDE_PLUGIN_ROOT}/scripts/setup-ralph-loop.sh" $ARGUMENTS
---
@jsanderssk I don't understand how his commit fixes the issue if it literally not working out of the box after the installation. Also, I can't find this directory:
{CLAUDE_PLUGIN_ROOT}/scripts/setup-ralph-loop.sh. Like, I don't have anyscriptsin my claude plugin directory. Am I missing anything?@sapoepsilon
The issue is the claude is sending the markdown
`and that is causing an issue. So instead we just remove them and claude just executes the script. You may still be prompted for permission. if you look search for the file ralph-loop.mdFind the one that matches the error and remove the troublesome block of code
@jsanderssk You are the MVP thanks, that did the trick. I opened up a PR: https://github.com/anthropics/claude-plugins-official/pull/134
For multi line, couldn't we just pass the entire file with all content as a base64 encoded string since Claude can decrypt it? Then bash wouldn't struggle with any weird formatting or new lines.
awesome feature but the dev experience is so terrible that I hope it gets fixeed soon
Just weighing in — I've installed the plugin via the /plugin command in Claude Code and I'm still getting that same error:
I deleted the cached versions of the plugins from my Mac and reinstalled but still the same result.
I was able to solve that problem in my PR, check it out: https://github.com/anthropics/claude-plugins-official/pull/134
@mishterk
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.