[BUG] ralph-wiggum plugin: /ralph-loop slash command fails with "Command contains newlines" error

Resolved 💬 3 comments Opened Jan 12, 2026 by Reederey87 Closed Feb 27, 2026

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?

Description

The /ralph-wiggum:ralph-loop slash command fails to execute due to Claude Code's bash command security validation rejecting multi-line commands embedded in the plugin.

Steps to Reproduce

  • Install the ralph-wiggum plugin
  • Run the following slash command in Claude Code:
/ralph-wiggum:ralph-loop "Read tasks/example.md and follow it exactly. Output FEATURE_COMPLETE only when everything is done." --max-iterations 30 --completion-promise "FEATURE_COMPLETE"

Expected Behavior

The ralph-loop should initialize and begin executing the iterative prompt loop.

Actual Behavior

Claude Code returns the following error:

Error: Bash command permission check failed for pattern "```!
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 "═══════════════════════════════════════════════════════════"
    ...
  fi
fi
```": Command contains newlines that could separate multiple commands

Workaround

Running the underlying setup script directly from a terminal (outside Claude Code) works correctly:

bash ~/.claude/plugins/cache/claude-plugins-official/ralph-wiggum/19a119f97e36/scripts/setup-ralph-loop.sh "Read tasks/example.md and follow it exactly." --max-iterations 30 --completion-promise "DONE"

Output:

 Ralph loop activated in this session!

Root Cause Analysis

The plugin appears to embed a multi-line bash script block that gets passed through Claude Code's command validation. The security check rejects commands containing newlines to prevent command injection, but this also blocks legitimate multi-line scripts from plugins.

Environment

  • Claude Code version: (run claude --version)
  • OS: macOS
  • Plugin path: ~/.claude/plugins/cache/claude-plugins-official/ralph-wiggum/19a119f97e36/

What Should Happen?

Error Messages/Logs

Steps to Reproduce

  • Install the ralph-wiggum plugin
  • Run the following slash command in Claude Code:
/ralph-wiggum:ralph-loop "Read tasks/example.md and follow it exactly. Output FEATURE_COMPLETE only when everything is done." --max-iterations 30 --completion-promise "FEATURE_COMPLETE"

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.1.5

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗