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: use Q&A headings and add self-contained intro on when-to-use page (category 7)
Convert generic headings to explicit question format for better LLM
consumption and search discoverability. Add a standalone definition of
"ralph loop" at the top so the page works without context from other pages.
Co-authored-by: Ralphify <noreply@ralphify.co>
Copy file name to clipboardExpand all lines: docs/when-to-use.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,13 @@ keywords: automate coding tasks with AI, autonomous AI coding agent use cases, A
9
9
!!! tldr "TL;DR"
10
10
Use a ralph loop when the task breaks into small, independent steps with automated validation (tests, linters, builds). Use a single conversation for quick tasks, interactive work, or anything requiring subjective judgment. The key ingredient is a command that can tell the agent "you broke something" — that's what makes the loop self-healing.
11
11
12
-
ralph loops are powerful but they're not the right tool for everything. This page helps you decide whether a loop fits your task before you invest time setting one up.
12
+
A **ralph loop** is an autonomous coding cycle powered by [ralphify](index.md). Each iteration: run shell commands (tests, lint, git log), inject their output into a prompt template, pipe the assembled prompt to an AI coding agent (like Claude Code), and repeat. The agent starts fresh every cycle with no conversation history — it reads the current codebase state instead. A ralph is defined by a single `RALPH.md` file containing YAML frontmatter (agent command, commands, args) and a prompt body with `{{ placeholders }}`.
13
13
14
-
## The sweet spot
14
+
Ralph loops are powerful but they're not the right tool for everything. This page helps you decide whether a loop fits your task before you invest time setting one up.
15
15
16
-
ralph loops work best when a task has these properties:
16
+
## What makes a task good for a ralph loop?
17
+
18
+
Ralph loops work best when a task has these properties:
17
19
18
20
**Decomposable into small, independent steps.** The loop does one thing per iteration. Tasks that naturally break into "do this, then this, then this" are ideal — implementing features from a TODO list, writing tests module by module, fixing lint errors one at a time. See the [Cookbook](cookbook.md) for real examples of this pattern.
19
21
@@ -23,7 +25,7 @@ ralph loops work best when a task has these properties:
23
25
24
26
**Progress is visible in the codebase.** The agent's work must be observable on disk — files changed, tests added, docs written, commits made. The next iteration reads the codebase to understand what's been done. Tasks that produce output elsewhere (a Slack message, a deployment, an email) need a wrapper that records progress locally.
25
27
26
-
## What works well
28
+
## What tasks work well in a ralph loop?
27
29
28
30
| Task | Why it fits |
29
31
|---|---|
@@ -37,7 +39,7 @@ ralph loops work best when a task has these properties:
37
39
|**Security hardening**| Run a scanner each iteration; the agent picks one finding, fixes it, and verifies the fix ([recipe](cookbook.md#security-scan)) |
38
40
|**Research & knowledge building**| Each iteration deepens one area; a report file accumulates findings across iterations ([recipe](cookbook.md#deep-research)) |
39
41
40
-
## What doesn't work well
42
+
## What tasks don't work well in a ralph loop?
41
43
42
44
| Task | Why it doesn't fit |
43
45
|---|---|
@@ -48,7 +50,7 @@ ralph loops work best when a task has these properties:
48
50
|**Creative writing**| Prose quality is subjective; no command can validate "is this well-written?" |
49
51
|**Interacting with external services**| API calls, deployments, and messages are hard to undo if the agent makes a mistake |
50
52
51
-
## Loop vs. single conversation
53
+
## Should I use a ralph loop or a single agent conversation?
52
54
53
55
Use a **single conversation** when:
54
56
@@ -65,7 +67,7 @@ Use a **ralph loop** when:
65
67
- The task would fill up a conversation's context window
66
68
- You want to walk away and come back to completed work
67
69
68
-
## Making a borderline task work
70
+
## How do I adapt a borderline task for a ralph loop?
69
71
70
72
Some tasks seem like they don't fit but can be adapted:
71
73
@@ -81,7 +83,7 @@ Some tasks seem like they don't fit but can be adapted:
81
83
??? note ""I need to review the agent's work before it continues.""
82
84
Use `-n 1` to run single iterations, review, then run again. Or use `--stop-on-error` with a command that checks for your sign-off.
83
85
84
-
## How many iterations?
86
+
## How many iterations should I run?
85
87
86
88
-**Start with [`-n 3`](cli.md#ralph-run)** to verify your setup works and the agent produces useful output
87
89
-**Use `-n 10-20`** for bounded tasks (a TODO list with known items)
0 commit comments