# Getting started with loops — Claude Code loop design (thread)
> [!question] Lingering Questions
> - Does "quantitative checks are easier to self-verify" hold for judgment-heavy loops (e.g. this synthesis pass) or only for code/build loops with a pass/fail signal?
> - How much of "encode it to improve the system" is realistic to sustain without a human periodically pruning the accumulated rules?
> [!tip] Article Ideas
> - A short piece on the three loop-hardening moves in this thread (quantify checks, fresh-context reviewer, encode every catch) as a checklist for any new automation.
> [!link] Cross Reference
> - [[3. Resources/Permanent Notes/Encoding What Good Looks Like Is What Makes Agent Verification Trustworthy]] — same "encode it into the system" claim, already captured from a different source
> - [[3. Resources/Permanent Notes/The Maker Should Not Grade Its Own Homework]] — same fresh-context-reviewer argument
> - [[3. Resources/Permanent Notes/A Nondeterministic Check Breaks the Loops Stop Condition]] — sibling loop-design constraint (determinism vs. self-verifiability)
> [!quote] Vocabulary
> - *Loop* — an agent repeating cycles of work until a stop condition is met
> - *Turn-based loop* — a loop whose steps are encoded as manual SKILL.md instructions rather than a script
## Metadata
- Source: [[3. Resources/Readwise/Articles/Getting Started With Loops — Claude Code Loop Design]]
- Author: @ClaudeDevs (delba_oliveira)
- URL: https://twitter.com/ClaudeDevs/status/2074208949205881033#thread
## Author's thesis
An agent loop's reliability comes from the system encoded around it — quantitative, self-checkable verification steps; a second reviewer with fresh (unbiased) context; and a discipline of encoding every failure into a system-wide rule rather than a one-off fix — not from the loop mechanism itself.
## Key arguments
1. Loops are defined precisely as repeating cycles of work until a stop condition — the definition matters because it forces every loop design to name its stop condition explicitly.
2. Quantitative checks are what make self-verification tractable for an agent; vague or qualitative checks don't give the agent a clean pass/fail signal.
3. Fixing a failure isn't enough — the fix has to be encoded back into the system (a rule, a check, a template) so future iterations inherit the correction.
## Claim atoms
### Loops repeat work until a stop condition
> [!quote] ID:rw_01kx4nm310hydqkcvkta93dvrq
> we define loops as agents repeating cycles of work until a stop condition is met
Where/why: opening definition of the piece; gives a precise definition to tag loop-registry rows against (trigger/stop/primitive/task). #xref
### Quantitative checks make agent self-verification easier
> [!quote] ID:rw_01kx4nm310hydqkcvkta93dvrq
> The more quantitative the checks, the easier it is for Claude to self-verify.
Where/why: turn-based loops section, on encoding manual steps as SKILL.md; directly supports script-first checks in a maker/checker design. #xref #addendum
### A fresh-context second agent reviews less biased
> [!quote] ID:rw_01kx4nm310hydqkcvkta93dvrq
> use a second agent for code reviews (a reviewer with fresh context is less biased)
Where/why: maintaining code quality section; external validation of the blind-checker pattern (checker never re-reads the maker's draft). #xref #addendum
### Encode failures into the system, not one fix
> [!quote] ID:rw_01kx4nm310hydqkcvkta93dvrq
> When a result doesn't meet the standard, don't stop at fixing the individual issue — encode it to improve the system for all future iterations.
Where/why: maintaining code quality section; the operational core of "encode what good looks like" — every checker catch becomes a rule. #xref #aphorisms
## Permanent candidates
- **Already captured**: [[3. Resources/Permanent Notes/Encoding What Good Looks Like Is What Makes Agent Verification Trustworthy]] covers the "encode it into the system" claim from a different source (Fiona Fung/Anthropic). [[3. Resources/Permanent Notes/The Maker Should Not Grade Its Own Homework]] covers the fresh-context-reviewer claim. No new Permanent created — this source's claims land inside notes that already exist; connected instead of duplicated.
## Processing checklist
- [ ] Tag loop-registry rows by loop type (turn/goal/time/proactive) per this thread's taxonomy
- [x] Connect into the relevant MOC — [[3. Resources/MOCs/AI Agent Safety MOC]]
## Links
- [[3. Resources/MOCs/AI Agent Safety MOC]] — loop-verification discipline is a safety-of-autonomy concern
- [[3. Resources/Permanent Notes/Encoding What Good Looks Like Is What Makes Agent Verification Trustworthy]] — evidence-for the same claim, different source
- [[3. Resources/Permanent Notes/The Maker Should Not Grade Its Own Homework]] — evidence-for the fresh-context-reviewer claim
- [[3. Resources/Permanent Notes/A Nondeterministic Check Breaks the Loops Stop Condition]] — sibling constraint on the same loop-design problem
- [[3. Resources/Permanent Notes/Automated Guard Rails Should Match Mechanical Verifiability]] — speaks to the lingering question on quantitative checks: mechanical checks belong in the loop, and judgment-heavy steps stay with a reviewer
- [[3. Resources/Permanent Notes/A Reviewers Point of View Is Context Plus a Stance]] — what makes the second, fresh-context reviewer useful: domain context plus a stated stance, not fresh context alone
- [[3. Resources/Permanent Notes/Prompt Context Harness and Loop Are Separate Agent Control Problems]] — places this thread's loop-hardening moves as the loop layer among four control layers, each with its own failure mode