Loop directory

213 published loops. Copy one, swap in your repo, run it.

Deploy-poll loop

A hands-free ops loop that polls your deploy every two minutes, runs the smoke test the moment it goes live, and stops with a report if any check fails.

prompt
→ Claude
/loop every 2 minutes: check deploy status; when it's live, run the smoke test and summarize; if smoke test fails, report the failing check and stop
devopsmedium risk

claude-progress.txt harness pattern (Anthropic)

/ralph★ Anthropicnew

Anthropic's first-party file-as-memory harness for long-running agents: every fresh-context session recovers state from a progress file and the git log, does one unit of work, updates the file, commits, and exits.

prompt
→ Claude
Long-running agent harness: each fresh-context session starts by reading `claude-progress.txt` + git log to recover state, does one unit of work, updates the progress file, commits, exits. Initializer session sets up the file; coder sessions loop.
automationmedium risk

Architect-builder cross-vendor loop

/ralphnew

A two-vendor loop that pairs Claude as architect with Codex as builder, using the repo itself as shared memory: the architect writes specs, the builder implements one item per iteration, and the architect reviews the diffs on the next pass.

prompt
→ Claude
Claude as architect, Codex as builder, the repo as shared memory — architect writes plan/spec files, builder implements one item per iteration, architect reviews diffs next pass.
planningmedium risk

Agent-Loop-Skills bundle — loop until it's better

/ralphnew

Six verification-gated loops in one open-standard skill bundle — autoresearch, scientific writing, data analysis, code/SQL/prompt optimization, and red-teaming — portable across Claude Code, Codex, and Cursor. Use the red-teaming loop only against systems you own and are authorized to test.

prompt
→ Claude
"Loop until it's better" — verification-gated loops for autoresearch, scientific writing, data analysis, code/SQL/prompt optimization, red-teaming, packaged as open-standard Agent Skills portable across Claude Code, Codex, Cursor.
qualitymedium risk

AutoLoop — metric-driven optimization loops

/ralphnew

Agent-agnostic hill-climbing loops inspired by Karpathy's autoresearch: define a metric, let the agent propose a change, measure, keep it only if the number improved, and repeat.

prompt
→ Claude
Iterative optimization loops (inspired by Karpathy's autoresearch): define a metric, agent proposes change, harness measures, keep if improved, repeat. Works with Claude Code, Codex, Cursor, Gemini CLI.
performancemedium risk

Multi-repo autonomous dev team loop

/ralphnew

The fleet pattern: run agent loops across multiple repos in parallel, each isolated in its own git worktree, with a pluggable vendor layer spanning Claude Code, Codex, Cursor CLI, and OpenCode.

prompt
→ Claude
Register repos, run loops across them in parallel, each loop in its own git worktree; pluggable vendor layer (claude-code, codex, cursor-cli, opencode) — plan, review, fix, ship on a loop.
automationmedium risk

Deterministic backlog loop for Codex CLI

/ralphnew

A Codex-first autonomous runner that pulls exactly one task per iteration from a JSON backlog with fresh context each run and a JSONL audit log for full traceability.

prompt
→ Claude
Autonomous runner: exactly one task per iteration pulled from a JSON backlog, fresh context each run, JSONL audit log for traceability; optional Claude Code interleaving.
automationmedium risk

Looper — design-review your loop before running it

/ralphnew

A plan-the-loop-first skill: it interviews you about the automation idea, previews the flow as ASCII art, and only writes final loop artifacts after you confirm — a safe on-ramp for loop beginners.

prompt
→ Claude
Skill interviews you about the automation idea, writes loop artifacts to `looper-output/`, shows an ASCII flow preview, and only finalizes after you confirm — design the loop before any runner touches files.
planningmedium risk

Verification-gated self-running loop skill

/ralphnew

A drop-in Claude Code skill that keeps looping until an external verifier passes — not the model's own self-report — making it a strong anti-reward-hacking pattern for autonomous coding.

prompt
→ Claude
Drop-in Claude Code skill: self-running agent loop with a "real, un-foolable verification gate" — loop continues until an external verifier (not the model's self-report) passes.
testingmedium risk

Boris Cherny loop methodology + agent-loop skill

/ralphnew

A fact-checked knowledge base of Claude Code creator Boris Cherny's loop methodology, packaged as a runnable agent-loop skill you can drop straight into Claude Code.

prompt
→ Claude
Fact-checked knowledge base of Cherny's loop methodology for running Claude Code, shipped as a runnable `agent-loop` skill in `skill/agent-loop/`.
planningmedium risk
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →

loop-init, loop-audit, loop-cost CLI patterns

/ralphnew

Three starter CLI tools that turn loop design into a repeatable workflow: scaffold a loop with a goal, budget, and verify step; audit an existing loop design; and estimate cost before you run.

prompt
→ Claude
Starter CLI tools: `loop-init` scaffolds a loop (goal, budget, verify step), `loop-audit` reviews an existing loop design, `loop-cost` estimates spend before running.
planningmedium risk

claude-loop — iterative sessions with cost tracking

/ralphnew

An automation harness that runs repeated Claude Code sessions while tracking cost and tokens per iteration — the reference answer to the number-one objection to agent loops: runaway spend.

prompt
→ Claude
Automation toolkit running repeated `claude` sessions with per-iteration cost and token monitoring; inspired by Dex Horthy's context-engineering talk.
automationmedium risk

Continuous Claude — PR-gated Ralph loop

/ralphnew

The Ralph loop for teams: every iteration ships as a pull request that must pass CI before merging, giving each cycle a verifiable checkpoint. Keep branch protection and human PR approval enabled rather than letting it auto-merge to main unattended.

prompt
→ Claude
Run Claude Code in a continuous loop that opens a PR per iteration, waits for CI checks, and merges when green, then starts the next iteration.
cimedium risk

Ralph with circuit-breaker exit detection

/ralphnew

A safe Ralph variant that solves runaway loops with circuit-breaker heuristics: it halts automatically when iterations stop producing file changes or keep hitting the same error.

prompt
→ Claude
Ralph loop wrapped with exit heuristics: no file changes for 3 consecutive iterations = no progress → stop; same error 5 consecutive loops = stuck → stop.
automationmedium risk

Official Ralph Wiggum plugin (Anthropic)

/ralph★ Anthropicnew

Anthropic's first-party take on the Ralph loop: a Claude Code plugin that runs the iterate-fresh-context pattern with a managed stop and iteration mechanism built in.

prompt
→ Claude
Install the `ralph-wiggum` plugin from the anthropics/claude-code repo; it wraps the Ralph loop with a managed stop/iteration mechanism inside Claude Code.
automationmedium risk

The original Ralph Wiggum loop

The canonical Ralph Wiggum loop by Geoffrey Huntley: a bash while-loop that feeds Claude Code one fresh-context iteration at a time, using the filesystem and git as memory. Run it only in a sandboxed environment with permissions configured — never with permission checks disabled.

prompt
→ Claude
`while :; do cat PROMPT.md | claude -p ; done` — PROMPT.md holds the spec + "pick ONE task from the plan, implement, test, commit, exit." Fresh context every iteration; filesystem + git = memory.
automationmedium risk

CI pipeline speedup

/goalloopreponew

Profile the CI pipeline and cut wall-clock time under a target by improving caching, splitting slow jobs, and removing redundant steps, verifying every run stays green.

prompt
→ Claude
/goal the CI pipeline completes in under 10 minutes on a typical PR — analyze the slowest recent runs with `gh run view`, apply one speedup per turn (better dependency caching, job parallelization, removing duplicated steps, trimming artifacts), push to a test branch, and confirm the workflow still passes; stop at the target or after 10 turns
cimedium risk

Upgrade to current Node LTS

/goalloopreponew

Move the project to the current Node LTS across .nvmrc, CI config, Dockerfiles, and engines, fixing deprecations until everything is green on the new runtime.

prompt
→ Claude
/goal the project runs on the current Node LTS — update .nvmrc, the engines field, CI workflow files, and any Dockerfile base images to the LTS version, then run install, build, lint, and the full test suite on it, fixing deprecation warnings and breakages one at a time; stop when all are green or after 15 turns
maintenancemedium risk

Memory leak hunt

/goalloopreponew

Drive a suspected memory leak to ground: reproduce growth under a repeated workload, capture heap snapshots, and fix the retention until memory stays flat.

prompt
→ Claude
/goal heap usage stays flat (within 5%) across 500 repetitions of the failing workload in the leak-repro script — capture heap snapshots before and after, identify what is being retained and by which reference chain, fix the leak, and re-run the repro to confirm; stop after 10 turns
debuggingmedium risk

Commit message hygiene on a branch

/goalloopreponew

Rewrite the commit messages on your feature branch to conventional-commit format with meaningful bodies before opening the PR, leaving the code untouched.

prompt
→ Claude
/goal every commit on this branch (ahead of main) has a conventional-commit subject under 72 characters and a body explaining why — use interactive rebase to reword only (no code changes, no commits dropped), verify with `git log main..HEAD`, and confirm the diff against the original branch tip is empty; stop after 5 turns
gitlow risk
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →

Ralph the bug backlog

Work a triaged bug list one fix per fresh-context iteration: reproduce first, fix minimally, prove it with a regression test, and log root-cause patterns to guardrails.

prompt
→ Claude
/loop fresh context each iteration: read bugs.json and .ralph/guardrails.md, take the top open bug, write a failing test that reproduces it before touching any code, then apply the smallest fix that makes the test pass with the rest of the suite green, and mark the bug fixed; if you cannot reproduce it, mark it needs-info with your findings instead; append recurring root-cause patterns to .ralph/guardrails.md; stop when bugs.json is clear or after 25 turns
debugginghigh risk

Ralph the docs backlog

Document one undocumented public module per fresh-context iteration, verifying every code sample compiles and accumulating style rules in guardrails so the docs read like one author wrote them.

prompt
→ Claude
/loop fresh context each iteration: read docs-backlog.json, docs/STYLE.md, and .ralph/guardrails.md; pick the top undocumented module, write its reference page with a runnable example, execute the example to prove it works, and mark the module done; add any style or structure decision to .ralph/guardrails.md; stop when the backlog is empty or after 20 turns
docsmedium risk

Ralph a refactor, module by module

Break a large refactor into a JSON backlog of modules and let fresh-context iterations convert one module per pass, with guardrails capturing every pattern decision so the result stays consistent.

prompt
→ Claude
/loop fresh context each iteration: read refactor-plan.json and .ralph/guardrails.md, take the next module not marked converted, migrate it to the target pattern described in PROMPT.md, run tests and typecheck, and mark it converted only when green; record every convention decision you make (naming, file layout, error handling) in .ralph/guardrails.md so later modules match earlier ones; stop when all modules are converted or after 30 turns
refactoringhigh risk

Ralph a test backlog

Iterate over a prioritized list of untested modules with fresh context each pass, writing real behavioral tests for one module at a time and banking lessons in a guardrails file.

prompt
→ Claude
/loop each iteration with fresh context: read .ralph/test-backlog.json and .ralph/guardrails.md, pick the top unfinished module, write behavioral tests for its public API (no snapshot-only tests), run the suite, and mark the module done only when its tests pass and coverage for it exceeds 80%; append any discovered testing gotcha (fixtures, mocking rules, async traps) to .ralph/guardrails.md; stop when the backlog is empty or after 25 turns
testinghigh risk

Ralph the PRD backlog

The canonical Ralph loop: each iteration starts fresh, reads the PRD and guardrails, ships exactly one backlog item end-to-end, and records what it learned.

prompt
→ Claude
/loop start each iteration with fresh context: read PROMPT.md, prd.json, and .ralph/guardrails.md; pick the single highest-priority item in prd.json not marked done, implement it with tests, run the full check suite, commit and mark it done only if green; if blocked or a check fails twice the same way, append the lesson to .ralph/guardrails.md and move on; stop when every item is done or after 30 turns
planninghigh risk

Stale branch report

/scheduleloopreponew

Every Monday, list remote branches with no commits in 30 days, classify each as merged, abandoned, or unclear, and file a cleanup checklist issue — deleting nothing.

prompt
→ Claude
/schedule every Monday at 9am, list remote branches with no commits in the last 30 days; for each, note whether it is fully merged into main, who last touched it, and any open PR; post the list as a checklist in a single `branch-cleanup` issue, and do not delete any branch yourself
gitlow risk

Weekly tech debt report

/scheduleloopreponew

Every Friday, compile a trend report of debt signals — TODO count, lint suppressions, type coverage, largest files — so the team sees drift before it compounds.

prompt
→ Claude
/schedule every Friday at 4pm, measure TODO/FIXME count, eslint-disable and ts-ignore counts, type coverage, and the five largest source files; append the numbers with week-over-week deltas to reports/tech-debt.md and call out the single worst trend in one paragraph
maintenancelow risk

README freshness check

/scheduleloopreponew

Once a week, verify every command, path, and badge in the README actually works against the current codebase and open a PR fixing anything stale.

prompt
→ Claude
/schedule every Friday at 3pm, verify the README: run each documented setup and usage command in a clean checkout, check that referenced files and scripts exist, and open a PR correcting anything that fails or has drifted, with a note explaining each fix
docsmedium risk

Issue de-duplication sweep

/scheduleloopreponew

Twice a week, scan new GitHub issues for duplicates of existing ones and link them with a polite comment and a duplicate label, closing nothing automatically.

prompt
→ Claude
/schedule every Tuesday and Friday at 10am, compare issues opened in the last 4 days against existing open issues; when one is a likely duplicate, comment with a link to the original and apply the `possible-duplicate` label, but never close anything yourself
planningmedium risk

Nightly e2e run with morning report

/scheduleloopreponew

Run the full end-to-end suite every night at 2am and wake up to a digest of failures with screenshots, suspect commits, and a flakiness verdict per test.

prompt
→ Claude
/schedule every day at 2am, run the full e2e suite against the staging build; for each failure, attach the trace or screenshot, list the commits since the last green run, and say whether the failure looks flaky or real; post the digest to e2e-reports/ as a dated markdown file
testinghigh risk
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →