The Ralph Loop is a technique for automating AI coding agent tasks by running them in a bash loop where each iteration starts with a fresh context window. Instead of accumulating context baggage across a long session, each loop iteration reads from a PRD file and a progress.txt file, works on one task, writes its progress, then exits. This solves context window degradation on long-running agentic tasks. A practical demo builds a Java vending machine CLI app using Claude Code in non-interactive (-p) mode, with Maven and JUnit for testing, showing how the loop picks tasks from a PRD, commits after each, and updates progress until all tasks are complete.

18m watch time

Sort: