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: update agent output section to reflect live peek architecture
The "How agent output works" section in agents.md described the pre-peek
behavior where blocking mode either inherited stdio or captured-then-replayed.
Both modes now stream output line-by-line via background reader threads,
and the peek toggle (p key) works in both. Updated to reflect the current
architecture and link to the new peek docs in cli.md.
Co-authored-by: Ralphify <noreply@ralphify.co>
Without this flag, Claude Code pauses to ask for approval before editing files, running commands, or making commits. In an autonomous loop, nobody is there to approve — so the agent would hang forever. [Commands](writing-prompts.md#using-commands-for-dynamic-data) in your RALPH.md act as your guardrails instead.
65
+
Without this flag, Claude Code pauses to ask for approval before editing files, running commands, or making commits. In an autonomous loop, nobody is there to approve — so the agent would hang forever. [Commands](how-it-works.md#2-run-commands-and-capture-output) in your RALPH.md act as your guardrails instead.
66
66
67
67
### Automatic streaming mode
68
68
@@ -187,24 +187,23 @@ ralph run my-ralph -n 1 --log-dir ralph_logs
187
187
188
188
## How agent output works
189
189
190
-
Ralphify uses two different execution modes depending on the agent (see [how the loop works](how-it-works.md) for the full lifecycle):
190
+
Ralphify streams agent output line-by-line in both execution modes. In an interactive terminal, output streams live to the console by default — press `p` to silence it and `p` again to resume. See [Peeking at live agent output](cli.md#peeking-at-live-agent-output) for details.
191
+
192
+
When [`--log-dir`](cli.md#ralph-run) is set, output is captured to a log file and also echoed after each iteration completes. Live peek still works the same way in that mode.
191
193
192
194
### Streaming mode (Claude Code)
193
195
194
-
When the agent command starts with `claude`, ralphify spawns the process with `Popen` and reads its JSON output line by line. This enables:
196
+
When the agent command starts with `claude`, ralphify parses the agent's structured JSON output line by line. This enables additional features beyond live output:
195
197
196
-
-**Live activity tracking** — the terminal shows what the agent is doing in real time
197
-
-**Result text extraction** — the agent's final response is captured
198
-
-**Verbose logging** — with [`--log-dir`](cli.md#ralph-run), logs include the agent's internal tool calls and reasoning
198
+
-**Activity tracking** — the terminal shows what the agent is doing (tool calls, reasoning) in real time
199
+
-**Result text extraction** — the agent's final response is captured separately
200
+
-**Verbose logging** — with `--log-dir`, logs include the agent's internal tool calls and reasoning
199
201
200
202
### Blocking mode (all other agents)
201
203
202
-
For non-Claude agents, ralphify uses `subprocess.run` and waits for the process to exit. Output behavior depends on whether you're using `--log-dir`:
203
-
204
-
-**Without `--log-dir`** — agent output streams directly to your terminal in real time
205
-
-**With `--log-dir`** — output is captured, written to a log file, then replayed to the terminal after the iteration completes
204
+
For non-Claude agents, ralphify spawns the process and drains stdout and stderr through background reader threads. You see the agent's plain text output line by line as it's produced.
206
205
207
-
Both modes support all ralphify features (commands, timeouts, iteration tracking). The difference is only in how output is handled during each iteration.
206
+
Both modes support all ralphify features (commands, timeouts, iteration tracking, live peek). The difference is that Claude Code gets structured activity tracking on top of the raw output.
208
207
209
208
## Adapting other tools
210
209
@@ -221,5 +220,4 @@ If the tool has no way to accept a prompt non-interactively, a [custom wrapper s
221
220
## Next steps
222
221
223
222
-[Getting Started](getting-started.md) — set up your first loop with the agent you just configured
224
-
-[Writing Prompts](writing-prompts.md) — patterns for writing effective autonomous loop prompts
225
223
-[Troubleshooting](troubleshooting.md) — when the agent hangs, produces no output, or exits unexpectedly
0 commit comments