What Is a Self-Running AI Loop?
Moving from typing every prompt by hand to letting the AI decide what to do next and keep running on its own. This article lays out the idea and where it came from. If you just want to install it, jump to the Self-Running Loop setup guide. If instead you just need a prompt for a one-off task, the template-based prompt generator is faster.
What this is about
It started with a remark by Boris Cherny, who leads Claude Code at Anthropic. On the Acquired podcast (June 2026) he described how his own work had changed.
I don't prompt Claude anymore. I have loops running that prompt Claude and figure out what to do. My job is to write loops.
A year earlier he wrote code with IDE autocomplete; in between he ran several Claudes in parallel and prompted each by hand. Now he doesn't prompt at all; he writes the loops that prompt Claude. In the last 30 days of December 2025, he says 100% of his contributions to Claude Code were written by Claude Code itself, landing 259 pull requests.
The popular summary is a bit inflated
The clip spread widely, including in translated retellings. But the version that went viral drifts from the original in a few ways.
- The original is "here's how I changed," a personal account. It is not an order to "stop writing prompts."
- The "90% are wasting time" figure is not in the original. The original 90% is an internal productivity metric ("over 90% of the Claude Code team's code is written with Claude Code"), not a loss rate for general users.
- The remark is about coding. It is not about general chat use.
So the core is real, but the "everyone is losing out" framing was added on. The right reading is to install it only where it fits.
What a self-running loop actually is
A self-running loop is not one clever prompt. It is a system that separates "decide, build, verify" and repeats them.
It has four parts.
- Memory: fix the project's assumptions in
CLAUDE.mdso you never re-explain them. - Division of labor: split into a role that decides the next task, one that implements, and one that verifies.
- Drive: a loop that picks the next task, implements it, verifies it, and repeats until done.
- Brakes: cap iterations and cost, and block dangerous operations with a hook.
What you write shifts to "the goal in one sentence" and "fixing the loop." Working out each step becomes the job of the "decide" role, not yours.
Where it fits
It fits tasks whose results a machine can verify. Do the tests pass, does the build succeed, does the app start. Because pass/fail is decidable there, the loop can correct itself without a human watching.
It does not fit work you cannot verify. Subjective writing quality, or work that needs outside approval, gives the loop no pass/fail criterion. For those, a human at the wheel is faster and safer, as before.
To use the official features, start with /goal and /loop
As of October 2026, vendors ship the "drive" and "evaluation" parts of a self-running loop as built-in features. You can start with these before writing any script.
- Claude Code /goal
- Give it a completion condition in one sentence, and Claude keeps taking turns until the condition holds (Source 1).
- After each turn, a separate small model reads what surfaced in the conversation and judges it.
- There are three verdicts: not yet met, met, and impossible. When the condition is judged impossible, the goal clears automatically.
- The evaluator doesn't run commands or read files, so write a condition that Claude's output, such as test results, can demonstrate.
- Claude Code /loop
- Repeats a prompt on an interval while the session stays open (Source 2).
- If you omit the interval, Claude picks a wait between one minute and one hour.
- It suits time-based work, such as watching a deploy or CI run.
- Codex /goal
- Keeps working toward one objective across turns (Source 3).
- Use
/goal pause,/goal resume, and/goal clearto stop or resume it. - If it doesn't appear in the list, enable
features.goalsinconfig.toml.
- Cursor /loop
- A built-in skill that repeats a prompt or skill at a set interval (Source 4).
To keep work running after you close the session, use Claude Code's cloud or Desktop scheduled tasks (Source 2). Cloud scheduled tasks (routines), agent memory, and dreaming are covered in How to let AI write its own prompts. When you want separate permissions per role, or a cost cap on every call, build your own script. The Self-Running Loop setup guide covers how.
Getting started
Once the idea is clear, the fastest way to learn it is to run it once in a minimal setup.
The Self-Running Loop setup guide collects a CLAUDE.md template, per-role subagent definitions, a copy-paste loop script, and how to set cost caps.
Start with low iteration and cost caps on a small, verifiable task. Once it runs well, widen the scope gradually.
Sources
- Anthropic, "Keep Claude working toward a goal" (checked October 26, 2026)
https://code.claude.com/docs/en/goal - Anthropic, "Run prompts on a schedule" (checked October 26, 2026)
https://code.claude.com/docs/en/scheduled-tasks - OpenAI, "Follow a goal" (checked October 26, 2026)
https://developers.openai.com/codex/use-cases/follow-goals/ - Cursor, "Agent Skills" (checked October 26, 2026)
https://cursor.com/docs/skills