# ralph | Ryan Carson | Knowledge Base | Instagit

Ralph is an autonomous AI agent loop that runs repeatedly until all PRD items are complete. 

GitHub Stars: 16.3k

Repository: https://github.com/snarktank/ralph

---

## Articles

### [What Causes Poor Code Generation in Ralph Iterations and How to Prevent It](/snarktank/ralph/prevent-poor-code-generation-ralph-iterations)

Fix poor Ralph code generation. Learn how context overflow, stale knowledge, and state issues cause problems and keep your iterations clean by mastering atomic stories and quality checks.

- Tags: how-to-guide
- Published: 2026-04-13

### [How to Set Up the Claude Code Marketplace Plugin for Ralph Skills: A Complete Guide](/snarktank/ralph/setup-claude-code-marketplace-plugin-ralph)

Easily set up the Claude Code marketplace plugin for Ralph skills with two CLI commands. Install PRD generation and conversion skills instantly from snarktank/ralph without external configuration.

- Tags: how-to-guide
- Published: 2026-04-13

### [What Is the .last-branch File? Ralph Branch Tracking Explained](/snarktank/ralph/ralph-last-branch-file-branch-tracking)

Discover the .last-branch file and how Ralph branch tracking works. Ralph automatically archives previous work when you switch Git branches for seamless feature development.

- Tags: internals
- Published: 2026-04-13

### [How to Configure Ralph to Use Claude Code Instead of Amp](/snarktank/ralph/configure-ralph-use-claude-code-instead-amp)

Easily configure Ralph to use Claude Code instead of Amp. Simply use the --tool claude flag or edit the script's default setting for a seamless switch.

- Tags: how-to-guide
- Published: 2026-04-13

### [How Ralph Ensures CI Remains Green Across Iterations](/snarktank/ralph/ralph-ensure-ci-green-across-iterations)

Learn how Ralph keeps CI green with a feedback-loop-first architecture. Pass local quality checks automatically before committing code to prevent broken builds.

- Tags: how-to-guide
- Published: 2026-04-13

### [Ralph Quality Gates: The Three Mandatory Checks Before Committing Changes](/snarktank/ralph/ralph-quality-gates-commit-changes)

Discover the three essential Ralph quality gates typechecking linting and testing ensuring successful commits and preventing failed code changes.

- Tags: best-practices
- Published: 2026-04-13

### [How to Use the PRD Skill to Generate Detailed Requirements Documents in Ralph](/snarktank/ralph/use-ralph-prd-skill-generate-requirements)

Learn how to use the PRD skill in Ralph to generate detailed requirements documents quickly. Invoke the skill, answer questions, and retrieve your PRD from tasks/prd-[feature-name].md.

- Tags: how-to-guide
- Published: 2026-04-13

### [Understanding the progress.txt Format and How to Structure Learnings in Ralph](/snarktank/ralph/progress-txt-format-structuring-learnings)

Learn the progress.txt format and structure your learnings effectively for the snarktank/ralph AI agent. Discover how this markdown log persists patterns and insights between iterations.

- Tags: how-to-guide
- Published: 2026-04-13

### [How Ralph Tracks and Switches Between Feature Branches During Execution](/snarktank/ralph/ralph-track-switch-feature-branches)

Learn how Ralph tracks and switches feature branches during execution by comparing prd.json with .last-branch, archiving old states, and updating the tracker automatically.

- Tags: internals
- Published: 2026-04-13

### [What Happens When Max Iterations Is Reached Before All Stories Pass in Ralph?](/snarktank/ralph/ralph-max-iterations-reached-stories-not-passed)

Ralph terminates with exit code 1 when max iterations is reached before all stories pass. Learn how it preserves state and what to do next.

- Tags: internals
- Published: 2026-04-13

### [How to Install Ralph Skills Globally for Multiple Projects](/snarktank/ralph/install-ralph-skills-globally)

Install Ralph skills globally and make prd and ralph slash commands available across all your projects. Save time and streamline your workflow by following this simple installation guide.

- Tags: how-to-guide
- Published: 2026-04-13

### [What Is `amp.experimental.autoHandoff` in the Ralph Workflow and When Should You Enable It?](/snarktank/ralph/amp-experimental-autohandoff-functionality-necessity)

Learn what amp.experimental.autoHandoff does in Ralph workflows. This flag prevents context limit exceeded errors during long-running iterations by automatically spawning new instances.

- Tags: deep-dive
- Published: 2026-04-13

### [How to Customize Ralph's prompt.md Template for Project-Specific Conventions](/snarktank/ralph/customize-ralph-prompt-md-template)

Learn how to customize Ralph's prompt.md template for your project. Tailor quality checks and conventions to your specific tech stack by editing the prompt file in your repository.

- Tags: how-to-guide
- Published: 2026-04-13

### [What Is the `<promise>COMPLETE</promise>` Signal in Ralph and How Does It End the Loop?](/snarktank/ralph/ralph-promise-complete-signal-end-loop)

Understand the COMPLETE signal in Ralph, an AI-emitted token that concludes iteration loops with exit status 0 once all user stories are done. Learn how Ralph manages loop termination.

- Tags: internals
- Published: 2026-04-13

### [How to Configure Browser Verification for Frontend UI Stories with the dev-browser Skill](/snarktank/ralph/configure-browser-verification-frontend-ui-stories)

Learn to configure browser verification for frontend UI stories in Ralph. Add acceptance criteria to trigger the dev-browser skill for automatic headless UI validation.

- Tags: how-to-guide
- Published: 2026-04-13

### [How Ralph's Priority Algorithm Selects the Next User Story](/snarktank/ralph/ralph-priority-algorithm-story-selection)

Discover how Ralph's priority algorithm selects the next user story. Learn the simple filtering and sorting process that prioritizes unfinished stories for efficient development.

- Tags: deep-dive
- Published: 2026-04-13

### [How to Debug Ralph When Iterations Stall or Stories Are Incomplete](/snarktank/ralph/debug-ralph-iterations-stall-incomplete-stories)

Debug Ralph when iterations stall or stories are incomplete. Check output, sentinel logs, progress.txt, and prd.json status to resolve issues quickly.

- Tags: how-to-guide
- Published: 2026-04-13

### [How Ralph Automatically Detects Branch Changes and Archives Previous Runs](/snarktank/ralph/ralph-detect-branch-changes-archive-runs)

Discover how Ralph automatically detects branch changes by comparing prd.json to a cached value. It archives previous runs to timestamped folders when changes are identified.

- Tags: deep-dive
- Published: 2026-04-13

### [What Occurs When a Story Fails Quality Checks in Ralph](/snarktank/ralph/story-fails-quality-checks-ralph-iteration)

Discover what happens when a story fails quality checks in Ralph. Learn how Ralph discards changes, preserves status, and retries failed stories until success or max iterations.

- Tags: how-to-guide
- Published: 2026-04-13

### [How to Customize Quality Check Commands for Linting and Typechecking in Ralph Prompts](/snarktank/ralph/customize-quality-check-commands-ralph-prompts)

Customize Ralph quality check commands for linting & typechecking by editing your local prompt.md or CLAUDE.md file. Replace placeholders with your project's specific commands.

- Tags: how-to-guide
- Published: 2026-04-13

### [How Ralph Auto-Handoff Handles Context Window Limits](/snarktank/ralph/ralph-auto-handoff-context-window-limits)

Discover how Ralph's auto-handoff feature overcomes LLM context window limits by automatically spawning new AI instances, seamlessly processing large user stories without manual intervention.

- Tags: deep-dive
- Published: 2026-04-13

### [Understanding the prd.json Schema for User Stories and Passes Status in Ralph](/snarktank/ralph/prd-json-schema-user-stories-passes-status)

Explore the prd.json schema in Ralph to understand how the passes flag tracks user story completion status, automating your development workflow.

- Tags: api-reference
- Published: 2026-04-13

### [How Ralph Maintains Context Between AI Instances: A Deep Dive into State Persistence](/snarktank/ralph/how-does-ralph-maintain-context-between-ai-instances)

Discover how Ralph sustains AI context using Git history, a JSON task registry, and a progress log. Learn about its state persistence for stateless LLM processes.

- Tags: deep-dive
- Published: 2026-04-13

