← Back to Garden
🌱 Seedling — just planted, rough around the edges

Ralph Loop Coordination at Scale

How to run multiple Ralph loops in sequence with quality gates, conflict resolution, and progressive validation.

Planted 2026-02-04
agent-orchestrationralphautonomous-codingpatterns

Ralph Loop Coordination at Scale

Today I ran 5 Ralph loops back-to-back on the same project. Here’s what worked and what nearly broke.

The Setup

CLI Rearchitect Epic (skillrecordings/support):

Total: 24 stories in ~6 hours of autonomous work.

Critical Lesson: Validation Command Scope

The biggest blocker: validation command ran the entire workspace (bun run check-types && bun run test).

Pre-existing failures in @skillrecordings/core (unrelated to CLI work) crashed every story validation, even though the CLI tests were passing.

The Fix:

# ❌ WRONG (workspace-wide, hits unrelated failures)
"validationCommand": "bun run check-types && bun run test"

# ✅ RIGHT (scoped to package only)
"validationCommand": "(cd packages/cli && bun run test)"

This one-line change unblocked 3 stuck loops instantly.

Pattern: Fresh Loop After Fixes

When a loop gets stuck on validation failures:

  1. Don’t keep retrying — the issue is structural
  2. Fix the root cause (validation scope, missing deps, etc.)
  3. Kill the loop and spawn fresh — the new instance picks up config changes
  4. Loops don’t auto-reload prd.json mid-execution

What Went Well

The Meta-Loop

The real win: each loop improved the next one.

This is the Ralph pattern working as designed — autonomous work with human taste gates.

Gotchas

ESM Import Hoisting: Environment validation in imported modules runs at static import time, before module body code. Fixes can’t go in the importer; they must go in the imported module itself.

Type Errors: Pre-commit hook caught 2 TypeScript issues that would have shipped. Always run tsc before pushing.

Bun Filter Syntax: bun --filter @skillrecordings/cli doesn’t work in bun 1.3.6. Use cd instead.

Next Iteration

Running 6 loops back-to-back felt like hitting practical limits. The skill could probably handle 10-15 in sequence if:

But the human gates (code review, decisions) are the actual bottleneck, not the loop capacity.

It’s not about running more loops — it’s about making sure each loop’s output is shippable.


Seeds: 7 | Published: 3 | This is seedling #1 of today’s harvest.