Lesson 2 - Anatomy of a Loop

Welcome to Anatomy of a Loop

In Lesson 1 you saw that real work is a loop, not a single answer. Now let’s take that loop apart and name its pieces, because once you can name them you can engineer them — improve one, notice when one is missing, and diagnose why a loop is misbehaving. The good news is that every loop, no matter how simple or how automated, is built from the same five parts. Learn them once here and you’ll recognize them in a chat window, in a command-line agent, and in your own head.

By the end of this lesson, you will be able to:

  • Name the five parts of a loop: goal, attempt, check, correct, stop
  • Explain what each part is responsible for
  • Describe why the check is the hinge the whole loop turns on
  • Trace a real Harborlight task through all five parts

Let’s walk the loop one part at a time.


The Five Parts

Here’s the whole shape. Keep this picture in mind for the rest of the course — every technique you learn is really about strengthening one of these five parts.

A flowchart of a loop's five parts. 'Goal' (the outcome you want) flows down into 'Attempt' (the AI produces a draft), which flows into 'Check' (does it meet the goal?). From Check, a 'no' arrow goes left to 'Correct' (fix the gap, try again), and a dashed arrow loops from Correct back up to a new Attempt. A 'yes' arrow goes right from Check to 'Stop' (done — deliver the result). A caption notes the check is the hinge: it decides whether the loop corrects again or stops, and that a weak check corrects forever or stops too soon on a false 'done'.
The five parts of a loop. The check is the hinge: it sends the loop back to correct, or forward to stop.

Read it as five parts that connect in a cycle:

  1. Goal — the outcome you want, clear enough that you’d know it when you saw it. This is the finish line. Without it, nothing downstream works.
  2. Attempt — the AI’s best shot at the goal given what it knows so far. The first attempt is usually rough; that’s expected and fine.
  3. Check — the moment you compare the attempt to the goal and decide: is this good enough, or not? This is where quality is actually decided.
  4. Correct — if the check says “not yet,” you feed back what’s wrong so the next attempt is better. Correction is targeted; it fixes the specific gap the check found.
  5. Stop — when the check says “good enough” (or a limit says “enough”), you end the loop and deliver the result.

Why the Check Is the Hinge

Look at the diagram again and notice where all the arrows meet: the check. Every trip around the loop passes through it, and the check alone decides which way the loop turns — back to another correction, or forward to a stop. That makes it the single most important part, and it’s the idea this whole course is built on: a loop is only as good as its check.

Here’s why that’s true and not just a slogan. If your check is too weak, two bad things happen. Either it never says “good enough” — because it has no clear standard — and the loop polishes forever, burning your time and money. Or, worse, it says “good enough” when the work isn’t — a false done — and you ship something broken with full confidence. Both failures are check failures, not prompt failures. You can have a brilliant attempt and still fail, if the check can’t tell good from bad.

Note

This is the reverse of most people’s instinct. Beginners spend almost all their energy on the attempt — crafting the perfect prompt — and almost none on the check. This course deliberately flips that. Module 3, the core of the course, is entirely about building checks that work.


Correction Is Not the Same as “Try Again”

A quick but important distinction. When the check finds a gap, the fix isn’t to say “no, do better” and hope. That’s just rolling the dice on a fresh attempt. Real correction is specific: it names what was wrong so the next attempt targets it. “The newsletter is 400 words; our limit is 250, so cut the middle section” is a correction. “Make it better” is not.

Vague correction is one of the most common reasons a hand-run loop drifts. Each round you give a fuzzy nudge, the AI changes something semi-random, and you slowly wander away from the goal instead of toward it. Good correction closes the exact gap the check found — nothing more, nothing less. You’ll get lots of practice at this once you’re building checks in Module 3.


The Fifth Part Everyone Forgets: Stop

Most people can name goal, attempt, check, and correct — those feel like the “doing” parts. The one that gets left out is stop, and leaving it out is exactly why loops go wrong in the two opposite directions you’ll keep meeting: quitting too early, or grinding forever.

The fix is to realize a loop actually needs two stop conditions, not one.

  • The success stop — the loop ends because the check says “good enough.” This is the finish you want, and it’s only as trustworthy as the check behind it. A strong check gives you a clean success stop; a weak one gives you a false “done.”
  • The safety stop — the loop ends because a limit is hit: a number of rounds, an amount of time, or a budget of money. This is your insurance against a check that never says “done.” Without it, a loop with a fuzzy goal or a weak check has no reason to ever end — it just keeps correcting, and if an automated agent is running it, keeps spending.

Decide both before you start: what “done” looks like (success stop) and the limit at which you’ll walk away even if it isn’t done (safety stop). A newsletter loop might be “stop when all four goal items are met, or after four rounds, whichever comes first.” That single sentence prevents both failure modes at once. You’ll design stop conditions properly in Module 6 — for now, just never let a loop run without both.


A Loop for a Real Task

Let’s trace all five parts through something concrete: writing this week’s Harborlight newsletter.

  • Goal: a 250-word, friendly newsletter featuring this week’s poetry night and the new local-authors table, ready to send.
  • Attempt: you ask Claude for a draft. It comes back warm and readable — but 380 words and it invented an author name.
  • Check: you compare it to the goal. Two gaps: too long, and a made-up fact. Not done.
  • Correct: you tell it exactly that — “cut to 250 words; remove the author name, we only have the event, not a headliner.”
  • Attempt (again): a tighter 250-word draft with the invented name gone.
  • Check: length is right, no invented facts, tone fits. Good enough.
  • Stop: you send it.

Two rounds, and notice that the check is what turned a rough first draft into a sendable newsletter. The prompt barely changed. The quality came from checking against a clear goal and correcting the specific gaps.


Practice Exercises

Exercise 1: Label the parts

Someone asks Claude to summarize a report, reads the summary, notices it missed the budget section, says “you left out the budget — add a line on it,” gets a better version, and saves it. Label each of the five loop parts in that story.

Hint

Goal: a summary that includes the budget. Attempt: the first summary. Check: “it missed the budget.” Correct: “add a line on the budget.” Stop: saving the better version once it’s complete.

Exercise 2: Weak check, spot the failure

A loop’s only check is “does this read well?” for a factual company report. Which loop failure is this check most likely to cause, and why?

Hint

A false done. “Reads well” measures fluency, not accuracy — so a smooth, confident, factually wrong report passes the check. The loop stops satisfied while the real goal (correct information) is unmet.

Exercise 3: Turn a nudge into a correction

Rewrite this vague nudge as a specific correction: “make the event flyer better.”

Hint

Anything that names the gap works, e.g. “The date is missing and the tone is too formal — add ‘Saturday, March 14, 6pm’ and make it sound warm and casual.” A correction points at a specific gap; “better” points at nothing.


Summary

Every loop is built from five parts: a goal (the outcome you want), an attempt (the AI’s draft), a check (comparing the attempt to the goal), a correction (a specific fix for the gap the check found), and a stop (ending when it’s good enough or a limit is hit). The check is the hinge: every trip around the loop passes through it, and it alone decides whether to correct again or stop — which is why a loop is only as good as its check. A weak check either loops forever or stops on a false “done”. And correction must be specific, naming the exact gap, not a vague “do better” that lets the loop drift.

Key Concepts

  • Goal — the clear outcome that acts as the loop’s finish line.
  • Attempt — the AI’s current draft toward the goal.
  • Check — the comparison of attempt to goal; the hinge of the loop.
  • Correct — a specific fix aimed at the gap the check found.
  • Stop — ending the loop on success or a limit.
  • False done — when a weak check declares success on work that isn’t actually done.

Why This Matters

Naming the five parts gives you a diagnosis kit. When a loop misbehaves, you don’t flail — you ask which part is broken: fuzzy goal, weak attempt, bad check, vague correction, or no stop rule. Nine times out of ten at work, the culprit is the check or the goal, not the prompt. Next, you’ll turn the lens on yourself and see that you’ve been running this exact loop by hand all along — and exactly where the manual version breaks down.


Continue Building Your Skills

You can now take any loop apart into goal, attempt, check, correct, and stop — and you know the check is where quality lives. That vocabulary is your diagnosis kit for the rest of the course. Next, let’s catch you in the act of running this loop by hand.

Sponsor

Keep DATATWEETS free. Help fund practical data, AI, and engineering lessons for learners worldwide.

Buy Me a Coffee at ko-fi.com