Base: anatomy of the loop|INEMA.CLUB-PRO

LOOP-R Engineering Track · course 0 of 6 · 8 lessons

Base: the anatomy of an agent loop that works, checks itself, and knows when to stop

Goal, state, action, verification, and stop. The harness around the model, today's loop engines and the limits of each, LOOP-R with its nine agents, done criterion from 0 to 4, and caps. Each lesson points to the track course that goes deeper on the topic.

Dark workbench with a braided cable looped in a knot, a laptop showing a terminal, and a panel with two gauges.
  • 8lessons
  • 6courses in the track
  • 5parts of every loop
  • 2videos

The 6 courses in the track

This is course 0. Each lesson here points to the course that owns the topic. Suggested order: 0 → 1 → 2 → 3 → 4 → 5.

  1. Course 0 · you are hereBase: anatomy of the loopThe five parts, the harness, loop engines, LOOP-R, done criterion from 0 to 4, and caps.Open the course
  2. Course 1Verification and evalsA separate, skeptical evaluator, frozen tests, reward hacking, the gold set, and a calibrated judge.Open the course
  3. Course 2Long-running executionThe seven-file kit, goal.md level 3+, context in bands, handoff, headless loop, and measurement.Open the course
  4. Course 3Multi-agent and orchestrationWhen not to use it, subagents, generator × evaluator, worktrees, queues, and the Claude + Codex team.Open the course
  5. Course 4Security for the autonomous loopLethal trifecta, Rule of Two, injection through the content it reads, guard hooks and sandbox.Open the course
  6. Course 5The loop that learnsHypothesis with a number, experiment, promotion and rollback, lessons, and the risk of optimizing against the meter.Open the course

The lessons

From concept to your first running loop: the pieces, what sits around the model, the engines, LOOP-R, state, criterion, caps, and the final practice.

  1. Lesson 1 · 15 minThe loop in 5 pieces: goal, state, action, check, stopEvery agent loop that works has the same five pieces, from /goal to the shell loop. When a loop fails, almost always one is missing: it doesn't say where it wants to get, it forgets where it was, it approves itself, or it doesn't know when to stop. Here you learn to see the five and run a toy loop, with no model, that shows them.
  2. Lesson 2 · 15 minHarness: what sits around the modelThe model alone only predicts text: it doesn't remember, can't see your files, can't act and can't check. The one doing the work in Claude Code and Codex is the harness, the program around the model. When the agent fails, the useful question is almost never "try again": it's which piece of the harness is missing. In this lesson you take inventory of yours.
  3. Lesson 3 · 18 minToday's loop engines: /goal, /loop, Ralph, routines, codex execThere are five common ways to put an agent in a loop, and they answer two questions differently: what triggers the next turn and who decides when to stop. Choosing wrong gets expensive: a /loop waiting for a condition that never comes, a /goal that believes what the agent said. Here is only what the official documentation confirms, read on 10/19/2026.
  4. Lesson 4 · 18 minLOOP-R: the five letters and the nine agentsAn agent that evaluates its own work tends to approve itself. LOOP-R, the open INEMA framework that gives this track its name, solves this by separating roles: nine agents, each with what it reads, what it writes, what it decides and what it never does. The five letters give the order of the method. Here you see the design; promoting and rolling back versions belongs to course 5.
  5. Lesson 5 · 16 minState outside the model: files and git as memoryIn a long loop, the model's context will be compacted, reset, or swapped for a fresh session. What only existed in the conversation vanishes or comes back as a summary, mixing fact and guess. The way out: disposable session, state in files and in git, and every cycle starts by rereading. You build a cycle like this and interrupt it on purpose.
  6. Lesson 6 · 16 minDone criterion on the 0–4 scaleA loop ends when the done criterion says it ended. If the criterion is vague, the loop never ends or ends too early; if it can be met by a shortcut, the agent finds the shortcut: it deletes the test that was failing, generates an empty page. The 0-to-4 scale of the execucao-longa kit names each step and shows the minimum accepted: level 3, a command with a lock.
  7. Lesson 7 · 17 minCaps and stopping: turns, time, memory, stagnation and costA good criterion guarantees the loop doesn't exit too early; it doesn't guarantee that it exits. An impossible goal, an agent stuck on the same error, a process that eats the machine's memory: only a cap stops it. In this lesson you learn the five caps, watch each one stop a real process, and practice the hardest decision: when the agent asks for just one more try.
  8. Lesson 8 · 20 minYour first loop: a small goal with a level 3 criterionTime to put the pieces together in a real loop, small on purpose: a word-counting function, six tests frozen with a hash, and a level 3 /goal condition with a turn cap. Small enough to finish in minutes; complete enough to have all five pieces. At the end, the map of the track and your plan with dates.

Who it's for

  1. 1People who already use Claude Code or Codex in the terminal and want the agent to work on its own for more than one turn.
  2. 2People who have seen the agent say "done" with no proof, or spin on the same error until the quota runs out.
  3. 3People who will take the LOOP-R Engineering Track and need the shared vocabulary of the six courses.

What you'll be able to do

  1. 1Point out the five pieces in any loop and say which one is missing.
  2. 2Choose between /goal, /loop, Ralph, routines and codex exec based on what each one does and doesn't do.
  3. 3Rate a done criterion from 0 to 4 and rewrite the vague one up to level 3.
  4. 4Run your first loop with frozen tests, a turn cap and proof in the output.

Before you start

  1. 1Linux or macOS with bash, git and Python 3 (pytest for lesson 8).
  2. 2Claude Code or Codex installed and signed in through your subscription. The practices in lessons 1, 5 and 7 don't use any quota.
  3. 3No previous course needed: this is the entry point of the track.