Gracefully stop the god-ralph orchestrator and all active Ralphs
Stops the god-ralph orchestrator and all active Ralph workers gracefully.
/plugin marketplace add DuncanJurman/entropy-plugins/plugin install god-ralph@entropy-marketplaceGracefully stop the god-ralph orchestrator and all active Ralph workers.
# Signal stop
if [[ -f ".claude/god-ralph/orchestrator-state.json" ]]; then
# Update state to stopping
jq '.status = "stopping"' .claude/god-ralph/orchestrator-state.json > .claude/god-ralph/orchestrator-state.json.tmp
mv .claude/god-ralph/orchestrator-state.json.tmp .claude/god-ralph/orchestrator-state.json
echo "[god-ralph] Stopping orchestrator..."
echo "[god-ralph] Active Ralphs will complete current iteration before stopping"
else
echo "[god-ralph] No active session to stop"
fi
Each active Ralph:
# For each active Ralph worktree
for worktree in .worktrees/ralph-*; do
if [[ -d "$worktree" ]]; then
cd "$worktree"
# Commit any pending changes
git add -A
git commit -m "WIP: Stopped by user" || true
# Note progress in bead
BEAD_ID=$(basename "$worktree" | sed 's/ralph-//')
ITERATION=$(cat .claude/god-ralph/ralph-session.json | jq -r '.iteration')
bd comments "$BEAD_ID" --add "Stopped at iteration $ITERATION. Branch: ralph/$BEAD_ID"
cd -
fi
done
If graceful stop doesn't work:
# Force remove all state
rm -f .claude/god-ralph/orchestrator-state.json
rm -f .claude/god-ralph/ralph-session.json
# Clean up worktrees
git worktree list | grep ralph | awk '{print $1}' | xargs -I {} git worktree remove {} --force
# Remove worktree branches
git branch | grep ralph/ | xargs -I {} git branch -D {}
--force: Force immediate stop without waiting for safe point--keep-worktrees: Don't clean up worktrees (for debugging)[god-ralph] Stopping orchestrator...
[god-ralph] Waiting for 3 active Ralphs to reach safe point...
[god-ralph] Ralph beads-abc: saving progress at iteration 12
[god-ralph] Ralph beads-def: saving progress at iteration 8
[god-ralph] Ralph beads-ghi: saving progress at iteration 3
[god-ralph] Cleaning up worktrees...
[god-ralph] Orchestrator stopped
Summary:
- Session duration: 45 minutes
- Completed beads: 5
- Stopped in progress: 3
- Total iterations: 156
- Estimated cost: $23.40
To resume: /god-ralph start
Work is preserved:
Run /god-ralph start to resume execution.