automation loops

32 loops in this category.

Run agent until goal met

/goalnew

Queue agent turns with goal context until your objective is achieved, treating the goal as untrusted data.

prompt
→ Claude
/goal <objective , after /goal resume , and after every agent turn that leaves the goal active , the extension queues Codex's goal continuation prompt as hidden model-visible context. The objective is XML-escaped and wrapped as untrusted user data so it does not become higher-priority instructions
automationlow risk

Run workflows with dynamic sub-agents

/goalnew

Split a task into packets, run sub-agents in parallel, synthesize results, and verify completion.

prompt
→ Claude
/goal loop and verify until complete
automationlow 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

Run agent turns until goal met

/goalnew

Agent executes repeated turns toward a condition, with a lightweight evaluator checking progress after each turn until the goal is reached.

prompt
→ Claude
/goal <condition turns a prompt into a durable objective. Thanos immediately starts a turn toward the condition, and after each turn a fresh, tool-less side-channel evaluator (a one-shot completeSimple call, not a subagent — so no extra agent turn and no re-entrancy) reads the last turn's evidence and returns MET / NOT MET . NOT MET auto-continues another turn with the reason as guidance; MET clears the goal and records the achievement. Unparseable evaluator output is treated as NOT MET (fail-safe: it never declares a false "done
automationmedium risk

Set and ship autonomous goals

/goalnew

Run a persistent goal autonomously until completion, routing each task to the optimal model for cost and capability.

prompt
→ Claude
/goal <objective · /loop <task | Set a persistent goal · run autonomously until complete (≤25 turns) |
automationlow risk

Schedule batch jobs with Dapr bindings

/schedulenew

Schedule recurring batch jobs and cleanup tasks using Dapr cron bindings, running on your defined cadence.

prompt
→ Claude
/Schedule | bindings.cron | Batch jobs, cleanup tasks |
automationmedium risk

Codex CLI as an MCP Tool Inside an Agents-SDK Loop

/ralph★ OpenAInew

An outer-planner/inner-coder loop from an official OpenAI recipe: an Agents SDK orchestrator plans and verifies while Codex CLI, wrapped as an MCP server, performs one bounded code change per turn.

prompt
→ Claude
Wrap Codex CLI as an MCP server and drive it from an OpenAI Agents SDK orchestrator loop — the outer agent plans/verifies, the inner Codex call does one bounded code change per turn.
automationmedium risk

Custom loop.md — Project-Level Default for Bare /loop

/ralphnew

A team-config pattern: a loop.md file in the project root overrides the built-in maintenance prompt, so any teammate running bare /loop gets your project's canonical loop — run lint, typecheck, and tests, fix anything red, stop when clean.

prompt
→ Claude
Put a `loop.md` in the project root to replace the built-in maintenance prompt when a user runs bare `/loop` — e.g., "run lint + typecheck + tests; fix anything red; update CHANGELOG; stop when clean." Every teammate's bare `/loop` now runs your loop.
automationmedium risk

Archive goals when validated

/goalnew

Run validation checks, then archive the goal once all checks pass without manual intervention.

prompt
→ Claude
/goal done | Done — only after validation passes. Archives the goal |
automationlow risk

Keep research progressing, never idle

/loopnew

Continuously advance research by reading state, reflecting on progress, pivoting if stalled, and committing findings until the work is truly complete.

prompt
→ Claude
/loop 20m Continue autoresearch. Read research-state.yaml and findings.md. Re-read the autoresearch SKILL.md occasionally to stay aligned. Step back and reflect holistically — is the research making real progress? Are you deepening understanding or just running experiments? If stalling, pivot or search literature for new ideas. Keep making research progress — never idle, never stop. Update findings.md, research-log.md, and research-state.yaml when there's new progress. Git commit periodically and clean up the repo if needed. Show the human your research progress with key plots and findings by preparing a report in to human/ and opening the HTML/PDF. Only when you believe the research is truly complete, invoke the ml-paper-writing skill to write the paper
automationmedium 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 →

Keep docent updated on idle

/loopnew

Re-run docent updates on each idle tick until you cancel the loop.

prompt
→ Claude
/loop /docent update — re-runs on each idle tick until cancelled
automationlow risk

Guardrails that learn from failure

A Ralph-style loop that writes its own rules: when a check fails the same way twice, the failure pattern gets appended to a guardrails file that every later iteration reads first.

prompt
→ Claude
/loop read .ralph/guardrails.md before doing anything, then run the full check suite and fix the first failure; if a check fails twice with the same error, append the failure pattern and a one-line rule for avoiding it to .ralph/guardrails.md before retrying; stop when all checks pass or after 15 turns
automationmedium risk

/goal + Routines overnight combo

/scheduleSabrina Ramonovnew

The two-layer answer to how do I run this overnight: /goal drives in-session work to done, while a scheduled Routine keeps recurring unattended work running on Anthropic's cloud with your laptop closed.

prompt
→ Claude
/schedule a Routine (runs on Anthropic cloud, laptop closed) for recurring unattended work, and use `/goal` for in-session iterate-to-done — the two-layer overnight pattern.
automationmedium risk

Run autonomous task daemon with guardrails

/ralphnew

Claim tasks from a shared kanban queue and execute them with cost caps, retries, and peer recovery until the backlog clears.

prompt
→ Claude
/goal "<objective " + /subgoal (numbered criteria), or headless buddy goal . buddy --yolo grants 400 tool rounds under a $100 cap with guardrails, and the 24/7 autonomous daemon ( buddy autonomy install ) claims tasks from a shared queue and runs them free-first (local → Tailscale → paid). That queue is a unified kanban board : the agent's kanban tools and the daemon drive one shared board with a claim lease + heartbeat , zombie reclaim of a crashed peer's work, a retry budget that dead-letters a hopeless task to a review column, and a dependency DAG — view it as Hermes-style columns with buddy autonomy tasks board
automationmedium risk

Run an autonomous dev team across GitHub repos (looper)

/ralphnew

Runs Claude Code/Codex as an autonomous multi-role dev team — planner → reviewer ↔ fixer → worker — across all of a user's GitHub repos, entirely driven by issue labels. Each loop runs in its own git worktree so multiple repos/issues proceed in parallel without collisions.

prompt
→ Claude
Register a repo with looper, then label an issue `looper:plan` and assign it to yourself. The planner reads the issue, explores the repo, drafts a spec, critiques and revises it, and opens a spec PR labeled `looper:spec-reviewing`. A reviewer re-reads the PR on every commit and posts inline review threads; a fixer pulls those threads, addresses them in its own worktree, and pushes, ping-ponging with the reviewer until every thread is resolved. Once labeled `looper:spec-ready`, a worker implements the spec, runs checks, and iterates on its own output until checks pass and the PR is ready for human review and merge. Every phase transition is gated on a GitHub label via `looperd`, so a human can pause or take over at any boundary.
automationmedium risk

Runaway-Bill Guardrail Loop (Watchdog Beside the Worker)

/ralphnew

A cost-safety pattern that pairs every overnight loop with a second, dumber loop whose only job is stopping the first: spend alerts, a hard iteration cap, and a cron check that kills the worker when token burn spikes or the same command keeps repeating.

prompt
→ Claude
Pair every overnight loop with a watchdog: spend/usage alert thresholds, a hard `MAX_ITER`, and a cron check that kills the loop process if tokens-per-minute spikes or the same command repeats N times. The watchdog is a second, dumber loop whose only job is stopping the first one.
automationmedium risk

Park loop on background process

/goalnew

Pause loop execution while a background process runs, then auto-resume when it exits.

prompt
→ Claude
/goal wait <pid [reason] | Park the loop on a background process — it stops re-poking the agent every turn while the process runs, and auto-resumes when it exits. |
automationlow 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

Wire up C2 LSP container semantics

/loopnew

Continuously verify and adjust C2's fetch, LSP environment, and cache mounts until container semantics validate correctly.

prompt
→ Claude
/loop semantics — the verify→review→tweak loop, ContainerRw lifecycle, reaping, merge hand-off are unchanged; C2 makes the fetch/verify/lsp env + commands + cache mounts + image language-selected
automationmedium 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 cost guardrails pattern

/ralphnew

The four-part cost guardrail every agent loop should ship with: a hard iteration cap, a stop-after-N-turns clause in the goal text, a budget limit on SDK loops, and a /cost check inside the loop body.

prompt
→ Claude
Every loop gets: `MAX_ITER=20` hard cap, "or stop after N turns" in the /goal text, `max_budget_usd` on SDK loops, and a /cost check in the loop body.
automationmedium risk

Codex App Automations (Scheduled Agent Runs)

/ralph★ OpenAInew

Codex's native answer to scheduled agent loops: define a prompt plus a schedule in the Codex app and it runs in the cloud on cadence — nightly dependency audits, morning issue triage — with no terminal open. The Codex-side equivalent of Claude Code Routines.

prompt
→ Claude
Define an Automation in the Codex app: a prompt + schedule that runs in the cloud on cadence (e.g., nightly dependency audit, morning triage of new issues), no terminal open.
automationmedium risk

Delegate loop termination to Claude

/goalnew

Run an agentic loop until a dedicated Claude evaluator judges your condition met, delegating stop logic from shell parsing to model inference.

prompt
→ Claude
/goal CONDITION directive evaluated by a dedicated Claude Haiku judge each turn. The orchestrator stops parsing model output entirely: it spawns one long-lived claude -p "/goal CONDITION" session, the /goal evaluator reads the running transcript and answers "is the condition satisfied yet?" turn by turn, and the Stop hook blocks termination until the evaluator says yes. ralph.sh has been reduced to a one-line deprecation shim that exec s goal.sh . Decision moved from a shell-level grep into an explicit model call with a schema-validated yes/no — the textbook ZFC move
automationlow risk

Content operations monitor via custom loop.md

/loopnew

A marketing-facing loop.md playbook that turns a bare /loop into a recurring content-ops sweep: checks GA4 for week-over-week organic traffic drops, scans GSC for position 4-15 query opportunities, and audits WordPress posts for broken internal links and missing meta descriptions — reporting one line when everything is green.

prompt
→ Claude
/loop 15m (Save the following as .claude/loop.md so the bare /loop picks it up as its playbook.) # .claude/loop.md — Content Operations Monitor Check the following every iteration: 1. Pull the latest GA4 data for kokasexton.com. If any post dropped more than 30% in organic traffic week-over-week, flag it with the URL and the percentage drop. 2. Scan GSC for new queries where we rank positions 4-15 and impressions grew >20% week-over-week. List the top 3 opportunities. 3. Check the WordPress admin for any posts with broken internal links or missing meta descriptions. Fix silently if fewer than 5 issues. Report if more. 4. If everything is green, reply with one line: "Content ops clean — nothing needs attention."
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

Enforce workspace governance rules

/loopnew

Run workspace governance checks repeatedly up to three passes, stopping when all policies pass or max iterations hit.

prompt
→ Claude
/loop guard: stop after max 3 passes
automationlow risk

Route work by live usage data

/goalnew

Advance implementation and metareview tasks by routing them between Claude Code and Codex CLI based on live usage metrics until the mechanical verifier passes.

prompt
→ Claude
/goal <task , advances work only through mechanical verifier PASS results, and routes implementation/metareview work between Claude Code and Codex CLI using live usage data
automationmedium risk

Capture task name until save

/goalnew

Run the agent to prompt for a task name and stop once the save button is clicked or name is set.

prompt
→ Claude
/Goal until (name is set) / (Save button is clicked) - no need to undo adding empty objects = easy discard
automationlow risk

Stop-Hook Ralph (Deterministic Loop Without Bash)

/ralphnew

A Ralph variant that lives inside a single Claude Code session: a stop hook re-injects the task prompt whenever the agent tries to end its turn, trading the bash while-loop's fresh context for a persistent session.

prompt
→ Claude
Use a Claude Code stop hook that re-injects the task prompt whenever the agent tries to end its turn, until a completion condition or hard iteration cap is met — Ralph semantics inside one session instead of a bash `while` wrapper.
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
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 →

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

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