You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add TL;DR and descriptive headings to how-it-works page (category 1)
Replace generic headings like "What happens in each iteration" with
descriptive ones that work in table of contents and search results.
Add TL;DR summary box matching the pattern on other guide pages.
Co-authored-by: Ralphify <noreply@ralphify.co>
Copy file name to clipboardExpand all lines: docs/how-it-works.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,12 @@ keywords: autonomous coding loop lifecycle, how AI coding agents work, self-heal
6
6
7
7
# How the ralph loop works
8
8
9
+
!!! tldr "TL;DR"
10
+
Each iteration: re-read `RALPH.md` from disk → run commands → replace `{{ placeholders }}` with output → pipe the assembled prompt to the agent → agent works and exits → repeat. The prompt body is re-read every iteration (so you can edit it live), but frontmatter is parsed once at startup. Failed commands still capture output — that's what makes the loop self-healing.
11
+
9
12
What happens inside each iteration of an autonomous coding loop? This page breaks down the lifecycle — from command execution to prompt assembly to agent piping — so you can write better prompts, debug unexpected behavior, and understand the self-healing feedback cycle.
10
13
11
-
## What happens in each iteration
14
+
## The six steps of each iteration
12
15
13
16
Every iteration follows the same sequence:
14
17
@@ -87,7 +90,7 @@ When the agent command starts with `claude`, ralphify automatically adds `--outp
87
90
88
91
The loop starts the next iteration from step 1. The RALPH.md is re-read, commands run again with fresh output, and the agent gets a new prompt reflecting the current state of the codebase.
89
92
90
-
## What changes between iterations
93
+
## What gets re-read vs. what stays fixed
91
94
92
95
| What | When read | Why it matters |
93
96
|---|---|---|
@@ -96,7 +99,7 @@ The loop starts the next iteration from step 1. The RALPH.md is re-read, command
96
99
| Frontmatter (`agent`, `commands`, `args`) | Once at startup | Parsed when the loop starts. Restart to pick up changes. |
97
100
| User arguments | Once at startup | Passed via CLI flags, constant for the run |
98
101
99
-
## The self-healing feedback loop in action
102
+
## How broken code gets fixed automatically
100
103
101
104
Here's a concrete example. Given this `RALPH.md`:
102
105
@@ -167,7 +170,7 @@ If tests are failing, fix them first.
167
170
168
171
The agent sees the test failure and the instruction to fix it first. This is the **self-healing feedback loop**: the agent breaks something, the command captures the failure, and the agent sees it in the next iteration.
169
172
170
-
## How commands run in sequence
173
+
## Command execution order and failure handling
171
174
172
175
Commands run in the order they appear in the `commands` list in the RALPH.md frontmatter. All commands run regardless of whether earlier commands fail.
173
176
@@ -181,7 +184,7 @@ commands:
181
184
run: git log --oneline -10
182
185
```
183
186
184
-
## When does the loop stop
187
+
## How to stop the loop (Ctrl+C, limits, and errors)
0 commit comments