Put your AI coding agent in a while True loop and let it ship.
Ralphify is a minimal CLI harness for autonomous AI coding loops. Pipe a prompt to an agent, validate with checks, repeat.
$ ralph init
Created ralph.toml + RALPH.md
$ ralph run -n 3
── Iteration 1 ──
✓ Iteration 1 completed (52.3s)
Checks: 2 passed
✓ lint
✓ tests
── Iteration 2 ──
✗ Iteration 2 failed with exit code 1 (23.1s)
Checks: 1 passed, 1 failed
✓ lint
✗ tests (exit 1)
── Iteration 3 ──
✓ Iteration 3 completed (41.7s)
Checks: 2 passed
✓ lint
✓ tests
Done: 3 iteration(s) — 2 succeeded, 1 failed
Iteration 2 broke a test. Iteration 3 saw the failure and fixed it — that's the self-healing loop.
Install
uv tool install ralphify
Three primitives
Extend the basic loop with building blocks that live in .ralphify/
Checks
Run after each iteration to validate the agent's work. Failed check output feeds into the next iteration so the agent can fix its own mistakes.
Contexts
Inject dynamic data into the prompt before each iteration — git history, test status, API responses. The agent always sees fresh information.
Ralphs
Named, task-focused prompts you switch between at run time. Keep a docs ralph, a refactor ralph, and a bug-fix ralph.
Two commands to start
ralph init && ralph run