prd.json ready, run Ralph to autonomously implement all user stories.
Basic Usage
Command Options
Specify Max Iterations
Choose AI Tool
Combined Options
What Ralph Does
Create Feature Branch
Ralph creates or checks out the branch specified in
prd.json (branchName field).Example: ralph/task-priorityImplement Story
A fresh AI instance (Amp or Claude Code) implements that single story with clean context.
Run Quality Checks
Ralph runs your project’s quality checks:
- Typecheck
- Linter
- Tests
- Any custom checks in your prompt template
Commit If Passing
If all checks pass, Ralph commits with message:Example:
feat: US-001 - Add priority field to databaseAppend to progress.txt
Ralph adds learnings to
progress.txt:- What was implemented
- Files changed
- Patterns discovered
- Gotchas encountered
- Thread URL for reference
How Iterations Work
Each Iteration = Fresh Context
Each iteration spawns a new AI instance (Amp or Claude Code) with clean context. The only memory between iterations is:Persistent Memory
- Git history - Commits from previous iterations
- progress.txt - Learnings and context
- prd.json - Which stories are done (
passesstatus)
Example Ralph Run
Here’s what a Ralph execution looks like:Stop Conditions
Success: All Stories Complete
When all stories havepasses: true, Ralph outputs:
0.
Timeout: Max Iterations Reached
If Ralph reaches max iterations without completing all stories:1.
Automatic Archiving
When you start a new feature (differentbranchName), Ralph automatically archives the previous run:
- Previous
prd.json - Previous
progress.txt
Key Files During Execution
| File | Purpose |
|---|---|
ralph.sh | The bash loop that spawns fresh AI instances |
prompt.md | Instructions given to each Amp instance |
CLAUDE.md | Instructions given to each Claude Code instance |
prd.json | Task list with passes status |
progress.txt | Append-only learnings for future iterations |
.last-branch | Tracks current feature for archiving |
Customizing the Prompt
After copying Ralph to your project, customize the prompt template:- Quality check commands
- Codebase conventions
- Common gotchas for your stack
- Required environment variables
Debugging Failed Iterations
If an iteration fails:- Check the output - Scroll up to see error messages
- Review progress.txt - See what previous iterations learned
- Inspect prd.json - Check which story was being attempted
- Check git log - See what was committed successfully
Browser Verification for UI Stories
Frontend stories must include “Verify in browser using dev-browser skill” in acceptance criteria.
- Load the
dev-browserskill - Navigate to the relevant page
- Interact with the UI
- Confirm changes work visually
- Take screenshots for the progress log
AGENTS.md Updates
After each iteration, Ralph checks if any learnings should be added toAGENTS.md files:
- Patterns discovered - “This codebase uses X for Y”
- Gotchas encountered - “Don’t forget to update Z when changing W”
- Useful context - “The settings panel is in component X”
AGENTS.md files, so future iterations (and human developers) benefit immediately.
Feedback Loops Are Critical
Ralph only works if there are feedback loops:Required Feedback
- Typecheck catches type errors
- Tests verify behavior
- CI must stay green (broken code compounds across iterations)
- Browser verification confirms UI changes work
Recommended Settings
Amp Auto-Handoff (Recommended)
Add to~/.config/amp/settings.json:
Next Steps
While Ralph is running:- Monitor progress via
prd.json,progress.txt, and git log - Let Ralph work autonomously
- Review commits when complete
- Merge the feature branch when ready
Autonomous Execution
Ralph runs completely autonomously - no human intervention required!

