Skip to main content

Prompt collection

50 Loop Prompts for Claude Code

Curated /loop and /goal prompts from the Claude Code community. Verbatim, with author and source. Every prompt copyable in one click.
Showing 50 of 50 prompts
1

Architecture Satisfaction Loop

Code Quality

Use this for deliberate architectural refactoring where the destination can be stated in concrete terms and the current system can be tested after each meaningful change. Combines live testing, independent review, and checkpoint commits to reduce refactor risk.

Refactor until you are happy with the architecture. After each significant step, live-test the system, run autoreview, and commit. Track progress in /tmp/refactor-{projectname}.md.
by Peter Steinberger·Forward Future
2

Clodex Adversarial Review Loop

Code Quality

Use this for meaningful code changes that benefit from independent review and may need multiple structured review-and-fix rounds. Separates builder from reviewer roles and creates a bounded repair cycle with persisted state for resumable work.

Run /clodex [task] think hard --max-iter 5 --threshold medium. Claude plans the task, implements it, opens a pull request, asks Codex for an adversarial review, fixes findings above the accepted severity, and repeats. Keep the branch, PR, findings, verdict, and iteration state resumable. Stop when Codex approves, only accepted findings remain, progress stalls, or the iteration cap is reached. Never describe an errored or exhausted run as approved. Finish with the PR, checks, verdict, and remaining findings.
by Lukas Kucinski·Forward Future
3

Devil's Advocate Loop

Code Quality

Use this before committing to consequential designs like architectures, interfaces, or rollout plans that would benefit from structured adversarial review with documented objections and evidence-based closure.

Before committing to an architecture, interface, or rollout plan, have a critic argue that it is wrong. Record each objection, impact, and status in a repository-local log at .agent-reviews/redteam.md. The builder must fix and verify each high-impact weakness or document why it is accepted; the critic may reopen unsupported answers. Stop when no high-impact objection remains or the same issues repeat for two rounds without new evidence. Finish with the decision, resolved and accepted objections, evidence, and any stalemate.
by Anonymous·Forward Future
4

Customer AI Deployment Loop

Deployment & Ops

Use this when an AI workflow must operate within a real customer process and requires validation, approval, gradual rollout, monitoring, and measurable business outcomes.

Run this when a customer requests an AI workflow, reports a failure, or reaches an operations review. Choose one priority, such as enriching leads, drafting emails, summarizing meetings, or updating a CRM. Define the owner, inputs, approvals, success metric, and ROI hypothesis. Dry-run it on realistic customer data, fix the smallest verified problem, then release through approved stages and monitor production. Finish with the outcome, evidence, customer update, lessons saved, and next review.
by AgentLed.ai Agent·Forward Future
5

Product Update Podcast Loop

Content

Use this when a product releases features frequently enough that users would benefit from recurring audio explanations of changes. Automates turning public product updates into short podcast episodes by collecting release notes, selecting meaningful changes, verifying accuracy, and generating three-to-five-minute episodes with editorial quality control.

Each night, review publicly released product changes and select only those users need to know. Verify each against the product, docs, or release notes. Use the Jellypod MCP to turn the approved changes into a three-to-five-minute podcast explaining what changed, why it matters, and how to try it. Check the script and audio for accuracy, clarity, and pronunciation. If nothing meaningful shipped, make no episode. Ask before publishing. Finish with the draft episode, sources, and review result.
by Pierson Marks·Forward Future
6

Infinite Clickbait Loop

Content

Use this when a video topic and asset set are finalized but the thumbnail requires multiple structured rounds of ideation and evaluation before production begins.

For [video], use [approved assets] to make ten thumbnail concepts. Score each at real YouTube sizes against [inspiration channel] for clarity, curiosity, emotional pull, contrast, and accuracy. Take the top three, improve each one's weakest dimension, and rescore them under the same rubric. Keep iterating the strongest concept until it clears [quality threshold] or [budget] ends. Reject anything the video cannot deliver. Return the winner, two runners-up, previews, final scores, and rationale.
by @Alex_FF·Forward Future
7

War Loops Frontend Designer

Frontend & Visual

Use this when a frontend must be reconstructed from a URL or image and fidelity needs measured across appearance, motion, and responsive behavior rather than judged from a single screenshot. The workflow captures a reference, builds static and moving versions, measures fidelity across multiple dimensions, and applies surgical repairs.

Point War Loops at an authorized URL or image. Capture it with a genuine browser and record the layout, styles, content, motion, and responsive behavior. Build a static Pencil mirror and a moving Forge version. Compare both with the source at desktop, tablet, and mobile sizes; repair only the weakest fidelity signals. Stop when every gate passes, progress stalls, or capture is blocked. Finish with the builds, spec, renders, scores, and remaining gaps.
by Swayam·Forward Future
8

Boeing 747 Benchmark

Frontend & Visual

Use this as a visual benchmark for an agent that can build a complex Three.js scene, inspect its own renders, and improve the result through repeated vision feedback. The camera system turns visual judgment into a repeatable feedback loop where the agent inspects the same angles after every change.

Before building, choose reference images, a scoring rubric, [visual threshold], and [budget]. Build the most realistic Boeing 747 you can from Three.js primitives, then create a rig that screenshots nine repeatable angles. After each change, render and score the same views, have a critic identify the weakest feature, and fix it without regressing stronger views. Keep the best version. Stop at the threshold, stalled progress, or budget. Finish with the model, nine renders, scores, remaining gaps, and run summary.
by @victormustar·Forward Future
9

Fresh Clone Loop

Documentation

Use this to verify that a repository's onboarding instructions genuinely work for new contributors by repeatedly cloning into clean environments, identifying and fixing documentation gaps and hidden assumptions until one uninterrupted run succeeds using only the README.

Clone [repository] into a disposable environment and follow only its README to the documented ready state, such as running the app or building the package. When a step fails or assumes missing knowledge, record the gap, fix the setup or documentation issue, discard the environment, and start again. Carry no dependencies, configuration, credentials, or repairs between attempts. Stop when one uninterrupted fresh clone reaches that state, progress stalls, or [budget] ends. Return exact commands, gaps closed, and remaining blockers.
by 0xUmbra·Forward Future
10

Self-Improving Champion Loop

Optimization

Use this to improve a prompt, policy, configuration, or other testable artifact when cheap iteration is valuable but final acceptance requires fresh evidence to prevent overfitting.

Improve a prompt, policy, or configuration. A support assistant's system prompt is one example. Save the champion, its score, a working set, untouched holdout cases, must-pass checks, and [budget]. Each round, change one thing based on a recorded failure. Promote the challenger only if it beats the champion on holdouts by [margin] without weakening a must-pass check; otherwise keep the champion. Stop at the target, budget limit, or no progress. Return the winner, scores, experiment log, and remaining failures.
by Jose C. Munoz·Forward Future
11

Continuous-Claude Relay Loop

Documentation

Use this when running Claude in a long unattended loop (overnight, multi-hour) and each iteration needs to hand context to the next via a notes file. The relay framing prevents Claude from rewriting the whole feature in one pass and losing progress when the iteration limit hits.

We are building... You should pick one thing to work on from SPEC.md, just one, and read SHARED_TASK_NOTES.md for the current status. If it's bigger than a single focused task, break it into small subtasks and only do the first one. Before you start, jot the breakdown into SHARED_TASK_NOTES.md so the next developer knows what's done, what's in flight, and what's queued. Work the one small piece end-to-end (build, test, verify it actually runs), then update SHARED_TASK_NOTES.md with where you left off, what's next, and any decisions or gotchas worth handing over. This is a relay so don't try to land the whole feature yourself. Leave the baton somewhere obvious for the next dev to grab (no need to commit or push).
by Anand Chowdhary·GitHub
12

Anthropic Ralph-Loop Plugin

Code Quality

Use this for well-defined tasks with clear success criteria that benefit from iteration and automatic verification (tests, linters). The official Anthropic plugin formalizes the Ralph pattern with a completion promise as a clean stop condition and a hard iteration cap.

/ralph-loop "Build a REST API for todos. Requirements: CRUD operations, input validation, tests. Output <promise>COMPLETE</promise> when done." --completion-promise "COMPLETE" --max-iterations 50
by Anthropic (Ralph-Technik von Geoffrey Huntley)·Anthropic / GitHub
13

Kill Flaky Tests Loop

Code Quality

Use this when your CI shows intermittent test failures and you cannot tell which tests are genuinely broken versus flaky. The loop runs your suite repeatedly until five consecutive green runs prove the flakes are fixed or quarantined.

/loop run my test suite 20 times, collect every intermittent failure, fix or quarantine the flaky ones, and don't stop until you get 5 consecutive fully-green runs
by Eric Zakariasson·X
14

Auth Tests /goal (official)

Code Quality

The canonical /goal example from Anthropic's own documentation. Use this when you want Claude to iterate on a focused test+lint slice until both gates are green. The clearest minimal template for newcomers.

/goal all tests in test/auth pass and the lint step is clean
by Anthropic·Anthropic Docs
15

Changelog Sync (Headless)

Documentation

Official non-interactive (headless) /goal example showing how to wrap a goal in `claude -p` so the whole loop runs to completion in a single shell invocation. Use this for cron-like CHANGELOG hygiene without keeping a session open.

claude -p "/goal CHANGELOG.md has an entry for every PR merged this week"
by Anthropic·Anthropic Docs
16

Release Branch Maintenance Loop

Deployment & Ops

Anthropic's official sample for a project-level `.claude/loop.md` that replaces the built-in maintenance prompt. Use this for a long-lived release branch where a bare `/loop` should keep nursing it every iteration (CI red, review comments, quiet status).

Check the `release/next` PR. If CI is red, pull the failing job log,
diagnose, and push a minimal fix. If new review comments have arrived,
address each one and resolve the thread. If everything is green and
quiet, say so in one line.
by Anthropic·Anthropic Docs
17

Dynamic Interval PR Watch

Deployment & Ops

Official example of an interval-less /loop. Claude self-paces between 1 min and 1 h based on PR activity (short waits when CI is moving, longer when it goes quiet). Use this as a low-friction "babysit a PR" pattern that's more token-efficient than fixed polling.

/loop check whether CI passed and address any review comments
by Anthropic·Anthropic Docs
18

Ralph Original One-Liner

Code Quality

The Ur-prompt: a bare bash `while :; do` that pipes a prompt file into a coding agent. The technique Anthropic later shipped as the `ralph-wiggum` plugin. Use this to understand the loop pattern at its most reduced; substitute any agent CLI for `claude-code`.

while :; do cat PROMPT.md | claude-code ; done
by Geoffrey Huntley·ghuntley.com
19

Cursed Compiler Loop

Code Quality

Huntley's actual loop body for building the "cursed" language. Notable for the parallel-subagent pattern, the "search before assuming missing" guardrail, and the all-caps anti-slop clause that has since been widely copied. Use this for a long-running implementation grind with strong anti-placeholder pressure.

0a. study specs/* to learn about the compiler specifications

0b. The source code of the compiler is in src/

0c. study fix_plan.md.

1. Your task is to implement missing stdlib (see @specs/stdlib/*) and compiler functionality and produce an compiled application in the cursed language via LLVM for that functionality using parrallel subagents. Follow the fix_plan.md and choose the most important 10 things. Before making changes search codebase (don't assume not implemented) using subagents. You may use up to 500 parrallel subagents for all operations but only 1 subagent for build/tests of rust.

2. After implementing functionality or resolving problems, run the tests for that unit of code that was improved. If functionality is missing then it's your job to add it as per the application specifications. Think hard.

2. When you discover a parser, lexer, control flow or LLVM issue. Immediately update @fix_plan.md with your findings using a subagent. When the issue is resolved, update @fix_plan.md and remove the item using a subagent.

3. When the tests pass update the @fix_plan.md`, then add changed code and @fix_plan.md with "git add -A" via bash then do a "git commit" with a message that describes the changes you made to the code. After the commit do a "git push" to push the changes to the remote repository.

999. Important: When authoring documentation (ie. rust doc or cursed stdlib documentation) capture the why tests and the backing implementation is important.

9999. Important: We want single sources of truth, no migrations/adapters. If tests unrelated to your work fail then it's your job to resolve these tests as part of the increment of change.

999999. As soon as there are no build or test errors create a git tag. If there are no git tags start at 0.0.0 and increment patch by 1 for example 0.0.1  if 0.0.0 does not exist.

999999999. You may add extra logging if required to be able to debug the issues.

9999999999. ALWAYS KEEP @fix_plan.md up to do date with your learnings using a subagent. Especially after wrapping up/finishing your turn.

99999999999. When you learn something new about how to run the compiler or examples make sure you update @AGENT.md using a subagent but keep it brief. For example if you run commands multiple times before learning the correct command then that file should be updated.

999999999999. IMPORTANT DO NOT IGNORE: The standard libray should be authored in cursed itself and tests authored. If you find rust implementation then delete it/migrate to implementation in the cursed language.

99999999999999. IMPORTANT when you discover a bug resolve it using subagents even if it is unrelated to the current piece of work after documenting it in @fix_plan.md

9999999999999999. When you start implementing the standard library (stdlib) in the cursed language, start with the testing primitives so that future standard library in the cursed language can be tested.

99999999999999999. The tests for the cursed standard library "stdlib" should be located in the folder of the stdlib library next to the source code. Ensure you document the stdlib library with a README.md in the same folder as the source code.

9999999999999999999. Keep AGENT.md up to date with information on how to build the compiler and your learnings to optimise the build/test loop using a subagent.

999999999999999999999. For any bugs you notice, it's important to resolve them or document them in @fix_plan.md to be resolved using a subagent.

99999999999999999999999. When authoring the standard library in the cursed language you may author multiple standard libraries at once using up to 1000 parrallel subagents

99999999999999999999999999. When @fix_plan.md becomes large periodically clean out the items that are completed from the file using a subagent.

99999999999999999999999999. If you find inconsistentcies in the specs/* then use the oracle and then update the specs. Specifically around types and lexical tokens.

9999999999999999999999999999. DO NOT IMPLEMENT PLACEHOLDER OR SIMPLE IMPLEMENTATIONS. WE WANT FULL IMPLEMENTATIONS. DO IT OR I WILL YELL AT YOU

9999999999999999999999999999999. SUPER IMPORTANT DO NOT IGNORE. DO NOT PLACE STATUS REPORT UPDATES INTO @AGENT.md
by Geoffrey Huntley·ghuntley.com
20

Hamel Adversarial Review Loop

Code Quality

Two-phase loop: Claude implements, then a Stop hook spawns up to four independent Codex review agents (diff, holistic, conditional Next.js, conditional UX/browser) and blocks the exit until findings are addressed. Use this for any feature where you want an independent reviewer that hasn't seen Claude's reasoning.

/review-loop Add user authentication with JWT tokens and test coverage
by Hamel Husain·GitHub
21

Slow API Detector Loop

Deployment & Ops

Lightweight log-tailing loop that catches latency regressions without needing an APM stack. Good example of a /loop where the prompt itself defines the observability (no MCP, no extra tooling).

/loop 10m Check API requests in ./logs/access.log from the last 10 minutes. If the average response time exceeds 2 seconds or if any individual request takes longer than 10 seconds, list the details of the slow requests.
by APIYI Technical Team·APIYI
22

Secrets-in-Diff Scanner Loop

Deployment & Ops

A continuous "did I just leak a secret?" guard for solo devs without a paid secret scanner. Hourly /loop diff scan with an alert-only contract, no auto-fix.

/loop 1h scan the git diff from the last hour to check if any API keys, passwords, tokens, or other sensitive information were accidentally committed. Alert me immediately if found
by APIYI Technical Team·APIYI
23

Stale Branch Janitor Loop

Documentation

Daily branch-hygiene loop that suggests safe deletions instead of executing them. Good template for "advisory" /loop prompts where you want a daily nudge but no destructive autonomy.

/loop 24h List all remote branches that haven't been updated in over 30 days, indicate whether they have been merged into main, and suggest which ones can be safely deleted.
by APIYI Technical Team·APIYI
24

Single-Task PRD Ralph Playbook

Code Quality

The "one task per iteration" Ralph variant driven by a PRD JSON. Use this when you have a long spec broken into discrete passing-gated tasks and want strict single-task-per-turn focus to keep the context budget sharp.

You are an autonomous coding agent working on this project.

Your task:
1. Read prd.json to find the highest priority task where passes is false
2. Implement that single task
3. Run tests to verify: npm run typecheck && npm test && npm run build
4. If tests pass, update prd.json to set passes: true
5. Append progress to progress.txt
6. Commit your changes with a descriptive message

Only work on ONE task per iteration.

When ALL tasks in prd.json have passes: true, output <promise>COMPLETE</promise>
by paddo.dev (credits Geoffrey Huntley und Clayton Farr)·Claude Code Masterclass
25

Snarktank Ralph PRD Loop

Code Quality

Ryan Carson's canonical Ralph-PRD variant: an autonomous agent works story by story through a PRD JSON, branches per story, runs quality checks, commits on green, and stops only when every story has `passes: true`. Explicit browser verification for frontend stories and a „Codebase Patterns“ log make the loop production-ready.

# Ralph Agent Instructions

You are an autonomous coding agent working on a software project.

## Your Task

1. Read the PRD at `prd.json` (in the same directory as this file)
2. Read the progress log at `progress.txt` (check Codebase Patterns section first)
3. Check you're on the correct branch from PRD `branchName`. If not, check it out or create from main.
4. Pick the **highest priority** user story where `passes: false`
5. Implement that single user story
6. Run quality checks (e.g., typecheck, lint, test - use whatever your project requires)
7. Update AGENTS.md files if you discover reusable patterns (see below)
8. If checks pass, commit ALL changes with message: `feat: [Story ID] - [Story Title]`
9. Update the PRD to set `passes: true` for the completed story
10. Append your progress to `progress.txt`

## Progress Report Format

APPEND to progress.txt (never replace, always append):
```
## [Date/Time] - [Story ID]
Thread: https://ampcode.com/threads/$AMP_CURRENT_THREAD_ID
- What was implemented
- Files changed
- **Learnings for future iterations:**
  - Patterns discovered (e.g., "this codebase uses X for Y")
  - Gotchas encountered (e.g., "don't forget to update Z when changing W")
  - Useful context (e.g., "the evaluation panel is in component X")
---
```

Include the thread URL so future iterations can use the `read_thread` tool to reference previous work if needed.

The learnings section is critical - it helps future iterations avoid repeating mistakes and understand the codebase better.

## Consolidate Patterns

If you discover a **reusable pattern** that future iterations should know, add it to the `## Codebase Patterns` section at the TOP of progress.txt (create it if it doesn't exist). This section should consolidate the most important learnings:

```
## Codebase Patterns
- Example: Use `sql<number>` template for aggregations
- Example: Always use `IF NOT EXISTS` for migrations
- Example: Export types from actions.ts for UI components
```

Only add patterns that are **general and reusable**, not story-specific details.

## Update AGENTS.md Files

Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files:

1. **Identify directories with edited files** - Look at which directories you modified
2. **Check for existing AGENTS.md** - Look for AGENTS.md in those directories or parent directories
3. **Add valuable learnings** - If you discovered something future developers/agents should know:
   - API patterns or conventions specific to that module
   - Gotchas or non-obvious requirements
   - Dependencies between files
   - Testing approaches for that area
   - Configuration or environment requirements

**Examples of good AGENTS.md additions:**
- "When modifying X, also update Y to keep them in sync"
- "This module uses pattern Z for all API calls"
- "Tests require the dev server running on PORT 3000"
- "Field names must match the template exactly"

**Do NOT add:**
- Story-specific implementation details
- Temporary debugging notes
- Information already in progress.txt

Only update AGENTS.md if you have **genuinely reusable knowledge** that would help future work in that directory.

## Quality Requirements

- ALL commits must pass your project's quality checks (typecheck, lint, test)
- Do NOT commit broken code
- Keep changes focused and minimal
- Follow existing code patterns

## Browser Testing (Required for Frontend Stories)

For any story that changes UI, you MUST verify it works in the browser:

1. Load the `dev-browser` skill
2. Navigate to the relevant page
3. Verify the UI changes work as expected
4. Take a screenshot if helpful for the progress log

A frontend story is NOT complete until browser verification passes.

## Stop Condition

After completing a user story, check if ALL stories have `passes: true`.

If ALL stories are complete and passing, reply with:
<promise>COMPLETE</promise>

If there are still stories with `passes: false`, end your response normally (another iteration will pick up the next story).

## Important

- Work on ONE story per iteration
- Commit frequently
- Keep CI green
- Read the Codebase Patterns section in progress.txt before starting
by Ryan Carson (snarktank)·GitHub
26

Adam Tuttle RALPH Workflow

Code Quality

Strictly one feature per iteration: a PRD walker that gates on `npm run check` plus `npm run test`, and that explicitly raises `<PROMISE>NEED_PERMISSIONS</PROMISE>` instead of silently failing on permission walls. Clean separation of success, permission-stop, and „PRD complete“.

study ./.ralph/prd.json

1. Find the highest-priority item to work on (ignore anything with passes: true) and work only on that item. This should be the one YOU decide has the highest priority - not necessarily the first item in the list.
2. Check that the types check via 'npm run check' (if available) and that the tests pass via 'npm run test' (if available).
3. Update the PRD with the work that was done.
4. Append your progress to the progress.md file. Use this to leave a note for the next person workin in the codebase.
5. Make a git commit of that feature.

ONLY WORK ON A SINGLE FEATURE.
If, while implementing the feature, you notice the PRD is complete, output <PROMISE>COMPLETE</PROMISE>.

If you need additional permissions to complete a task, first double-check that you don't already have the permission. If you have the necessary permission, then proceed to use it. Else print the permissions you need along with <PROMISE>NEED_PERMISSIONS</PROMISE> and exit. I will add them to the .claude/settings.local.json file and re-run.
by Adam Tuttle·adamtuttle.codes
27

Downloads Sorter /goal

Documentation

Sabrina Ramonov's classic loop-engineering entry: countable stop condition („no files left“), explicit safety fences („do not delete anything“), and a hard turn cap. Template for any repetitive file-organization task where the exit is countable.

/goal sort every file in my Downloads folder into subfolders by type (Images, Documents, Videos, Other), keep going until no files are left, do not delete anything, and stop after 30 turns.
by Sabrina Ramonov·sabrina.dev
28

PDF Summarizer /goal

Documentation

Batch-summarize an entire folder of PDFs into one Markdown file. Exit is tied to „every PDF has a summary“, and the source PDFs stay strictly read-only. Clean template pattern for any content extraction with a read-only guarantee on the originals.

/goal write a 5-line plain-English summary of every PDF in the "reports" folder into summaries.md, keep going until every PDF has a summary, do not edit the PDFs, and stop after 40 turns
by Sabrina Ramonov·sabrina.dev
29

Deploy Check Loop (official)

Deployment & Ops

The official fixed-interval /loop example from Anthropic's documentation. Claude checks every five minutes whether a deployment has finished and reports the result. The simplest template for polling on a clear schedule.

/loop 5m check if the deployment finished and tell me what happened
by Anthropic·Anthropic Docs
30

Ticket-to-PR-Ready Loop

Code Quality

Use this when a loosely written ticket, bug report, or customer complaint needs to become a bounded engineering change with enough proof for a fast review. The loop reproduces the failure, proves the root cause, and ships the smallest credible fix with before-and-after evidence.

Take a ticket, bug report, failing behavior, or customer complaint and turn it into a review-ready patch. Reproduce the failure in the smallest representative environment, prove the root cause, make the smallest credible fix, and rerun the original reproduction plus relevant regression tests. If the issue cannot be reproduced after two serious attempts, say so. Do not fold unrelated refactors into the patch. Finish with the cause, changed files, before-and-after proof, risks, and pull-request summary.
by Hiten Shah·Forward Future
31

Loop Harness Verification Loop

Deployment & Ops

Use this for recurring repository tasks such as CI triage, issue grooming, or dependency updates that should run unattended. One Claude session stages the patch and a second verifies it against explicit criteria, so no agent approves its own output.

Use Loop Harness for scheduled repository work such as CI triage, issue grooming, dependency updates, or docs sync. Set [retry limit], then start an isolated git worktree. Let one Claude session stage a patch or outbox message and a second Claude session verify it against explicit criteria. Ship only after a pass; otherwise preserve the findings and retry only within the limit. Finish with the source revision, staged output, verifier result, delivery status, and next run.
by Istasha·Forward Future
32

Five-Minute Repository Maintainer Loop

Deployment & Ops

Use this when an agent coordinates maintenance across several active repositories and the parallel work must stay steerable. Every five minutes it reads each repository thread's latest state without interrupting active work. Work lands only with tests, live proof, autoreview, and green CI.

While repository maintenance is active, wake every five minutes. Triage [repositories] and read each repository thread's latest state. Reuse one thread per repository; assign its highest-value bounded task only within granted permissions, and do not interrupt coherent active work. Require tests, live proof, autoreview, and green CI before work can land. Escalate product, access, security, or irreversible decisions. Record meaningful changes and stop when every item is landed, decision-ready, blocked, or has no work.
by Peter Steinberger·Forward Future
33

Multi-LLM Convergence Loop

Code Quality

Use this for important plans, specifications, documents, or code changes that deserve two independent AI perspectives rather than one model reviewing its own blind spots. The loop only succeeds when both model families approve the same unchanged version.

Review [plan, specification, document, or code change] against [quality bar] for at most [pass limit] rounds. Have one of two genuinely different model families—AI systems from separate providers—review it. Verify each finding and apply only necessary fixes, then give the revised version to the other reviewer. Succeed only when both approve the same unchanged version. Stop at the limit, repeating disagreement (oscillation), unavailable review, or required approval. Return the final work, round log, verdict, and disagreements.
by Donn Felker (@donnfelker)·Forward Future
34

Goal Forge Loop

Documentation

Use this when a rough coding idea is too vague for a long autonomous /goal run. The loop interviews you, then writes SPEC.md with measurable completion checks and GOAL.md with a work plan and approval boundaries. If a key decision is missing, the goal counts as not ready.

Turn [rough coding idea] into two planning files before Codex starts /goal, its long-running task mode. Interview the user, then write SPEC.md: what to build, exclude, and consider, plus measurable done_when completion checks. Write GOAL.md: the work plan, progress scorecard, quick and final checks, memory files, evidence, and approval boundaries. If any key decision, permission, tool, environment requirement, or test is missing, stop as not ready. Do not start implementation without approval.
by michael Guo (@michaelzsguo)·Forward Future
35

Promise-to-Proof Loop

Content

Use this when what a product says it does in marketing, documentation, demos, and AI answers may no longer match what it actually does. Every promise gets labeled proven, partly proven, misleading, unsupported, or outdated.

List every customer-facing promise [product] makes in marketing, documentation, demos, and AI answers. Compare each promise with current product behavior and evidence, then label it proven, partly proven, misleading, unsupported, outdated, or missing evidence. Fix or narrow the riskiest mismatch and rerun the affected check. Repeat until no high-risk unsupported promise remains. Ask before changing production or public copy. Return the promises, evidence, fixes, and decisions needed.
by Felix Haeberle (@felixhaberle)·Forward Future
36

Propagation Compliance Loop

Documentation

Use this after changing something that appears in several places, such as a version number, feature name, count, or rule. The loop searches for the old value, keeps intentional history and examples, and repeats until zero stale matches remain. If one returns, it looks for what regenerates it.

After changing a version, count, rule, name, or configuration, list where the new value belongs and update it. Search the project for the old value and related forms. Review each match: fix real stale values, but keep intentional history, examples, migrations, or compatibility rules. Repeat until zero stale values remain. If one returns for two rounds, stop and identify what may be regenerating it. Return changes, intentional matches, and search output.
by @iamTristan·Forward Future
37

UI/UX Score Loop

Frontend & Visual

Use this for a real task such as signup, login, onboarding, or checkout that can be exercised fully in a browser and scored consistently. Every pass starts from fresh state, is scored with one checklist, and only regression-free improvements are kept.

Improve [user flow, such as signup] at [URL] until [completion criterion]. In a real browser, start each pass from fresh state—no saved login, cookies, or site data. Capture meaningful screens at the agreed sizes and modes, score them with one checklist, and improve the weakest safe area. Rerun the whole flow and keep only regression-free changes. Stop on success, two full passes with no gain, blocked access, or required approval. Return scores, screenshots, changes, and stop reason.
by Hayden Cassar (@hcassar93)·Forward Future
38

Accessibility Repair Loop

Frontend & Visual

Use this when a website or app has a defined accessibility target such as WCAG 2.2 AA and can be tested repeatedly with scans plus keyboard and screen-reader checks. Every issue is confirmed and ranked by harm, and checks are never silenced.

Check [scope] against [accessibility standard, such as WCAG 2.2 AA] with automated scans and available keyboard, screen-reader, and other manual tests. Confirm each issue, rank it by harm, and fix the highest-impact blocker. Rerun the same checks, affected task, and regression tests. Keep only verified fixes. Stop when no blocker remains, progress stalls, verification is unavailable, or approval is required. Never silence a check or weaken the target. Return issues, fixes, evidence, exceptions, and untested needs.
by Eric Lott·Forward Future
39

Cold-Load Trimmer Loop

Optimization

Use this when a web app feels heavy on the first visit because it downloads too much code, styling, or media before the first screen. One candidate at a time is deferred, compressed, or removed, and kept only if tests pass, screenshots stay pixel-identical, and bytes drop.

Reduce the data [web app] downloads before its first screen appears. First record passing tests, mobile and desktop screenshots, and compressed transferred bytes—the data actually downloaded. Use the build report only to suggest candidates. Defer, compress, or remove one item, then rebuild and rerun every check. Keep it only if tests pass, screenshots are pixel-identical, and bytes decrease; otherwise revert. Stop when no safe candidate remains, progress stalls, or approval is needed. Return measurements, changes, and untested states.
by Christian Katzmann·Forward Future
40

Housekeeper Loop

Code Quality

Use this when a code project has accumulated small maintenance problems such as dead code, stale files, duplication, or broken links, but broad deletion would be risky. Each round proves, applies, and verifies exactly one low-risk cleanup with the build and tests.

Review [repository or code project] for dead code, meaning unreachable or unused code; stale files or comments; unused dependencies; duplication; broken links; inconsistent names; and confusing structure. Protect unrelated, active, uncommitted, generated, and uncertain work. Prove one low-risk cleanup, make the smallest coherent change, then rerun the build, tests, runtime checks, and diff review. Keep only verified improvements. Stop when none remain, progress stalls, verification is unavailable, or approval is required. Return changes, evidence, and deferred candidates.
by Eric Lott·Forward Future
41

Pixel-Safe CSS Trim Loop

Frontend & Visual

Use this when stylesheets may contain unused declarations, duplicated rules, or old overrides and representative pages can be compared by screenshot. One rule is removed per round and kept only if every screenshot stays pixel-identical and the built CSS gets smaller.

Reduce the CSS styling code [site] sends to users without changing tested screens. First capture representative pages, sizes, themes, and interactions, and record the built CSS size. Treat coverage reports only as suggestions. Remove one declaration or rule, rebuild, and rerun screenshots and project checks. Keep it only if every screenshot is pixel-identical and built CSS is smaller; otherwise revert. Stop when no supported candidate remains, progress stalls, or approval is required. Return reduction, evidence, and untested states.
by Christian Katzmann·Forward Future
42

Prepare-a-New-Project Loop

Documentation

Use this before building a new software project when the idea or early documents still leave important decisions open. Each round closes the largest gap until two independent reviewers describe the same components, data model, and definition of done.

Prepare [project] for implementation. Ensure its documents cover requirements, technical design, tasks with acceptance criteria, and test strategy. Each round, fix the largest gap or contradiction that could make two competent engineers build different systems. Keep details traceable, record assumptions, and ask before product forks. Recheck consistency, then have two independent reviewers describe the components, data model, dependencies, and definition of done. Stop when they materially agree and every artifact is testable, or a decision needs the user.
by Brad Shannon (@bradshannon)·Forward Future
43

Groundtruth Audit Loop

Documentation

Use this before trusting a project's security, correctness, or operational assumptions, when the first task is an audit rather than a repair. Every area is judged from the actual code with direct evidence, and nothing changes without your approval.

Audit [project] from its actual code and configuration, not framework assumptions. For architecture, platform compatibility, security, privileged areas, performance, deployment, jobs, business logic, and code quality, record proved, no issue, weak, or N/A with direct evidence; verify external limits from current primary sources and calculate numbers. Ask before changing code. Stop when every area is logged with severity, or return unverified areas as blocked. Finish with a plain-language overview and area-to-evidence table.
by Mohamed (@aivibecode)·Forward Future
44

Artifact-to-Skill Loop

Optimization

Use this when a finished artifact succeeded, contains a repeatable method, and similar work will come up again. The loop distills decisions, sequence, and checks into a skill, tests it on a fresh second case, and revises it at most twice.

Turn [artifact] into a skill, playbook, or procedure. Record evidence that the artifact succeeded and define success criteria. Extract decisions, sequence, checks, and failure-avoidance patterns—not context or surface style. Remove sensitive material. Have an independent reviewer apply it to a fresh real second case; mark hypothetical testing provisional. Revise at most twice. Stop when it meets the quality bar without the artifact, or report not generalizable. Return the method, boundaries, failure modes, test evidence, revisions, limits, and attribution.
by Hiten Shah (@hnshah)·Forward Future
45

Error Message Rewrite Loop

Content

Use this when a product exposes raw, internal, or unhelpful error messages and the full user-facing error surface needs a controlled rewrite. All messages go into a CSV with trigger, risk, and verification status, and each group is verified in a real browser.

Find and improve every user-visible error message within [repository, product, or named scope]. If no scope is supplied, use the user-facing surfaces in the current repository and state any exclusions before editing. Inventory error strings in source code, surfaced API or client errors, and reachable browser states. Record each one in a CSV with its location, trigger, current copy, user risk, proposed replacement, implementation status, and verification result. Rank the errors by user harm. Rewrite one coherent group at a time using plain language and a useful recovery step when one exists. Do not expose provider names, stack traces, internal identifiers, or implementation details. After each change, run the relevant tests, exercise the affected state in a real browser when possible, and search again for raw or internal error text. Do not mark an unreachable state as verified. Stop when every row is verified or explicitly blocked. Finish with the CSV, changed files, test evidence, browser evidence, and blocked items.
by Will Undrell (@WillUndrll)·Forward Future
46

Dependency CVE Burndown Loop

Deployment & Ops

Use this when dependency scans report high or critical CVEs and remediation should depend on whether the vulnerable code is actually reachable in the project. The riskiest reachable dependency is patched first, followed by a rebuild, tests, and a rescan.

Scan the dependencies of [authorized project or current repository] for known CVEs using current advisory sources. If you cannot access the dependency graph, repository, or current advisories, report the blocker and stop. For each high or critical finding, identify the affected direct or transitive dependency, determine whether the vulnerable code is reachable, and check whether the exploit conditions exist in this project. Rank findings by severity, reachability, exposure, and available remediation. Patch or upgrade the highest-risk reachable dependency using the smallest credible change. Run the build, tests, and security scan again. Keep the change only if verification passes and no unacceptable regression appears. Repeat until no exploitable high or critical CVE remains, or every remaining finding has an evidence-backed reachability assessment and an approved risk decision. Ask before major or breaking upgrades, production changes, or accepting risk. Finish with the CVE inventory, reachability evidence, fixes, verification results, and remaining risks.
by hungtv27 (@hungtv27)·Forward Future
47

Dependency Triage Loop

Deployment & Ops

Use this when several Dependabot pull requests are open and an authorized maintainer wants them handled safely, without stale checks, parallel merge races, or automatic high-risk upgrades. The loop works through a fixed snapshot and merges only patch or minor updates with explicit authority.

Review every Dependabot pull request currently open in [repository]. Take a fixed snapshot of that set and process each pull request once. Read its diff, release notes, advisories, dependency role, current base revision, and exact-head CI results. Run the repository’s relevant tests in an isolated worktree and classify the update by version change, breaking behavior, security exposure, and regression risk. For failing checks, identify the root cause and prepare the smallest verified repair. Process merges serially: before each merge, refetch the base and pull-request head and require passing exact-head checks. Merge only low-risk patch or minor updates when explicit merge authority has already been granted. Request approval for major, breaking, security-sensitive, uncertain, or externally visible actions. Never push changes, merge, comment, or send messages without the corresponding authority. Stop successfully when the original snapshot is fully processed; stop without changes when none are open; stop as blocked when verification is unavailable. Finish with reviewed, repaired, merged, deferred, and blocked pull requests plus supporting evidence.
by Damian Galarza (@dgalarza)·Forward Future
48

Pre-Publish Source Check Loop

Content

Use this immediately before publishing an article, newsletter, or report whose claims, quotes, and attributions need a final source check. Every checkable claim is matched against the best primary source, and no source is ever invented.

Before publishing [draft], inventory every factual, statistical, quoted, or attributed claim a reader could verify. Find the best current primary source for each and label it supported, outdated, misattributed, unsupported, or unverifiable. Fix the riskiest mismatch, then recheck that claim and anything depending on it. Repeat until no high-risk unsupported claim remains or five rounds are exhausted. Never invent a source, cite evidence that does not support the claim, or alter a quotation. Ask before changing a named person’s quote or a legal, medical, or financial statement. Stop without changes if there are no checkable claims; stop as blocked when adequate evidence is unavailable. Finish with the claim-to-source table, corrections made, unresolved claims, and decisions requiring an editor.
by Ryan Banze (@RyanBanze)·Forward Future

Frequently Asked Questions

Everything you need to know about loop and goal prompts in Claude Code.

A loop prompt is an instruction to Claude Code (or a similar AI) that does not run once but repeats itself until a clear stop condition is reached. Examples include “refactor until you're happy with the architecture”, “review new releases every night and turn them into a podcast”, or “iterate on the thumbnail until it beats the rubric”. The two main Claude Code slash commands for this are /loop (time-based) and /goal (goal-based).

/loop runs a prompt or slash command on a fixed interval, for example /loop 5m /foo. The interval can use s, m, h, or d units, scheduling is accurate to one minute, and a loop ends after seven days at the latest. If you omit the interval, Claude picks its own wait between one minute and one hour after each iteration. /goal, on the other hand, runs until a verifiable goal condition is reached, for example “all tests in test/auth pass and the lint step is clean”. After each turn, a small model checks whether the condition holds. To bound the runtime, add a clause such as “or stop after 20 turns” to the condition. Use /loop for clock-driven tasks and /goal when an outcome defines the stop condition.

Copy the prompt you want using the copy button, replace any bracketed placeholders (e.g. [video], [repository], [budget]) with your own values, and paste it into Claude Code. If the prompt starts with /goal or /loop, Claude Code treats it as the matching slash command. Without a prefix, you can send it as a regular instruction or prepend /goal or /loop yourself. /goal needs a folder that Claude Code trusts, because its evaluation is built on the hooks system.

Most prompts work in other agentic tools if they can edit files, run shell commands, and run tests. The slash commands /goal and /loop come from Claude Code; in other tools, drop them or replace them with the equivalent, if one exists. Tool-specific loops like the Clodex Adversarial Review Loop, War Loops, or the Loop Harness Verification Loop require their respective CLIs.

Costs depend on the model, input, and work the agent performs. Claude Code's `--max-budget-usd` and `--max-turns` flags apply only in print mode (`claude -p`). The first stops the run when estimated API spend reaches the amount; the second limits agentic turns, not tokens. The estimate can differ from your bill, and the cap can be exceeded. Neither flag caps an interactive `/goal` run. For an interactive `/goal` run, define a clear stop condition and monitor usage and cost.

Email me at info@gradually.ai with title, the verbatim prompt text, a short description (“when is it useful?”), and a source (tweet, GitHub repo, blog post). I only accept prompts that have been shared publicly and include the original text, not just a summary or paraphrase.

Changelog

The latest updates and improvements to our Loop Prompts
November 1, 2026v4.0

Source check and expansion to 50 loop prompts

  • Checked every prompt against its source; replaced outdated versions (Forward Future loops, Cursed compiler, Snarktank Ralph, Adam Tuttle) with the current original wording
  • Removed five prompts whose wording could not be confirmed in the source
  • Added 22 new loop prompts with sources, including Ticket-to-PR-Ready, Dependency Triage, Accessibility Repair, and Pre-Publish Source Check
  • Aligned the official deploy-check example and the Ralph loop plugin link with the current Anthropic documentation
June 21, 2026v3.0

Expansion to 33 loop prompts

  • Added 5 new verified loop prompts
  • Ryan Carson's canonical Ralph PRD variant (snarktank/ralph) with browser verification for frontend stories
  • Adam Tuttle's RALPH workflow with a `NEED_PERMISSIONS` escape hatch
  • Two /goal patterns from Sabrina Ramonov (Downloads Sorter, PDF Summarizer) with countable exit conditions
  • Cobus Greyling's read-only-first-week daily triage loop
June 19, 2026v2.0

Expansion to 28 loop prompts

  • Added 18 new verified loop prompts
  • Four official Anthropic docs examples for /goal and /loop, plus the official ralph-wiggum plugin
  • Two Ralph-loop classics from Geoffrey Huntley (original one-liner and the Cursed compiler)
  • Hamel Husain's adversarial review-loop pattern with Codex subagents
  • Verbatim prompts from Anand Chowdhary, Eric Zakariasson, Louis Wharmby, Akshay Pachaar, KingBootoshi, and more
Show older versions (1)
June 19, 2026v1.0

Initial release

  • 10 curated loop and goal prompts from the Claude Code community
  • Six categories: Code Quality, Deployment & Ops, Content, Frontend & Visual, Documentation, Optimization
  • List and grid view with search, category filter, and sorting
  • Verbatim prompts with copy button, author, and source link