PromptForge
Prompt library

Critique-and-Revise Loops — Claude

ClaudeAutomation From a course

A loop is simply feeding a model's own output back to it (or to a second prompt) for review and improvement, repeated until a quality bar is met.

The prompt

Write the function requested below. Then, in a second pass, review your own code for edge cases and bugs as if you were a strict senior reviewer, and output a corrected final version.

[paste requirements]

What to replace

Swap these placeholders for your own details before running the prompt:

  • [paste requirements]your own value

Pro tip: Cap every loop at 2-3 iterations. Past that, quality gains flatten and the model can start "over-editing" good answers into worse ones.

How to use this prompt

  1. Copy the prompt using the button above.
  2. Replace [paste requirements] with your own details — the more specific you are, the better the output.
  3. Paste it into Claude and run it.
  4. If the answer feels generic, add constraints: audience, length, tone, and what to avoid. That single change fixes most weak output.

Learn the technique

Critique-and-Revise Loops

Module 1 — What Is a Prompt Loop · Loop & Agentic Engineering

Related prompts