ralph-start

A command that sets up a Ralph Loop, a repeated process where one coding agent works on a task until it meets defined completion checks.

In plain words
What is it for?
Use it to gather requirements, create a task plan in RALPH_PRD.json, and define iteration and test limits for autonomous coding work.
Why use it?
It turns a broad task into smaller testable steps and records how to check whether the work is finished.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/gosha70/code-copilot-team/ralph-start
Clone the repo
git clone --depth 1 https://github.com/gosha70/code-copilot-team

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 794 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00794
Opus 5 $0.00000 $0.00397
Sonnet 5 $0.00000 $0.00159
Haiku 4.5 $0.00000 $0.00079

Measured 3d ago against content hash 853d6c76c76d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ralph-start scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

adapters/claude-code/.claude/commands/ralph-start.md · 101 lines

How it starts

The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Start a Ralph Loop for autonomous task completion.

Instructions

You are setting up a Ralph Loop — a single-agent autonomous loop that iterates until a task is complete.

Step 1: Gather Requirements

Ask the user for:

  1. Task description — what should be built or fixed?
  2. Completion criteria — how do we know it's done? (test commands, expected outputs)
  3. Iteration limit — how many iterations max? (suggest 10 for small tasks, 20 for medium)

If the user provides a PRD file path, read it instead of asking.

Step 2: Generate the PRD

Create a RALPH_PRD.json file in the project root:

{
  "task": "<task description>",
  "max_iterations": <limit>,
  "stories": [
    { "id": "1", "description": "<first incremental step>", "passes": false },
    { "id": "2", "description": "<second step>", "passes": false },
    { "id": "3", "description": "<third step>", "passes": false }
  ],
  "test_command": "<command to verify completion>",
  "stuck_threshold": 3
}

Rules for stories:

  • Each story is a single, testable increment
  • Stories are ordered — each builds on the previous
  • 3-8 stories is ideal (too few = too coarse, too many = overhead)
  • First story should be the simplest possible setup step

Step 3: Create the Progress File

Create RALPH_PROGRESS.md in the project root:

# Ralph Loop Progress

Task: <task description>
Started: <timestamp>

---

Step 4: Create the Loop Prompt

Create RALPH_PROMPT.md in the project root:

You are running in Ralph Loop mode. Read RALPH_PRD.json and RALPH_PROGRESS.md.

1. Find the first story where "passes" is false
2. If all stories pass → report completion and stop
3. Implement the story
4. Run the test command from the PRD
5. If tests pass → update the PRD (set passes: true), commit, append to RALPH_PROGRESS.md
6. If tests fail → append failure details and "Learned:" line to RALPH_PROGRESS.md
7. If the same story has failed <stuck_threshold> times in a row → stop and report

Always append to RALPH_PROGRESS.md with:
## Iteration N — Story X: <description>
- What was done
- Test result: pass/fail
- Committed: <hash> (if passing)
- Learned: <key insight for future iterations>

Read the full file on GitHub · 101 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 101 lines · 0 tokens per session scan A 853d6c76c76d

Subscribe to this mod's changes

ralph-start is a command published in the GitHub repository gosha70/code-copilot-team (6 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 794 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.