'Ralph Loop' Self-Prompting AI Coding Technique Goes Viral
4 videos · score: 4,660 · first seen Jun 19, 2026
A viral tweet from 'Pete' describing a self-prompting agent loop technique for Codex/Claude Code — where an agent wakes itself every few minutes to direct its own work — spawns a four-video run from the same creator debating and validating the 'Ralph loop' approach to autonomous coding agents.

Prompt Loops, Not Individual Instructions
The creator demonstrates how a model writing 240 lines of throwaway code for sub-prompting in an agent loop unlocks 'really crazy powers' by enabling a single-run workflow that lets the agent prompt itself.

I guess we're writing loops now?
The creator argues that developers should stop manually prompting coding agents and instead build automated loops where agents prompt themselves, inspired by Pete's use of Codex to maintain repos by waking every five minutes and directing work to threads.

Pete Was Right...(Again)
In a video, Pete explains his shift from manually prompting coding agents to designing self-prompting loops like the 'Ralph loop' for the Hermes agent, where agents autonomously review and iterate code, arguing this approach is superior after previously dismissing it.

Why Agent Loops Just Make Sense
The creator criticizes the trend of pre-defining multiple AI agent personas and roles for task decomposition, arguing it ignores AI's dynamic nature and instead advocates for a single agent dynamically spinning up sub-agents.