The Lab · Vault · Blueprint · About an hour

A goal it can finish. A loop you keep.

Teach your agent what done looks like and when to stop. Watch a loop run and stop it yourself. Then keep one loop: a weekly pass that grows your library, with nothing filed without your yes.

Series
Runs on its own, part 1 of 2.

Next: Heartbeats and Scheduled Jobs. Each part works on its own.

In plain English

Most of what you ask an agent is a prompt: you ask once, it answers once. This blueprint teaches the next step. A goal tells your agent what done looks like, how to check it, and when to stop even if it isn't done. A loop runs that work again: you, the clock or an event starts it, it does the work, writes down what it did, and waits. Your agent shows you one loop to watch and stop, asks you the questions for a goal for one of your own jobs, and runs it once. Then it sets up the loop you keep: once a week it reads what changed in your workbench and proposes a few short notes for your library. You approve, edit or skip each one.

What you get

A seven-line goal for one job of yours, run once. A loop you watched and stopped yourself. A weekly library pass with its first notes filed and its first receipt written.

Why it matters

The less you watch your agent work, the more you rely on a clear goal and a receipt. And what you learn this week is only useful next month if it landed somewhere you can find it.

How it works

A loop has five parts: trigger, goal, work, receipt, sleep. A goal has seven lines. Your library pass uses both, and it stops for your ruling on every note.

Your seat

You type every /loop and /goal, and you stop them. You write your goal; the agent only asks and gives a second opinion. You rule on every note.

A prompt asks once

A loop knows when to keep going, when to stop, and how to prove it. Every loop has the same five parts, in the same order.

  • Trigger. What starts it: you, the clock, or something that happens.
  • Goal. What done means for this pass. Without it, a loop is only repetition.
  • Work. The thing it does: look, think, act, check, as many times as the job needs.
  • Receipt. Proof it happened, written down, checkable later. The part people leave out, and the reason nobody trusts a loop without one.
  • Sleep. It stops and waits for the next trigger.

Loops differ by what starts them again. There are four kinds.

  • Turn based. You say something. It answers, then waits for you. Every normal chat.
  • Goal based. It keeps going until its done check passes, or its limit hands it back to you. /goal.
  • Time based. The clock. /loop in Claude Code, or a scheduled routine.
  • Proactive. Something happens, like an email arriving. Not in this blueprint.
Note
A goal is not a schedule.

A goal says when the work is done. A schedule says when the work starts. A loop can have one, the other, or both.

Watch one loop

Reading about a loop isn't the same as watching one sleep and wake up. So you start one somewhere harmless, watch two beats, and stop it yourself.

You'll see
In Claude Code, these are the lines you type, in order.
/loop 5m List the files in this workbench that changed in the last 5 minutes,
leaving out .git. Change nothing and write nothing. Then name this beat's
five parts, one line each: trigger, goal, work, receipt, sleep.

what scheduled tasks do I have?    # the loop and its next run
cancel the loop                     # after two beats, you stop it
what scheduled tasks do I have?    # proof: the list is empty

/loop 5m <prompt> runs on a fixed interval. /loop <prompt> with no interval lets Claude pick the pace each time. Two beats take about ten minutes.

Know this
Esc doesn't stop this one.

Esc stops a self-paced loop, the kind with no interval. A loop with an interval keeps running until you ask Claude to cancel it, or you close the session. Left alone, it expires after 7 days.

In Codex, there is no /loop. You watch a goal based loop instead, and stop it the same way you will stop your own goal.

/goal List the five most recently changed files in this workbench, leaving out
.git, with the date each changed. Change nothing and write nothing. Done when
the list is in the chat. Stop after 3 turns.

/goal          # status
/goal clear    # you stop it

A loop you have stopped yourself is a loop you aren't afraid of.

A goal an agent can finish

The goal is part two of a loop. The seven lines are how you write it well: five parts, then a limit, then what to do if stuck.

  • Task. What work the agent owns, in one job.
  • Why. What the result is for. It helps the agent make good calls when something is unclear.
  • Outcome. What is true when it's done. The result, not the steps.
  • Constraints. What must not happen, and what waits for your yes.
  • Verification. A done check: a test someone else could repeat and get the same answer.
  • Limit. When to stop even if it isn't done: so many turns, minutes or dollars.
  • If stuck. One line: stop and tell me, and when.

Then you judge it. Each line has one test, and you mark it pass or fail before your agent says anything.

  • Task: is it one job, with a start and an end?
  • Why: does it say who the result is for?
  • Outcome: is it the finished result, not the steps?
  • Constraints: does it name what must not happen, and what waits for you?
  • Verification: could someone else run the check and get the same answer? "Looks good" fails.
  • Limit: does it say when to stop even if it isn't done?
  • If stuck: does it say to stop and tell you, and when? "Keep trying" fails.
You'll see
Then you run it once, with /goal.
/goal <your seven lines>    # up to 4,000 characters, one goal per session
/goal                       # status: how long, how many turns, the latest reason
/goal clear                 # removes it before it finishes

In Claude Code, after each turn a small model reads the chat and judges whether your goal is met. It doesn't open files, so write a check the agent has to show in the chat: a count, a list, each fact with its source. Put the limit in as a number, like "or stop after 20 turns". It uses your plan's usage like any chat. The limit line is what keeps a goal from running long. Codex has /goal too, with edit, pause and resume as well as clear.

Note
Your agent never writes your goal for you.

It asks the questions one at a time, and gives a second opinion on your marks. Writing it is the practice. Verification fails most often: "it reads well" is an opinion; "every date matches the calendar" is a check.

The loop that grows your library

This is the one you keep. Once a week it reads what changed in your workbench since its last receipt, and proposes up to five short notes for your library. Its goal, in seven lines:

  • Task. One library pass: read what changed since the last receipt, and propose notes from it.
  • Why. So what you learn this week is still findable next month, by you and your agent.
  • Outcome. The useful things you learned this week are filed, up to five a pass, as one short note each in library/notes/, and the rest wait on the receipt.
  • Constraints. Up to five proposals. Nothing filed without your approve. No passwords, keys or other people's details in a note.
  • Verification. The receipt puts every changed file under exactly one heading, and the counts add up.
  • Limit. One pass of up to five proposals, or 30 minutes.
  • If stuck. Stop and tell you when a file can't be read, or looks like it holds a secret.

You change any line to fit you: the day, the number of notes, the folders it reads. Then the first pass runs with you watching.

  • It shows you what changed before it reads anything: the count and the list. On the first pass, the blueprint files it just copied show up too; they go under "not worth a note".
  • It proposes notes, one at a time on the first pass. Each has a title, two to five sentences, and the files it came from.
  • You say approve, edit or skip. Approve files it as shown. Edit files your version after you say yes. Skip files nothing, and the reason goes on the receipt.
  • It writes the receipt in work/goals-and-loops/receipts/: when it ran, what it proposed, what you approved, what it skipped and why, what waits for next week.
  • It checks its own goal out loud: every changed file accounted for, the counts adding up.
Note
This pass is turn based on purpose.

It stops and waits for you on every note. /goal would keep going without you, so the library pass doesn't use it. Its goal still shapes the work, and its receipt checks it.

Each week after that, you open your workbench on your day and paste one line. The pass reads its last receipt and starts where it stopped. Skip a week and nothing is lost; the next pass just has more to read.

Run my library pass. Read work/goals-and-loops/library-loop-prompt.md end to end and follow it.

What you can ask your agent, from now on

Five asks that work once you have done the blueprint.

Judge my goal

Here is a goal I wrote for one job. For each of the seven lines, tell me whether it meets its test in work/goals-and-loops/goal-tests.md and quote the words you judged. Don't rewrite any of it.

Is anything running?

Do I have any loops, goals or scheduled tasks running in this session? List each one, what starts it, and how I stop it.

My library pass

Run my library pass. Read work/goals-and-loops/library-loop-prompt.md end to end and follow it. I'll rule on the proposals as a batch this time.

What did it file?

Read my last three library-pass receipts. Tell me what got filed, what I skipped most often and why, and what has been waiting the longest.

Make this a loop

I do this job every week. Ask me one question at a time until we can name its five loop parts and its seven goal lines. I write the lines. Change nothing and schedule nothing.

Words you now own

  • Loop. Work that runs again: a trigger starts it, it works toward a goal, writes a receipt, and sleeps.
  • Trigger. What starts a loop: you, the clock, or something that happens.
  • Beat. One run of a loop, from waking to sleep.
  • Receipt. The written proof a pass ran: what it did, what it skipped, and why. Checkable later.
  • Done check. The verification line: a test anyone could repeat to prove the work is finished.
  • Limit. When to stop even if the work isn't done.
  • If stuck. The line that says stop and tell me, and when.
  • Turn based, goal based, time based, proactive. The four kinds of loop, by what starts them again.
  • /loop. Claude Code's command to run a prompt on repeat while the session is open.
  • /goal. The command, in Claude Code and Codex, that keeps the agent working until a condition is met.
  • Routine. A scheduled run that starts a fresh session on its own, on this computer or in the cloud.

Before you leave one running

Before any loop runs without you watching, you can answer four questions about it.

  • What starts it? You, a clock, or an event. Name it.
  • What may it touch? Which folders it reads, which it writes, and what waits for your yes.
  • Where is its receipt? If you can't check a pass you didn't watch, you are only hoping it worked.
  • How do you stop it? Know the stop before the start, and try it once.

Scheduling is the next part of this series: Heartbeats and Scheduled Jobs puts a job on your computer's own scheduler, with a receipt that proves each run. Here is what to know first. A /loop stops when you close the session and expires after 7 days, so it isn't for a weekly job. In the Claude desktop app, Routines come in two kinds: a local task works with your files but runs only while the app is open and the computer is awake; a cloud routine runs with the computer off but starts from a fresh copy and can't see the files on this computer. Codex scheduled tasks exist only in ChatGPT on the web and in the desktop app. Any scheduled run wakes up blank, which is why your library pass carries its own briefing.

Never
Never let a loop write to your library on its own.

Every note waits for your approve, edit or skip, on a schedule or not. A scheduled pass could get proposals ready for you; it never files them.

Fair questions

FAQ
Why won't my agent write the goal for me?

Writing it is the practice. You know what done looks like for your job; the agent can only guess. It asks the questions and tells you which tests each line meets.

FAQ
My goal never stopped.

Type /goal clear. Then look at two lines. The check has to show up in the chat, because that is all the judge reads. And the limit needs a number of turns or minutes.

FAQ
I use Codex. Am I missing out?

Only on the /loop watch. You watch a goal run instead, and the goal, the library pass and the receipts work the same in both apps.

FAQ
What counts as useful enough for a note?

Anything you would want to find again in a month: a decision and its reason, a fix that worked, a fact you had to look up, a step you keep forgetting. You decide on every proposal.

FAQ
What comes next?

Heartbeats and Scheduled Jobs, part 2 of this series, puts a loop on your computer's own scheduler, so it runs while you are away.