progress.txt is Ralph’s memory system. Each iteration appends its learnings here, building up knowledge that persists across fresh AI instances.
Purpose
Ralph spawns fresh AI instances each iteration with clean context. Theprogress.txt file provides:
- Historical context - What was implemented in previous iterations
- Codebase patterns - Discovered conventions and best practices
- Gotchas - Mistakes to avoid
- Thread references - Links to previous Amp threads for deeper context
File Structure
Codebase Patterns Section
This section appears at the TOP of
progress.txt and should be read FIRST by each Ralph iteration.## Codebase Patterns section consolidates the most important, reusable learnings:
What to Include
DO include:- General, reusable patterns
- Architectural conventions (e.g., “Use X pattern for Y”)
- Location of key components or files
- Type definitions and enums
- Critical gotchas that apply broadly
- Story-specific implementation details
- Temporary debugging notes
- Information that’s only relevant to one story
Progress Entry Format
Always APPEND to
progress.txt. Never replace or remove existing entries.Entry Fields
Timestamp of when the iteration completed.Example:
2024-03-15 14:30 or Mar 15, 2024The user story ID from prd.json that was implemented.Example:
US-001Link to the Amp thread for this iteration (Amp only).Format:
Thread: https://ampcode.com/threads/$AMP_CURRENT_THREAD_IDPurpose: Future iterations can use the read_thread tool to reference previous work.This field is only applicable when using Ralph with Amp. Omit for Claude Code.
Brief description of what was implemented and which files were changed.
Critical section documenting discoveries for future iterations.Must include:
- Patterns discovered
- Gotchas encountered
- Useful context about the codebase
Example Entry
Learnings Section Guidelines
What Makes a Good Learning
Pattern discovered:- “This codebase uses
sql<number>template for aggregations” - “All server actions return
{ success: boolean, data?: T, error?: string }” - “UI components import types from actions.ts, not directly from db/schema”
- “Don’t forget to update the filter options in TaskFilters.tsx when adding new status values”
- “The migration runner requires manual restart of dev server”
- “Enum values must match exactly between DB schema and TypeScript types”
- “The evaluation panel is in component src/components/EvaluationPanel.tsx”
- “Task status dropdown logic is shared between TaskCard and TaskEditModal”
- “The tasks API endpoint uses cursor-based pagination, not offset”
What NOT to Include
- “I ran npm install” (not useful to future iterations)
- “Fixed a typo in line 42” (too specific)
- “Everything works now” (not a learning)
Full Example
Usage in Ralph Iterations
Each Ralph iteration follows this workflow:- Read
progress.txt- Check the Codebase Patterns section FIRST - Review recent entries - Understand what previous iterations learned
- Implement the story - Apply patterns and avoid gotchas
- Update patterns - Add new reusable patterns to Codebase Patterns section
- Append progress entry - Document implementation and learnings
The Codebase Patterns section should be read before starting work. It contains the most important knowledge distilled from all previous iterations.
Thread References (Amp Only)
When using Ralph with Amp, each entry includes a thread URL:read_thread tool to access the full conversation from that iteration:
Related
- prd.json Format - PRD structure that Ralph implements
- AGENTS.md Files - Directory-specific knowledge persistence
- How Ralph Works - How Ralph uses these files

