<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Loop Engineering on Bitsy Wiki</title>
    <link>https://wiki.bitsy.services/wiki/ai/loop-engineering/</link>
    <description>Recent content in Loop Engineering on Bitsy Wiki</description>
    <generator>Hugo</generator>
    <language>en</language>
    <atom:link href="https://wiki.bitsy.services/wiki/ai/loop-engineering/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The Ralph Loop</title>
      <link>https://wiki.bitsy.services/wiki/ai/loop-engineering/ralph-loop/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://wiki.bitsy.services/wiki/ai/loop-engineering/ralph-loop/</guid>
      <description>&lt;h2 id=&#34;what-the-ralph-loop-is&#34;&gt;What the Ralph loop is&lt;a class=&#34;anchor&#34; href=&#34;#what-the-ralph-loop-is&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;The Ralph loop is a shell loop that feeds one prompt file to a coding agent, waits for the agent to exit, and feeds it the same file again, indefinitely. Geoffrey Huntley published it on 14 July 2025, named it after Ralph Wiggum of &lt;em&gt;The Simpsons&lt;/em&gt;, and gave its purest form as one line of Bash:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&#xA;&lt;table style=&#34;border-spacing:0;padding:0;margin:0;border:0;&#34;&gt;&lt;tr&gt;&lt;td style=&#34;vertical-align:top;padding:0;margin:0;border:0;&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code&gt;&lt;span style=&#34;white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;1&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td style=&#34;vertical-align:top;padding:0;margin:0;border:0;;width:100%&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;while&lt;/span&gt; :; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt; cat PROMPT.md | claude-code ; &lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;p&gt;Each pass starts a new agent process with an empty &lt;a href=&#34;https://wiki.bitsy.services/wiki/ai/context-engineering&#34;&gt;context window&lt;/a&gt;. Nothing from the previous pass survives except what it left on disk: the code, the git history, and a handful of files that the prompt tells every pass to read. It is the smallest complete &lt;a href=&#34;https://wiki.bitsy.services/wiki/ai/loop-engineering&#34;&gt;outer loop&lt;/a&gt;. The previous run ending is the trigger, the prompt is the same text every time, and all of the state lives in the repository.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Loops in Claude Code</title>
      <link>https://wiki.bitsy.services/wiki/ai/loop-engineering/claude-code/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://wiki.bitsy.services/wiki/ai/loop-engineering/claude-code/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://wiki.bitsy.services/wiki/ai/context-engineering/claude-code&#34;&gt;Claude Code&lt;/a&gt; has seven ways to send Claude its next message without a person typing it. Each is an &lt;a href=&#34;https://wiki.bitsy.services/wiki/ai/loop-engineering&#34;&gt;outer loop&lt;/a&gt;: something outside the agent that starts a turn, and the seven differ on three questions. What starts the next turn? Where does the run happen? What has to be open while it runs?&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Mechanism&lt;/th&gt;&#xA;          &lt;th&gt;Next turn starts when&lt;/th&gt;&#xA;          &lt;th&gt;Runs on&lt;/th&gt;&#xA;          &lt;th&gt;Needs an open session&lt;/th&gt;&#xA;          &lt;th&gt;Permission prompts&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;/loop&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;an interval elapses, or a delay Claude picked&lt;/td&gt;&#xA;          &lt;td&gt;your machine&lt;/td&gt;&#xA;          &lt;td&gt;yes&lt;/td&gt;&#xA;          &lt;td&gt;as the session&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;/goal&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;a turn ends and an evaluator rules the condition unmet&lt;/td&gt;&#xA;          &lt;td&gt;your machine&lt;/td&gt;&#xA;          &lt;td&gt;yes, or one non-interactive run&lt;/td&gt;&#xA;          &lt;td&gt;as the session&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Stop hook&lt;/td&gt;&#xA;          &lt;td&gt;Claude ends a turn and a script blocks it&lt;/td&gt;&#xA;          &lt;td&gt;wherever the session runs&lt;/td&gt;&#xA;          &lt;td&gt;yes&lt;/td&gt;&#xA;          &lt;td&gt;as the session&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Desktop scheduled task&lt;/td&gt;&#xA;          &lt;td&gt;a schedule fires&lt;/td&gt;&#xA;          &lt;td&gt;your machine&lt;/td&gt;&#xA;          &lt;td&gt;no, but the app must be open&lt;/td&gt;&#xA;          &lt;td&gt;set per task&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Routine&lt;/td&gt;&#xA;          &lt;td&gt;a schedule, an HTTP call, or a GitHub event&lt;/td&gt;&#xA;          &lt;td&gt;Anthropic&amp;rsquo;s cloud&lt;/td&gt;&#xA;          &lt;td&gt;no&lt;/td&gt;&#xA;          &lt;td&gt;never asks; runs everything it can reach&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;claude -p&lt;/code&gt; (one prompt, one run, then exit)&lt;/td&gt;&#xA;          &lt;td&gt;the calling program runs it&lt;/td&gt;&#xA;          &lt;td&gt;wherever it is called&lt;/td&gt;&#xA;          &lt;td&gt;no&lt;/td&gt;&#xA;          &lt;td&gt;set by flags&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;GitHub Action&lt;/td&gt;&#xA;          &lt;td&gt;a workflow event or schedule&lt;/td&gt;&#xA;          &lt;td&gt;GitHub&amp;rsquo;s runners&lt;/td&gt;&#xA;          &lt;td&gt;no&lt;/td&gt;&#xA;          &lt;td&gt;set by &lt;code&gt;--allowedTools&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;The first three keep one session going, so every iteration shares a &lt;a href=&#34;https://wiki.bitsy.services/wiki/ai/context-engineering&#34;&gt;context window&lt;/a&gt; with the ones before it. The other four start a new session for each run, so a run sees only what an earlier one wrote down. That split is the &lt;a href=&#34;https://wiki.bitsy.services/wiki/ai/loop-engineering#what-carries-over-between-runs&#34;&gt;fresh-context question&lt;/a&gt; on the parent page. A same-session loop left running for days accumulates history until &lt;a href=&#34;https://wiki.bitsy.services/wiki/ai/context-engineering#compaction-and-summarization&#34;&gt;compaction&lt;/a&gt; summarizes its early iterations away; a fresh-session loop forgets everything it did not write to disk.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
