Skip to content
You commented “LOOP”: here it is

Loop Engineering: The Autonomous Claude Workflow Template

Fill in this loop template with a scoring rubric and Claude runs a task end-to-end, self-evaluates, and iterates without babysitting.

Free template · copy-paste ready · built by the BrainVaultAI team

A loop is an autonomous Claude task that runs, scores its own output against a rubric, and either delivers a result or iterates. You set the goal, the rubric, and the exit condition. Claude runs until it meets the bar. This template works for content creation, research tasks, code generation, and analysis. The scoring rubric is the critical piece, without it, Claude has no exit condition and will either stop too early or spin indefinitely. The two-prompt structure separates the task prompt from the evaluator prompt. Running them as separate Claude instances is cleaner, the evaluator doesn't have the generator's reasoning in context, so it scores more honestly.

Loop Generator Prompt
You are a generator agent. Your job is to complete the task below and output a result that will be scored by a separate evaluator. TASK: [DESCRIBE THE TASK IN DETAIL] CONSTRAINTS:
- [CONSTRAINT 1]
- [CONSTRAINT 2]
- [FORMAT REQUIREMENT] CRITICAL: Do not explain your reasoning in the output. The output IS the deliverable. No preamble, no 'here is my response.' Just the work. After your output, add one line: SELF-SCORE: [your honest estimate of quality 1-10] and WEAKEST_POINT: [the one thing most likely to get dinged by an evaluator]
Loop Evaluator Prompt + Rubric
You are a strict evaluator. Score the output below against this rubric. Do not consider the effort behind it, only the result. RUBRIC:
| Criterion | Weight | What a 10 looks like |
|---|---|---|
| [CRITERION 1] | [X]% | [DESCRIPTION] |
| [CRITERION 2] | [X]% | [DESCRIPTION] |
| [CRITERION 3] | [X]% | [DESCRIPTION] | For each criterion: score 1-10, one sentence on why.
Calculate weighted total score.
If score < [YOUR THRESHOLD, e.g. 80]: output ITERATE and list the top 2 changes that would raise the score most.
If score >= [YOUR THRESHOLD]: output ACCEPT. OUTPUT TO EVALUATE:
[PASTE GENERATOR OUTPUT]
Loop Controller Prompt (orchestrator)
You are running a loop to produce [TASK GOAL]. Here are the rules: 1. Run the generator prompt. Capture output.
2. Run the evaluator prompt on that output. Capture score and verdict.
3. If verdict is ACCEPT: stop and deliver the final output.
4. If verdict is ITERATE: run the generator again, this time prepending: 'Previous attempt failed evaluation. Evaluator feedback: [PASTE FEEDBACK]. Address these specific issues.'
5. Maximum iterations: 3. If you hit 3 without ACCEPT, deliver the best attempt and flag it. Start now. Do not ask for clarification. Run the loop.

Want the editable version?

We'll send the editable version of this asset, plus a short series of our highest-leverage AI plays for operators. No spam. Unsubscribe in one click.

Free. No spam. Unsubscribe in one click. By submitting you agree to receive emails from BrainVaultAI.

More free AI guides in the full library · follow @brainVaultAI