This page walks the absolute shortest path from "never heard of ralph-research"
to "looked at the persisted decision evidence of an accepted cycle." Total
elapsed time should be under five minutes on a laptop with Node 24 and Git
already installed.
If you would rather skim than do, the README and the operation model cover the same ground in prose.
node --version # expected: v24.x
git --version # any modern Git is fineIf node --version reports something below 24, npm install -g n followed by
n 24 is the fastest way to upgrade.
npx ralph-research demo writingWhat just happened:
npxfetched the publishedralph-researchpackage from npm.- The CLI created a disposable Git repo under
/tmp/rrx-demo-writing-.... - One full write-evaluate-accept cycle ran end-to-end.
- The CLI printed the temp path, the run id, and the decision reason.
Note the temp path the CLI printed — you will use it in the next step.
cd <the temp path from step 1>
ls .ralph/
ls .ralph/runs/run-0001/
cat .ralph/runs/run-0001/run.json | python3 -m json.tool # or jq
cat .ralph/runs/run-0001/decision.json | python3 -m json.toolWhat to look for:
run.jsonrecords the status (accepted), the metric value, and the diff summary the candidate produced.decision.jsonexplains why the ratchet accepted, including the previous frontier (empty on the first cycle) and the new frontier.frontier.jsonshows the promoted candidate that future cycles will be measured against.
These three files are the runtime's contract with you — anything rrx status
or rrx inspect shows comes from them, not from a regenerated narrative.
Back in any scratch directory:
npx ralph-research demo codeThis runs the test-pass ratchet over a tiny calculator module. On the first
cycle, the proposer rewrites a deliberately-broken sum/multiply to make
all four node --test cases pass, and the ratchet promotes the candidate
from tests_passed: 0 to tests_passed: 4.
If you want to see the exact files involved, ls templates/code/ inside this
repository — src/calculator.mjs, tests/calculator.test.mjs, and the three
scripts/*.mjs files are everything the template ships.
In the directory from step 1:
$EDITOR ralph.yamlA safe first edit is enabling the optional stopping.target block at the
bottom of the file. Then:
npx ralph-research run --until-target --until-no-improve 3 --jsonThe runtime will keep iterating until either the metric target is met or the
configured no-improve window expires. Inspecting .ralph/runs/ again shows
exactly which cycles were accepted and which were rejected.
To experience the recovery semantics in code:
- Start a long-running cycle (
npx ralph-research run --until-target). - Hit Ctrl-C partway through.
- Run
npx ralph-research status --json— the runtime classifies the interrupted session as resumable or not, based on persisted lifecycle evidence. - Run
npx ralph-research runagain — the runtime auto-resumes the latest recoverable run from the last completed cycle boundary.
The interesting case is when the runtime says not resumable. That happens
on purpose: docs/operation-model.md documents the four recovery
classifications and why each one chooses to refuse resume rather than
silently risk double-writing state.
docs/operation-model.md— the full lifecycle and the rules the recovery classifier enforces.docs/playbook.md— situation-to-command operator guide.docs/examples-catalog.md— additional manifest shapes (LLM judge, Python/uv tests, progressive stop).docs/comparison.md— when to pick this runtime versus LangGraph, aider, or a prompt-only ralph loop.docs/faq.md— common runtime, recovery, and inspection questions.
If anything in this walkthrough does not work as described, the runtime is
wrong and the issue templates under .github/ISSUE_TEMPLATE/ are the right
place to file a reproduction.