automation loops
32 loops in this category.
Run agent until goal met
Queue agent turns with goal context until your objective is achieved, treating the goal as untrusted data.
Run workflows with dynamic sub-agents
Split a task into packets, run sub-agents in parallel, synthesize results, and verify completion.
Multi-repo autonomous dev team loop
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.
Run agent turns until goal met
Agent executes repeated turns toward a condition, with a lightweight evaluator checking progress after each turn until the goal is reached.
Set and ship autonomous goals
Run a persistent goal autonomously until completion, routing each task to the optimal model for cost and capability.
Schedule batch jobs with Dapr bindings
Schedule recurring batch jobs and cleanup tasks using Dapr cron bindings, running on your defined cadence.
Codex CLI as an MCP Tool Inside an Agents-SDK Loop
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.
Custom loop.md — Project-Level Default for Bare /loop
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.
Archive goals when validated
Run validation checks, then archive the goal once all checks pass without manual intervention.
Keep research progressing, never idle
Continuously advance research by reading state, reflecting on progress, pivoting if stalled, and committing findings until the work is truly complete.
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
Re-run docent updates on each idle tick until you cancel the loop.
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.
/goal + Routines overnight combo
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.
Run autonomous task daemon with guardrails
Claim tasks from a shared kanban queue and execute them with cost caps, retries, and peer recovery until the backlog clears.
Run an autonomous dev team across GitHub repos (looper)
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.
Runaway-Bill Guardrail Loop (Watchdog Beside the Worker)
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.
Park loop on background process
Pause loop execution while a background process runs, then auto-resume when it exits.
Ralph with circuit-breaker exit detection
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.
Official Ralph Wiggum plugin (Anthropic)
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.
Wire up C2 LSP container semantics
Continuously verify and adjust C2's fetch, LSP environment, and cache mounts until container semantics validate correctly.
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
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.
Codex App Automations (Scheduled Agent Runs)
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.
Delegate loop termination to Claude
Run an agentic loop until a dedicated Claude evaluator judges your condition met, delegating stop logic from shell parsing to model inference.
Content operations monitor via custom loop.md
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.
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.
Enforce workspace governance rules
Run workspace governance checks repeatedly up to three passes, stopping when all policies pass or max iterations hit.
Route work by live usage data
Advance implementation and metareview tasks by routing them between Claude Code and Codex CLI based on live usage metrics until the mechanical verifier passes.
Capture task name until save
Run the agent to prompt for a task name and stop once the save button is clicked or name is set.
Stop-Hook Ralph (Deterministic Loop Without Bash)
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.
Deterministic backlog loop for Codex CLI
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.
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)
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.
claude-loop — iterative sessions with cost tracking
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.