AI Workflow Guide

Ralph Method + StacksFinder

Combine autonomous AI loops with deterministic tech decisions. Let Ralph handle iteration while StacksFinder ensures data-driven stack selection.

12 min read Updated 2026-02-05

Key Insights

  • Ralph: "Deterministically bad in an undeterministic world" — iterate until success
  • StacksFinder: 100% deterministic scoring — same input = same output
  • Synergy: Ralph handles automation, StacksFinder handles data-driven decisions
  • Integration: Add recommend_stack calls to your PROMPT.md
01

What is the Ralph Method? #

The Ralph Wiggum technique, coined by Geoffrey Huntley, is beautifully simple: a bash loop that feeds prompts to an AI agent indefinitely.

loop.sh — The Core of Ralph
while :; do cat PROMPT.md | claude ; done
Core Principles

Context Rotation

Each loop iteration starts with fresh context. State persists in files and git, not LLM memory. This prevents context pollution from accumulated failures.

Backpressure

Tests, typechecks, and builds act as guardrails. If validation fails, Ralph fixes it. If it passes, Ralph commits and moves on.

File-Based State

IMPLEMENTATION_PLAN.md tracks tasks. AGENTS.md stores operational learnings. Git commits preserve progress between iterations.

Let Ralph Ralph

Trust the loop. Observe failures, add guardrails, adjust prompts. The plan is disposable — regenerate when trajectory goes wrong.

Based on the official Ralph Playbook by Clayton Farr and Geoffrey Huntley's original work.

02

Why This Combination Works #

Ralph's philosophy embraces iteration through non-deterministic LLM outputs. But tech stack decisions shouldn't be non-deterministic — you need reproducible, auditable choices.

Problem

LLM Tech Decisions

  • Hallucinations — Confidently state outdated or incorrect info
  • Opinion-based — "Use React" without data-driven analysis
  • Non-reproducible — Same question → different answers
VS
Solution

StacksFinder MCP

  • Deterministic — Versioned lookup tables, not LLM inference
  • Data-driven — 6-dimension scores based on real metrics
  • Auditable — Same constraints = same recommendations
Ralph Loop Iteration
+
StacksFinder Determinism
=
Result Autonomous Dev

MCP Tools for Each Phase

list_technologies Planning Discover available options by category
analyze_tech Planning Deep-dive analysis with 6-dimension scores
compare_techs Solutioning Side-by-side comparison of 2-4 technologies
recommend_stack Solutioning Full stack recommendation for project type
create_blueprint Implementation Generate shareable documentation (Pro)
03

The Ultrathink Flowchart #

"Ultrathink" is a prompt technique for deep reasoning. Here's how Ralph integrates with StacksFinder MCP for data-driven tech decisions within the autonomous loop.

Ralph + StacksFinder Workflow
LOOP ITERATIONPROMPT.mdFeed to agentSTART0. ORIENTStudy specs/*Study src/lib/*1. SELECTPick mostimportant taskStacksFinder MCPanalyze_techcompare_techsrecommend_stackUltrathink2. BUILDImplementfunctionality3. VALIDATERun testsBackpressure4. COMMITUpdate plangit commitContext ManagementEach iteration: fresh contextState persists in files + gitDeterministic ScoringSame input = same outputNo LLM hallucinationsBackpressure GatesTests must passFailures trigger retry
StacksFinder MCP integration point
Validation / Backpressure
Commit / State persistence
1
PROMPT.md Feed to agent
2
Orient Study specs/*, src/lib/*
3
Select Task Pick most important item
StacksFinder MCP analyze_tech compare_techs recommend_stack
4
Implement Build functionality
5
Validate Run tests (backpressure)
6
Commit Update plan, git commit
Loop with fresh context
04

Integration Guide #

Integrating StacksFinder into your Ralph workflow requires two things: installing the MCP server and updating your PROMPT.md.

1

Install StacksFinder MCP

Add to your Claude Code configuration:

claude_desktop_config.json
{
  "mcpServers": {
    "stacksfinder": {
      "command": "npx",
      "args": ["-y", "@stacksfinder/mcp-server"],
      "env": {
        "STACKSFINDER_API_KEY": "your-api-key"
      }
    }
  }
}

Note: Free tier includes list_technologies, analyze_tech, compare_techs, and 1 recommend_stack per day.

2

Update PROMPT_build.md

Add StacksFinder instructions to your building prompt:

PROMPT_build.md — with StacksFinder integration
0a. Study `specs/*` with up to 500 parallel Sonnet subagents.
0b. Study @IMPLEMENTATION_PLAN.md.
0c. For reference, the application source code is in `src/*`.

1. Your task is to implement functionality per the specifications.
   Follow @IMPLEMENTATION_PLAN.md and choose the most important item.

   **TECH DECISIONS:** When selecting technologies, frameworks, or
   libraries, use StacksFinder MCP tools. Ultrathink.
   - Use `list_technologies` to discover options
   - Use `analyze_tech` for deep-dive on specific tech
   - Use `compare_techs` to compare 2-4 alternatives
   - Use `recommend_stack` for full stack recommendations

   Do NOT rely on training data for tech recommendations.
   StacksFinder provides deterministic, versioned scores.

2. After implementing, run tests for that unit of code.
3. When you discover issues, update @IMPLEMENTATION_PLAN.md.
4. When tests pass, update plan, `git add -A`, `git commit`.

99999. Capture the why — tests and implementation importance.
999999. Single sources of truth, no migrations/adapters.
3

Enhanced Loop Script (Optional)

A production-ready loop with iteration limits and git push:

loop.sh
#!/bin/bash
# Usage: ./loop.sh [plan|build] [max_iterations]

MODE=${1:-build}
MAX=${2:-20}
PROMPT_FILE="PROMPT_${MODE}.md"
ITERATION=0
BRANCH=$(git branch --show-current)

echo "Mode: $MODE | Branch: $BRANCH | Max: $MAX"

while [ $ITERATION -lt $MAX ]; do
    cat "$PROMPT_FILE" | claude -p \
        --dangerously-skip-permissions \
        --model opus \
        --verbose

    git push origin "$BRANCH" 2>/dev/null || \
        git push -u origin "$BRANCH"

    ITERATION=$((ITERATION + 1))
    echo "=== LOOP $ITERATION ==="
done

echo "Completed $MAX iterations"
05

Practical Examples #

Use Case

Ralph Builds a SaaS MVP with StacksFinder

Developer Solo Founder
Timeline 6 weeks
Budget $50/month
Requirements Auth + Payments
1 Iteration 1
PROMPT.md

Build a B2B invoice management SaaS. Constraints: solo developer, $50/month hosting budget, ship in 6 weeks. Use StacksFinder MCP for all technology decisions. Ultrathink.

Claude

Starting implementation. First, I need to select the tech stack. Using StacksFinder MCP for deterministic recommendations...

MCP Call recommend_stack projectType: "saas", scale: "mvp", priorities: ["time-to-market", "cost-efficiency"]
StacksFinder
Score: 91/100
FrontendSvelteKitDX: 94
DatabaseNeon PostgreSQLFree tier
AuthLuciaLightweight
PaymentsPaddleEU MoR
Commit feat: Initialize project with SvelteKit + Neon stack
2 Iteration 2 Fresh context — reads IMPLEMENTATION_PLAN.md
Claude

Reading plan. Next task: Implement authentication. Comparing auth options for SvelteKit...

MCP Call compare_techs ["lucia", "authjs", "clerk"], context: "mvp"
Comparison
Winner for MVP: Lucia 89/100
AuthJS84
Clerk78
Success

Implementing Lucia auth with email/password and GitHub OAuth... Tests passing

Ready to add deterministic tech decisions to your Ralph workflow?

06

Frequently Asked Questions #

What is the Ralph Wiggum method?

The Ralph method, coined by Geoffrey Huntley, is an AI-driven development approach using a simple bash loop to iteratively feed prompts to an AI agent. The key insight: "deterministically bad in an undeterministic world" — failures are caught by loops, making errors cheap data points rather than session-enders.

Why combine Ralph with StacksFinder MCP?

Ralph handles iteration and automation, but LLMs hallucinate about technology capabilities. StacksFinder provides deterministic, versioned scores — same question = same answer. This creates the perfect synergy: autonomous iteration meets data-driven decisions.

What is "Ultrathink" in Ralph prompts?

Ultrathink is a prompt technique that instructs the AI to engage in deeper reasoning. In Ralph workflows, it's used for complex decisions like architecture, prioritization, and when integrating tools like StacksFinder for tech selection.

How much does the Ralph method cost?

Running Ralph requires high token usage (Geoff mentions ~$200/month plans). However, it trades compute cost for developer time savings, especially on greenfield projects. StacksFinder MCP adds minimal overhead with free tier tools.

Can I use Ralph without Claude Code?

Yes! The Ralph pattern works with any CLI-based AI agent: Cursor, Codex, Amp, OpenCode, etc. The core is the bash loop pattern and file-based state persistence, not a specific tool.

Is StacksFinder scoring really deterministic?

Yes, 100%. StacksFinder uses versioned lookup tables for all scoring — no LLM involvement in technology selection. The same constraints always produce the same recommendations, making decisions auditable and reproducible.

Let Ralph Ralph with Data-Driven Decisions

Install StacksFinder MCP and bring deterministic tech scoring to your autonomous development workflow.

Free tier includes core analysis tools. Pro unlocks blueprints and audits.