Skip to content

Conversation

@TheNumberOne
Copy link

Summary

  • Moved completion promise display logic from inline command in ralph-loop.md into setup-ralph-loop.sh
  • Command is now a single line that passes Claude Code's newline safety check
  • Also fixes a pre-existing shellcheck warning about unquoted variable

Problem

Claude Code's safety check blocks bash commands containing newlines to prevent command injection. The ralph-loop command had an inline multi-line bash script that triggered this check:

Error: Bash command permission check failed for pattern "...": Command contains newlines that could separate multiple commands

Solution

Move the completion promise display logic into the setup script, which already has access to the $COMPLETION_PROMISE variable. This simplifies the command to a single line while maintaining the same functionality.

Test plan

  • Verified shellcheck passes on setup-ralph-loop.sh
  • Test /ralph-wiggum:ralph-loop command executes without permission error
  • Test completion promise is displayed correctly when --completion-promise is set

Claude Code's safety check blocks bash commands containing newlines.
This moves the completion promise display logic from the inline command
in ralph-loop.md into setup-ralph-loop.sh, making the command a single
line that passes the safety check.

Also fixes a pre-existing shellcheck warning about unquoted variable.
@TheNumberOne TheNumberOne marked this pull request as draft December 30, 2025 22:10
@TheNumberOne
Copy link
Author

Hm, I ran into this issue separately after fixing it: #3662

> /ralph-wiggum:ralph-loop baaaah
  ⎿  Error: Bash command permission check failed for pattern "!`"/Users/redacted/.claude/plugins/cache/claude-code-plugins/ralph-wiggum/1.0.0/scripts/setup-ralph-loop.sh" baaaah`": This command requires approval

delikat added a commit to delikat/claude-code that referenced this pull request Dec 31, 2025
Remove ```! code blocks from command files that caused permission check
failures. Claude Code's security model rejects multi-line bash commands,
and the auto-execute syntax was being included in permission validation.

Changes:
- Extract multi-line bash from command files to external scripts
- Create scripts/cancel-ralph.sh for cancellation logic
- Move completion promise display to setup-ralph-loop.sh
- Scope allowed-tools to specific script paths for security
- Add bash prefix to hooks.json for Windows compatibility
- Use #!/usr/bin/env bash for portability across systems
- Use heredoc for static text to prevent variable interpolation bugs

Based on patterns from PRs anthropics#59, anthropics#58, anthropics#72, anthropics#89, anthropics#15845, anthropics#15731.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@grmkris
Copy link

grmkris commented Jan 2, 2026

having same issue..

@amorriscode
Copy link
Contributor

Closing in favour of #16320

@amorriscode amorriscode closed this Jan 5, 2026
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.

3 participants