Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions plugins/ralph-wiggum/scripts/setup-ralph-loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,22 @@ else
COMPLETION_PROMISE_YAML="null"
fi

cat > .claude/ralph-loop.local.md <<EOF
# Write state file in two steps to avoid shell expansion of prompt text
# and heredoc termination if prompt contains 'EOF' on its own line
STARTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
{
cat <<FRONTMATTER_EOF
---
active: true
iteration: 1
max_iterations: $MAX_ITERATIONS
completion_promise: $COMPLETION_PROMISE_YAML
started_at: "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
started_at: "$STARTED_AT"
---

$PROMPT
EOF
FRONTMATTER_EOF
printf '%s\n' "$PROMPT"
} > .claude/ralph-loop.local.md

# Output setup message
cat <<EOF
Expand Down