description: "The model-facing ralph tool: a fixed foreground fresh-agent loop toward one immutable objective, for users and maintainers choosing or configuring fresh-agent iteration."
English | 中文
ralph runs a foreground sequence of fresh child agents against one immutable objective, with each round receiving only the previous bounded report and shared workspace state. It returns when a worker reports completion or a concrete blocker, or when the configured round limit is reached; those reports are not independently verified. Parent conversation and prior child sessions are never copied into a new round. Use it only when the direct human explicitly requests Ralph-style fresh-agent iteration; use goal tools for ordinary long-running work and subagents or workflows for bounded delegation.
The ralph tool runs a fixed foreground loop: one fresh child per round works on the immutable objective in the shared workspace, and only a bounded structured report crosses rounds. Use it only when the direct human explicitly asks for a Ralph loop or fresh-agent iterative execution. For ordinary long-running same-session work, use goal tools; for bounded delegation and fan-out, use plain subagents or the workflow tool.
The model submits { objective, maxRounds? } and the call blocks until the whole run settles. The deployment config's maxRounds is both the default and a ceiling on a call override. The terminal result is complete, blocked, or budget-limited, carrying the last bounded report and the number of rounds started; an ordinary child failure returns an error naming the failed round and retaining the last successful handoff when one exists.
Each child receives only the immutable objective, its current round and cap, a shared-workspace-as-authority instruction, and the previous structured handoff; parent conversation and prior child sessions are never seeded. The workspace is the long-term memory across rounds. Reports carry a status (continue, complete, or blocked), a non-empty summary, evidence, next steps, and blocker text; invalid or oversized reports fail the workflow instead of being truncated or mistaken for cap exhaustion.
| Field | Default | Meaning |
|---|---|---|
subagentProvider |
spawn |
Fresh structured-output provider used for every round. |
maxRounds |
256 |
Default and deployment ceiling for one Ralph run. |
maxHandoffChars |
16384 |
Maximum serialized characters in one round report. |
maxResultChars |
16384 |
Maximum characters in the complete successful parent result. |
The generated configuration catalog is the exhaustive source for every accepted field. The configured provider must exist, support structured output, and report inheritsParentContext: false; a call against a provider that violates this fails loudly before any round starts.
Read these pages when the tool-level contract is not enough. They move from the shared workflow model to the engine, the subagent seam, and the adjacent goal domain.
Every parent request in this plugin's registration scope receives the fixed routing guidance below.
Use the ralph tool ONLY when the direct human explicitly asks for a Ralph loop or fresh-agent iterative execution. Each Ralph round starts a fresh child with no conversation seed and uses the shared workspace as durable memory. Completion and blockers are worker reports, not independent evaluation. Use same-session goal tools for ordinary long-running objectives, and plain subagents or workflows for bounded delegation and fan-out.
Small fixed guidance cost per request while the plugin is active.
Prefix-stable while the plugin scope and guidance text are unchanged. Activation or disposal may invalidate reuse from this prompt section.
The generated ralph schema exposes one required objective string and one optional maxRounds number. Provider choice, handoff size, report schema, workflow script, and orchestration behavior are deployment-owned and absent from the call schema.
Small fixed schema cost on each request where the tool is visible.
Prefix-stable while the definition and visibility are unchanged.
Each child sees the standalone fixed round prompt plus the structured-output capture contract. The parent sees only the original call and one terminal result containing a worker-reported status, round count, and pretty-printed final report; intermediate child messages and reports do not enter the parent conversation. A failed ordinary child instead yields an error with its round number and, after round one, the last successful handoff.
Every round pays for a fresh child context. maxHandoffChars bounds cross-round state and maxResultChars independently bounds the complete successful parent text; child work remains outside the parent context.
Each fresh child has an independent request cache. The parent result appends after the reusable request prefix.
These limits define what the tool does not yet support. They are current constraints, not a task backlog.