Skip to main content
gradually.ai logogradually.ai
  • Blog
  • About Us
AI Newsletter
AI Newsletter

33 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 33 of 33 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.

/goal 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.

/clodex [task] think hard --max-iter 5 --threshold medium. Plan the task, implement it, ship a pull request, run the Codex adversarial-review code path, fix every finding above the configured threshold, and repeat. Persist the plan, branch, pull request, findings, verdict, and iteration state so the run can resume safely. Remember that threshold names the highest acceptable severity. Stop when Codex approves, only sub-threshold findings remain, or max-iter is reached. Never report a stalled, errored, or exhausted run as approved.
by Lukas Kucinski·GitHub
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.

Argue against your own design until it survives. In each round, a critic sub-agent writes the strongest case that the current approach is wrong and records every objection in /tmp/redteam-{projectname}.md with its evidence, impact, and status. The builder must either fix the weakness and verify the result or record why accepting it is reasonable under the project's stated criteria. The critic then reviews the change or acceptance rationale and may reopen anything that is not supported. Repeat until no new high-impact objection appears and every logged objection is either verified as resolved or explicitly accepted with evidence. Merely answering an objection in the log does not resolve it. If the same unresolved objections repeat for two rounds without new evidence or progress, stop and report the stalemate instead of claiming the design survived.
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.

Manage one customer AI deployment from priority to production outcome. Run this loop when a customer shares a new priority, requests an AI workflow, gives feedback, reports a failure, or reaches a scheduled AI operations review. Start from the customer's current business priority and choose one concrete workflow or improvement to advance. Define the business goal, owner, affected users, systems and APIs, input data, expected output, approval gates, risk level, success criteria, and ROI hypothesis. Build or update the deployment, run a dry run on realistic customer data, record failures and edge cases, fix the smallest underlying issue, and rerun until the dry run passes or a blocker is clear. Release gradually and monitor production. Before stopping, produce a customer-facing update and store the reusable lessons for the next run.
by AgentLed.ai·AgentLed.ai
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 any new publicly released features or changes from the repository and identify the ones most meaningful to users. Verify each selected change against the released product, documentation, or release notes. Use the Jellypod MCP to generate a short three-to-five-minute podcast episode explaining how users can take advantage of the new features, why they are important, and how to try them. Review the script and audio for accuracy, clarity, and pronunciation; fix or regenerate anything that does not match the source material. If there were no meaningful public changes, record that result instead of manufacturing an episode.
by Pierson Marks·Jellypod
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.

The video is about [video subject]. Using [assets], make ten thumbnail concepts and score each one against [inspiration channel]'s YouTube thumbnails using a consistent rubric: clarity at small size, curiosity, emotional pull, visual contrast, and accuracy to the video. Select the top three, identify the weakest part of each concept, improve them, and rescore them with the same rubric. Continue iterating the strongest concept until you're satisfied it's click-baity enough without promising something the video does not deliver. Return the winning concept, two runners-up, their final scores, and the reasoning behind the choice.
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 a URL or image. Capture the page with a genuine browser, extract a ground-truth design spec, and produce two self-correcting builds: a polished static mirror in Pencil and a moving code build in Forge. Judge each build against the original across static design, experiential motion, and responsive reflow. After each evaluation, use the surgical critic to target the weakest signals. Repair, do not rebuild: keep what already matches and change only the highest-impact gaps. Repeat until the measures say it matches, fidelity passes, progress stagnates, or the source capture is blocked. Return the best build with its spec, renders, scores, findings, and run metrics.
by Swayam·GitHub
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.

/goal Create the most realistic Boeing 747 you can using Three.js. Use your vision capabilities to create a self-verifiable system, then enter a loop until you are 100% satisfied with the result. Build a repeatable camera system to inspect the aircraft from every required angle. After each significant change, render those same views, identify what looks least realistic, improve it, and inspect again. Preserve the best version as you iterate, and stop only when you are 100% satisfied that no visible issue remains worth fixing.
by @victormustar·X
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 the repository into a clean, empty environment with nothing preinstalled, then follow the README exactly as written to get the project running. Every time a step fails, is missing, or quietly assumes something the README never states, record the gap, fix the setup or documentation to remove that assumption, discard the environment, and start again from a fresh clone. Do not carry dependencies, configuration, credentials, or manual fixes from one attempt into the next. Keep a short log of each gap and how you closed it so it does not return. Stop when a brand-new environment goes from clone to running app in one uninterrupted pass using only the documented steps and no outside fix. Finish with the gaps closed and the exact commands a new contributor now runs from scratch.
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.

Keep three pieces of state in memory: the champion (the best current genome plus its gate score), a budget starting at [N], and a log of every tried genome and score. Each cycle, if the budget is zero, stop and return the champion. Otherwise, reduce the budget by one, read the latest failure in the log, and propose one targeted change to the champion that addresses it. Skip any change already tried. Score the challenger on a working signal: a cheap measure you may tune against. If it is not better than the champion, log it and continue. If it is better, freeze the challenger and run the gate on fresh examples you did not inspect while editing, plus the guard checks in [safety]. Accept the challenger only if its gate score beats the champion by [minimum margin] and no guard regresses; otherwise keep the champion. Log the attempt and repeat. Keep the working signal and gate separate. Treat a suspiciously easy win as Goodhart's law in action and reject it. If you are uncertain, keep the champion.
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

Wait For CI Loop

Deployment & Ops

Use this after pushing a PR when you want to stop manually refreshing the GitHub checks tab. Claude polls every ten minutes and only interrupts you with a merge-ready signal or a failure summary.

/loop 10m run `gh pr checks 1234`; if all pass, tell me it's ready to merge; if any fail, summarize which and why
by Louis Wharmby·X
15

Hit Acceptance Criteria Loop

Code Quality

Use this when an endpoint or feature has a concrete contract you can describe in one sentence (HTTP status, response shape, lint/test gates). Claude iterates against the contract until it passes or hits the turn cap.

/goal the /users endpoint returns 200 with a paginated JSON body, all tests pass, and lint is clean — stop after 20 turns
by Akshay Pachaar·X
16

Migrate API Loop

Code Quality

Use this for mechanical sweeping refactors where the success condition is provable by grep plus typecheck. Much safer than asking Claude to "migrate the API" because the goal is a verifiable end-state, not a process.

/goal every file importing from `./legacy-api` now imports from `./v2-api`, all tests pass, and `npm run typecheck` is clean — stop after 30 turns
by KingBootoshi·X
17

Morning Issue Triage

Deployment & Ops

A /schedule pattern (sibling of /loop) for daily inbox-zero on GitHub issues. Use this for any morning report that needs to fire on a fixed clock rather than poll opportunistically.

/schedule every weekday at 9am, label new issues from the last 24h by area and priority, and post a one-line summary on each
by chenchengpro·X
18

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
19

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
20

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
21

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
22

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
23

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.

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 thing.

Before making changes search codebase (don't assume not implemented) using subagents.

After implementing functionality or resolving problems, run the tests for that unit of code that was improved.

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

DO NOT IMPLEMENT PLACEHOLDER OR SIMPLE IMPLEMENTATIONS. WE WANT FULL IMPLEMENTATIONS. DO IT OR I WILL YELL AT YOU
by Geoffrey Huntley·ghuntley.com
24

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
25

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
26

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
27

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
28

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
29

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`

## 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
30

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.
by Adam Tuttle·adamtuttle.codes
31

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
32

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
33

Daily Triage Read-Only-First-Week Loop

Deployment & Ops

Once-a-day triage that updates STATE.md but explicitly does no auto-fix in week one. Classic rollout pattern that lets a loop earn trust before it gets write access.

/loop 1d Run loop-triage. Update STATE.md. No auto-fix in week one.
by Cobus Greyling·GitHub

Frequently Asked Questions

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

Changelog
The latest updates and improvements to our Loop Prompts
v3.0June 21, 2026

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
v2.0June 19, 2026

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
v1.0June 19, 2026

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

Stay Updated with the AI Newsletter

Get the latest AI tools, tutorials, and exclusive tips delivered to your inbox weekly

Unsubscribe anytime. About 4 to 8 emails per month. Consent includes notes on revocation, service provider, and statistics according to our Privacy Policy.

gradually.ai logogradually.ai

Germany's leading platform for AI tools and knowledge for online entrepreneurs.

AI Tools

  • Text Generator
  • Prompt Enhancer
  • Prompt Link Generator
  • FLUX AI Image Generator
  • AI Art Generator
  • Midjourney Prompt Generator
  • Veo 3 Prompt Generator
  • AI Humanizer
  • AI Text Detector
  • Gemini Watermark Remover
  • All Tools →

Creative Tools

  • Blog Name Generator
  • AI Book Title Generator
  • Song Lyrics Generator
  • Artist Name Generator
  • Team Name Generator
  • AI Mindmap Generator
  • Headline Generator
  • Company Name Generator
  • AI Slogan Generator
  • Brand Name Generator
  • Newsletter Name Generator
  • YouTube Channel Name Generator

Business Tools

  • API Cost Calculator
  • Token Counter
  • AI Ad Generator
  • AI Copy Generator
  • Essay Generator
  • Story Generator
  • AI Rewrite Generator
  • Blog Post Generator
  • Meta Description Generator
  • AI Email Generator
  • Email Subject Line Generator
  • Instagram Bio Generator
  • AI Hashtag Generator

Resources

  • Claude Code MCP Servers
  • Claude Code Skills
  • n8n Hosting Comparison
  • OpenClaw Hosting Comparison
  • Claude Code Plugins
  • Claude Marketplaces
  • Loop Prompts
  • Claude Code Use Cases
  • Claude Cowork Use Cases
  • OpenClaw Use Cases
  • Changelogs

© 2026 Gradually AI. All rights reserved.

  • Blog
  • About Us
  • Legal Notice
  • Privacy Policy