Skip to content

[ralph-wiggum] Markdown code block markers passed to shell, causing parse error #66

@Aistotle

Description

@Aistotle

TL;DR

The hook script includes markdown code block markers (```) that are being passed directly to the shell instead of being stripped. The shell tries to execute ```! if [[ ... as a command, causing a parse error.


Error Message

Error: Bash command failed for pattern "```! if [[ -f .claude/ralph-loop.local.md ]]; then 
ITERATION=$(grep '^iteration:' .claude/ralph-loop.local.md | sed 's/iteration: *//') 
echo "FOUND_LOOP=true" 
echo "ITERATION=$ITERATION" 
else 
echo "FOUND_LOOP=false" 
fi

(eval):1: parse error near `echo'

Steps to Reproduce

  1. Use macOS (which defaults to zsh)
  2. Run a ralph-loop until it completes or is cancelled
  3. Observe the parse error in the output

Expected Behavior

The hook script should execute successfully regardless of the user's default shell.


Actual Behavior

The script fails with (eval):1: parse error near 'echo' — a classic zsh error when encountering bash-specific syntax.

Image


Suggested Fix

Either:

  • Add an explicit shebang (#!/bin/bash) to ensure the script runs in bash
  • Or rewrite the script to be POSIX-compliant / zsh-compatible

Environment

Component Details
Interface Claude Code for VS Code extension
Plugin ralph-wiggum (via /plugin install ralph-wiggum@claude-code-plugins)
OS macOS (zsh is default shell since Catalina)
Shell zsh 5.9 (or similar)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions