Skip to content

Conversation

@arushs
Copy link

@arushs arushs commented Dec 27, 2025

Summary

  • Fix /ralph-loop and /cancel-ralph commands failing due to Claude Code security checks
  • Extract inline bash from ```! blocks to external scripts
  • Move completion promise display logic to setup-ralph-loop.sh

Problem

Claude Code's security checks reject bash commands containing:

  • Newlines ("could separate multiple commands")
  • $() command substitution

Both /ralph-loop and /cancel-ralph used inline ```! blocks with multi-line bash, causing them to fail immediately on invocation.

Solution

Replace ```! (auto-execute) with ```bash (manual execution via Claude) and use external scripts:

Command Before After
/cancel-ralph Inline multi-line bash scripts/cancel-ralph.sh
/ralph-loop Inline multi-line bash Uses existing setup-ralph-loop.sh

Test plan

  • Run /cancel-ralph with no active loop → should report "No active Ralph loop found"
  • Run /ralph-loop "test" --max-iterations 2 → should initialize loop
  • Run /cancel-ralph with active loop → should cancel and report iteration count

🤖 Generated with Claude Code

@STRML
Copy link

STRML commented Dec 28, 2025

This PR helps, but I had to remove the ``` block entirely (just leave the command) for it to work. But it did work after that.

arushs and others added 2 commits December 28, 2025 19:12
Claude Code's security checks reject bash commands containing newlines
or $() command substitution in inline ```! code blocks. This caused
both /ralph-loop and /cancel-ralph commands to fail with errors like:

  "Command contains newlines that could separate multiple commands"
  "Command contains $() command substitution"

Changes:
- cancel-ralph.md: Extract inline bash to scripts/cancel-ralph.sh
- ralph-loop.md: Remove inline bash, use ```bash to call setup script
- setup-ralph-loop.sh: Add completion promise display (moved from
  ralph-loop.md inline block)

The ```bash syntax instructs Claude to run the command manually rather
than auto-executing, avoiding the security restrictions while
maintaining the same functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Per PR feedback, the ```bash blocks were still causing issues.
Removing the code block syntax entirely and leaving just the plain
command works correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants