viberslib
Back to dictionary
Workflow

Ralph Loop.

EN

Bash loop pattern popularized by Geoffrey Huntley: re-run an AI agent with fresh context each iteration, read tasks from a plan file, commit on success. The "Ralph Wiggum technique" — forgetful but persistent.

Ralph loop is a simple but powerful agentic pattern where an AI agent repeatedly checks its own output and retries until the task is done. The name nods to Ralph Wiggum: looks dumb, but finishes. The loop typically goes: agent acts → verifies result (test, lint, user-defined criterion) → if it fails, learns from the error and tries again. Good ralph loop design includes a hard stop condition, max retries, and a cost cap to prevent infinite loops and runaway token spend.

TR

Geoffrey Huntley'in popülerleştirdiği bash döngüsü deseni: AI agent'ı taze context ile sürekli baştan çağır, plan dosyasından sırayı oku, commit'e kadar git. "Ralph Wiggum tekniği" — unutkan ama ısrarlı.

Ralph loop, bir AI ajanının görev tamamlanana kadar kendi çıktısını sürekli kontrol edip yeniden denediği basit ama güçlü bir agentic pattern'dir. Adı "Ralph Wiggum" referansıyla geliyor: aptal görünür, ama bitirir. Döngü tipik olarak: ajan görevi yapar → sonucu kontrol eder (test, lint, kullanıcı kriteri) → başarısızsa hatadan öğrenip yeniden dener. İyi ralph loop tasarımı, sonsuz döngü ve token israfını engellemek için kesin durma şartı, max retry sayısı ve maliyet sınırı içerir.

Examples
  • while true; do claude -p "$(cat plan.md)" --headless; done
  • fresh-context loop: read prd.json → pick top task → implement → commit

Related terms.

04