Slash command $ARGUMENTS breaks with multi-line input — affects 16+ commands across official plugins
Bug Description
When invoking slash commands that use $ARGUMENTS, multi-line input gets broken. This is a systemic issue affecting every command/skill that uses $ARGUMENTS — not just one plugin. The root cause is in how Claude Code passes $ARGUMENTS to shell scripts and command templates.
Scope of Impact
We audited all installed plugins and found 16+ commands affected in a single user installation:
Official Claude Plugins (claude-plugins-official)
| Command | Plugin | Usage |
|---------|--------|-------|
| /ralph-loop | ralph-loop | setup-ralph-loop.sh $ARGUMENTS (shell script) |
| /review-pr | pr-review-toolkit | "$ARGUMENTS" (inline template) |
| /feature-dev | feature-dev | $ARGUMENTS (inline template) |
| /hookify | hookify | $ARGUMENTS (inline template) |
| /create-plugin | plugin-dev | $ARGUMENTS (inline template) |
| /new-sdk-app | agent-sdk-dev | $ARGUMENTS (inline template) |
Everything Claude Code Plugin
| Command | Usage |
|---------|-------|
| /orchestrate | $ARGUMENTS (inline template) |
| /checkpoint | $ARGUMENTS (inline template) |
| /eval | $ARGUMENTS (inline template) |
| /verify | $ARGUMENTS (inline template) |
User Custom Commands
| Command | Usage |
|---------|-------|
| /explore-webapp | $ARGUMENTS (inline template) |
| /test-frontend-cli | $ARGUMENTS (inline template) |
| /test-frontend | $ARGUMENTS (inline template) |
Yuno Plugin (3rd party)
| Command | Usage |
|---------|-------|
| /prd | $ARGUMENTS (inline template) |
| /service-info | "$ARGUMENTS" (inline template) |
| /login | ${ARGUMENTS:-all} (shell script) |
Root Cause Analysis
There are two different failure modes depending on how $ARGUMENTS is used:
1. Shell script commands (e.g., ralph-loop)
In ralph-loop.md:
"${CLAUDE_PLUGIN_ROOT}/scripts/setup-ralph-loop.sh" $ARGUMENTS
The $ARGUMENTS is passed unquoted to a bash script. When input contains newlines:
/ralph-loop Build an API that:
- handles auth
- has CRUD endpoints
--max-iterations 10
The shell splits on newlines, breaking argument parsing completely. The script receives garbled positional arguments.
2. Inline template commands (e.g., feature-dev, prd)
In feature-dev.md:
Initial request: $ARGUMENTS
When $ARGUMENTS contains newlines, the template substitution itself may work, but the input parsing at Claude Code level truncates or corrupts the multi-line input before it reaches the template.
Steps to Reproduce
Test 1: ralph-loop (shell script mode)
/ralph-loop Build a REST API with:
- GET /users
- POST /users
- Authentication middleware
--max-iterations 5
Expected: Script receives full multi-line prompt
Actual: Breaks on newline, only first line or garbled input received
Test 2: Any inline template command
/prd A payment gateway integration that supports:
- Credit card processing
- Refund handling
- Webhook notifications
Expected: Full multi-line text substituted into $ARGUMENTS
Actual: Truncated or only first line captured
Current Workarounds (all painful)
- Collapse to single line: Loses readability for complex prompts
- Write to file first:
echo "prompt" > /tmp/prompt.txtthen/ralph-loop $(cat /tmp/prompt.txt)— adds friction - Use INLINE format: Write everything without line breaks — unreadable for structured tasks
Suggested Solutions (in order of preference)
- Preserve newlines in
$ARGUMENTS: When Claude Code captures user input after a slash command, preserve the full input including newlines. Pass to templates as-is, and to shell scripts as a properly quoted single argument.
- Multi-line input mode: When a command has
argument-hintdefined, show a multi-line text input area instead of single-line parsing.
- Here-doc support for shell commands: Instead of
script.sh $ARGUMENTS, supportscript.sh <<< "$ARGUMENTS"or pipe the arguments via stdin.
- File-based argument passing: Automatically write
$ARGUMENTSto a temp file and pass the file path, so scripts cancatit.
Environment
- macOS Darwin 24.6.0
- Claude Code CLI (Claude Opus 4.6)
- Plugins: ralph-loop, pr-review-toolkit, everything-claude-code, feature-dev, hookify, plugin-dev, agent-sdk-dev, yuno
🤖 Generated with Claude Code
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗