Skip to content
Loop Engineering Tools

Loop Engineering for Safe, Verifiable Workflows

Loop Engineering helps you build copyable AI agent workflows with evidence, stop rules, budget limits, fallbacks, and human approval gates.

Start with the goal generator, choose a verified template, or check whether a task is ready for Claude Code, Codex, Cursor, GitHub Actions, or another agent.

Browser-only generators
Copyable outputs
Explicit stop rules
Human approval gates
Works with
Claude CodeCodexCursorGitHub ActionsRalphify
free

Changing task type replaces workflow fields after confirmation.

Require human approval before merge / deploy
Ready to copy
claude-goal.txt
/goal Fix the failing CI checks for this pull request with the smallest safe change.
 
Task type: CI Fix
Target tool: Claude Code
 
Work toward this goal until all validation checks pass or the stop rule is reached.
 
Design hypothesis:
A small, isolated CI fix loop can repair this pull request faster than a broad manual investigation, as long as validation and review stay separate.
 
Smallest useful run:
Run one pass against the latest failing CI job only. Do not expand to unrelated lint warnings, refactors, or cleanup work.
 
Loop cycle:
1. Discovery — Read the latest CI failure, related pull request comments, and recent commits before choosing the next action.
2. Handoff — Assign the work to one coding agent in an isolated branch or worktree. Keep the final merge decision with a human reviewer.
3. Verification — A separate reviewer checks the diff, confirms validation results, and rejects shortcuts such as deleting tests or weakening checks.
4. Persistence — Write a short run note with the error seen, files changed, checks run, and the next recommended action.
5. Scheduling — Run manually for each failing pull request. Move to a scheduled check only after the loop is reliable.
 
Context:
Prefer small focused changes. Reproduce the current failure and read existing project patterns before editing.
 
Validation:
Run the exact failing command first, then run the project's complete required checks.
 
Validation evidence:
Capture the failing command before the fix, the passing command after the fix, and a short note explaining what changed.
 
Independent checker:
A separate reviewer checks the diff, confirms validation results, and rejects shortcuts such as deleting tests or weakening checks.
 
Boundaries:
Do not delete tests.
Do not bypass lint or type checks.
Do not modify unrelated files.
Do not merge without human approval.
 
Stop rule:
Stop when all validation commands pass, or after 5 failed iterations.
Maximum iterations: 5
 
Budget:
Example only: stop before exceeding the agreed per-run token budget.
 
Human approval:
Required before merge, deploy, delete, purchase, or external communication.
 
Fallback:
If blocked, summarize the current errors, attempted fixes, and recommended human decision.
 
Loop Validation Log:
- Hypothesis: A small, isolated CI fix loop can repair this pull request faster than a broad manual investigation, as long as validation and review stay separate.
- Smallest useful run: Run one pass against the latest failing CI job only. Do not expand to unrelated lint warnings, refactors, or cleanup work.
- Expected evidence: Capture the failing command before the fix, the passing command after the fix, and a short note explaining what changed.
- Actual evidence: [fill in after the run]
- Passed? [yes / no / partial]
- Feedback: After the run, note whether the hypothesis held, what slowed the loop down, and what should change before the next pass.
- Next step: [stop / adjust the loop / run the next pass]
 
Do not delete tests, bypass checks, or modify unrelated files just to satisfy the validation condition. If blocked, stop and summarize the blocker, attempted fixes, and recommended next action.
Copyable prompt only — nothing runs, connects, or executes.Send feedback
01 / Quick context

Loop Engineering turns a one-off agent task into controlled work.

It places a clear goal, evidence, boundaries, memory, budget, stop rules, and human decisions around repeated model work. This page helps you choose what to build; the definition guide explains the full model, origin, examples, and failure cases.

Read the complete Loop Engineering definition
03 / Smallest useful loop

Do not build the perfect workflow first. Prove one small loop.

A strong Loop Engineering workflow starts with a testable hypothesis, a smallest useful run, validation evidence, and a feedback note. That keeps the first run reviewable before you add memory, routing, or scheduling.

01

Hypothesis

State what this run should prove or teach before the agent starts.

02

MVP

Choose the smallest useful run: one source, one goal, one reviewable result.

03

Validation

Name the evidence that counts as success, partial success, or failure.

04

Feedback

Record what changed, what failed, and what the next pass should do differently.

04 / Checker

The agent that makes the thing should not be the only one grading it.

A loop becomes safer when the maker and checker are separate. The checker can be a test suite, a review checklist, another agent, or a human reviewer. What matters is that it can say no.

Audit a Loop
01

Who checks the result?

Name a separate reviewer, test suite, scoring rule, or second agent. The maker should not be the only judge.

02

What does the checker reject?

Call out shortcuts: deleted tests, skipped checks, unrelated edits, vague summaries, or changes that only satisfy the metric.

03

What happens on failure?

A good loop stops, reports the blocker, and asks for a human decision instead of quietly trying forever.

05 / First loop

Start with one small loop you would actually review.

A good first loop is boring in the best way: one source, one goal, one check, one stop rule. For example, read a failing CI run, propose the smallest fix, run the checks, then stop for a human before merge.

  1. 01Pick one discovery source, such as CI failures or open review comments.
  2. 02Write one outcome-based goal and the validation command that proves it.
  3. 03Add a checker that can say no.
  4. 04Set a stop rule, budget cap, and human approval point.
  5. 05Save a short run note so the next pass has memory.
08 / Safety

Loop Safety Checklist

  • Is the goal machine-verifiable?
  • Is the discovery source clear?
  • Is there an independent checker?
  • Can the agent run tests or checks?
  • Are forbidden actions clearly defined?
  • Is there a max iteration limit?
  • Is there a budget limit?
  • Is there a rollback or fallback plan?
  • Is human approval required before merge, deploy, delete, purchase, or external communication?
Audit a Loop
09 / Budget

Token-Aware Loop Engineering

Long-running loops can burn tokens quickly. Good loop design defines max iterations, retry limits, memory strategy, and human review gates before the agent starts.

Define max iterations and retry limits up front
Choose a memory strategy: keep, summarize, or retrieve
Add human review gates before high-risk actions
Estimate Loop Cost
Risk reminders

What goes wrong when a loop runs without judgment

Verification debt

Outputs pile up faster than anyone checks them. The fix is a real checker and a clear human review point.

Comprehension rot

The loop keeps changing things while your mental map falls behind. Read the run notes and review diffs regularly.

Cognitive surrender

The loop sounds confident, so you stop having opinions. Let agents execute; keep judgment with a person.

Token blowout

Scheduled loops multiply cost quickly. Set retry caps, daily limits, and smaller context windows before scheduling.

12 / Feedback

Help improve Loop Engineering templates.

Send feedback, report a broken template, or ask for new loop examples. You can also join the update list for new agent loop templates and safety checklists.

Contact: hello@loopengineering.app

13 / FAQ

Loop Engineering FAQ

Loop Engineering is designing the system around an AI agent — the goal, context, validation, boundaries, budget, stop rule, and feedback — instead of prompting turn by turn.