← Back to research
·6 min read·opensource

Ralph

Ralph is an autonomous AI agent loop pattern that runs coding agents repeatedly until all PRD items are complete, based on Geoffrey Huntley's technique.

Key takeaways

  • Pattern-first approach — at its core, Ralph is just a bash loop running coding agents until a PRD is complete
  • Fresh context per iteration — each run starts clean, with memory persisting only via git, progress.txt, and prd.json
  • 10K+ GitHub stars — popularized by Geoffrey Huntley's technique and expanded by Ryan Carson's implementation

FAQ

What is Ralph?

Ralph is an autonomous agent loop pattern that runs AI coding tools (Amp, Claude Code) repeatedly until all items in a PRD are complete.

Who created Ralph?

Geoffrey Huntley developed the original Ralph technique. Ryan Carson's snarktank/ralph repo provides a popular open-source implementation.

How does Ralph maintain memory between iterations?

Each iteration starts fresh. Memory persists only through git history, progress.txt (learnings), and prd.json (task status).

What makes Ralph different from other orchestrators?

Ralph is intentionally simple — a bash loop rather than a complex orchestration system. It embraces 'eventual consistency' and iteration.

Executive Summary

Ralph is an autonomous agent loop pattern that runs AI coding tools (Amp, Claude Code) repeatedly until all PRD items are complete.[1] Developed by Geoffrey Huntley and popularized through Ryan Carson's open-source implementation, Ralph represents the simplest possible orchestration approach: a bash loop that spawns fresh agent instances. The pattern has gained significant traction, with 10K+ GitHub stars.

AttributeValue
CreatorGeoffrey Huntley (pattern), Ryan Carson (implementation)
TypeOpen Source Pattern + Implementation
GitHub Stars10K+
LanguageTypeScript/Bash
LicenseOpen Source

Product Overview

At its core, Ralph is remarkably simple:[2]

while :; do cat PROMPT.md | claude-code ; done

This bash loop embodies the "eventual consistency" philosophy — run agents repeatedly, let them make mistakes, and trust that persistence will produce results. Geoffrey Huntley describes it as "deterministically bad in an undeterministic world."

The snarktank/ralph implementation adds structure: PRD-based task management, progress tracking, and support for both Amp and Claude Code.[1]

Key Capabilities

CapabilityDescription
PRD-DrivenTasks defined in prd.json with pass/fail status
Fresh ContextEach iteration starts clean, no context pollution
Multi-ToolSupports Amp (default) and Claude Code
Progress TrackingLearnings append to progress.txt
Auto-CommitCommits on successful quality checks

Workflow

  1. Create PRD — Use the PRD skill to generate requirements
  2. Convert to Ralph format — Transform markdown to prd.json
  3. Run Ralph./ralph.sh [max_iterations]
  4. Iterate — Ralph picks highest priority incomplete story, implements, tests, commits
  5. Complete — When all stories pass, Ralph exits with <promise>COMPLETE</promise>

Technical Architecture

Ralph's architecture prioritizes simplicity and iteration over sophistication:[1]

Memory Model

Memory SourcePurpose
Git historyCommits from previous iterations
progress.txtAppend-only learnings and context
prd.jsonTask status (passes: true/false)
AGENTS.mdUpdated with discovered patterns

Key Technical Details

AspectDetail
DeploymentLocal CLI (bash script)
Supported ToolsAmp (default), Claude Code
Dependenciesjq, git, chosen AI tool
Open SourceYes

Critical Concepts

Small tasks: Each PRD item should complete in one context window. "Build the entire dashboard" is too big; "Add a database column and migration" is right-sized.

AGENTS.md updates: After each iteration, Ralph updates AGENTS.md with learnings. This propagates context to future iterations and human developers.

Feedback loops: Ralph requires feedback — typecheck, tests, and CI must stay green.


Strengths

  • Radical simplicity — At its core, just a bash loop; easy to understand and modify
  • Fresh context — No context pollution between iterations; clean slate each time
  • Tool agnostic — Works with Amp, Claude Code, or any compatible CLI
  • Learnings persist — progress.txt and AGENTS.md accumulate project knowledge
  • Faith-based iteration — Embraces eventual consistency rather than fighting it
  • Well-documented — Interactive flowchart, detailed README, example workflows
  • Active community — 10K+ stars, VentureBeat coverage[3]

Cautions

  • Requires faith — "Building software with Ralph requires a great deal of faith and a belief in eventual consistency"[2]
  • Context window limits — Tasks must fit in single context window; large tasks fail
  • No real-time coordination — Unlike Gastown, no merge queue or parallel coordination
  • Skill-dependent — Effectiveness depends heavily on PRD quality and prompt tuning
  • Can get stuck — May iterate without progress on poorly specified tasks
  • Cost accumulation — Many iterations = many API calls

Pricing & Licensing

TierPriceIncludes
RalphFreeOpen source
AmpSee ampcode.comUnderlying tool cost
Claude Code$20-100/moUnderlying tool cost

True cost: Depends on iteration count and underlying tool pricing.

Licensing model: Open source


Competitive Positioning

Direct Competitors

CompetitorDifferentiation
GastownGastown is full orchestration system (20-30 agents, merge queue); Ralph is simple loop
TemboTembo provides enterprise orchestration; Ralph is developer-operated pattern
Manual iterationRalph automates what you'd do manually with PRD + agent

When to Choose Ralph Over Alternatives

  • Choose Ralph when: You want the simplest possible approach, are comfortable with eventual consistency, and have well-defined PRDs
  • Choose Gastown when: You need parallel execution with sophisticated merge coordination
  • Choose Tembo when: You need enterprise features, team support, and managed orchestration
  • Choose manual operation when: You need full control over each agent decision

Ideal Customer Profile

Best fit:

  • Developers who appreciate simplicity and iteration
  • Engineers already using Amp or Claude Code
  • Teams with well-defined PRD workflows
  • Builders comfortable with "eventual consistency" philosophy
  • Solo developers wanting autonomous overnight execution

Poor fit:

  • Teams needing parallel agent execution
  • Organizations requiring enterprise support
  • Developers uncomfortable with trial-and-error approaches
  • Projects with poorly defined requirements

Viability Assessment

FactorAssessment
Financial HealthN/A — Open source project
Market PositionPattern leader — Defined the simple loop approach
Innovation PaceModerate — Pattern is stable, implementation evolves
Community/EcosystemGrowing — 10K+ stars, active discussion
Long-term OutlookStable — Pattern will persist even as tools evolve

Ralph represents a philosophy more than a product. The pattern will remain relevant even as specific implementations change.


Bottom Line

Ralph proves that sophisticated orchestration isn't always necessary. A bash loop, well-defined tasks, and faith in eventual consistency can accomplish remarkable results. The 10K+ stars and VentureBeat coverage demonstrate that simplicity resonates.

Recommended for: Developers who appreciate simplicity, have well-defined PRDs, and are comfortable with iterative, faith-based development.

Not recommended for: Teams needing parallel execution, sophisticated coordination, or enterprise support.

Outlook: The Ralph pattern will persist as a foundational approach. More complex orchestrators like Gastown build on similar ideas but add coordination. Ralph remains the accessible entry point.


Research by Ry Walker Research • methodology