Stop Writing Prompts: Claude’s Official Guide to 4 Types of Loops That Automate Work

marsbitPublicado a 2026-07-17Actualizado a 2026-07-17

Resumen

The article discusses a shift in AI development from manually crafting prompts to designing "loops"—systems where AI agents autonomously perform tasks until a defined stopping condition is triggered. Inspired by figures like Peter Steinberger and Boris Cherny, this approach, termed "loop engineering," focuses on creating self-running systems rather than one-off interactions. Claude Code's team formally defines a loop as an agent repeatedly executing work until a stop condition is met and categorizes four primary loop types based on their stopping mechanisms: 1. **Turn-based loops:** Human-controlled, step-by-step execution for short, discrete tasks. 2. **Goal loops (/goal):** An evaluator model checks outputs against predefined, quantifiable objectives (e.g., a performance score), forcing retries until the goal is met or a limit is reached. 3. **Time loops (/loop and /schedule):** Time-triggered, like cron jobs, for recurring tasks (e.g., daily summaries) or monitoring external systems. 4. **Proactive loops:** Event or time-triggered, fully automated workflows for ongoing, bounded tasks like bug triage, running until manually stopped. The core shift is from designing prompt content to designing the behavioral system—its triggers, verification mechanisms, and termination rules. Effective verification, where the agent can self-check its output, is highlighted as crucial for loop efficiency. The article warns that uncontrolled loops risk high costs and getting stuck in un...

The real challenge with loops isn’t just getting the AI to keep running, but whether it can know when to stop.

"Stop writing prompts"—this phrase is currently sweeping the AI community.

From Peter Steinberger, father of OpenClaw and now focused on next‑generation personal agents at OpenAI, to Boris Cherny, creator of Claude Code, these Silicon Valley heavyweights are collectively turning to "loops."

Google engineer Addy Osmani, who coined the term "loop engineering" for this trend, is also among them.

Cherny says he hardly writes prompts by hand anymore.

An agent writes prompts for Claude on his behalf; he only converses with that new Claude which "orchestrates everything."

He even made a bold statement: a decade from now, loops and similar capabilities will be among his proudest work achievements.

Steinberger puts it more bluntly: stop writing prompts for programming agents; you should design loops that feed them prompts.

He also demonstrated his loop on X: having Codex wake up every 5 minutes to automatically maintain code repositories, assign tasks, and fully autonomously complete some work.

So, what exactly is this "loop" that these big names keep mentioning?

Recently, the Claude Code team provided a clear definition in an official blog post, breaking it down into four types of loops and establishing engineering rules for "agents working autonomously."

The Claude Code team published an article formally defining "loops" and breaking them down into four typical types: turn‑based, goal, time, and proactive loops.

At its core, this signifies a shift: AI programming is moving from "writing a single instruction" to "designing a system that runs on its own."

A prompt gets you one response; a loop gets you a system that keeps working for you even after you close your laptop.

And programmers are transitioning from being content writers to being system designers.

Four Types of Loops, Four "Stopping Conditions"

What exactly is a loop?

There has been much debate on X, with varied answers. The definition given by the Claude Code team is clear:

A loop is when an agent repeats rounds of work until a stopping condition is triggered.

Four types of loops mean four types of "stopping conditions." This sentence is key to understanding Claude Code's technical blog about loops.

Along the dimensions of "how it's triggered, how it stops, what primitives it uses, and what tasks it's suitable for," Claude Code categorizes loops into four types.

The first type is the turn‑based loop.

Turn‑based loop: human controls round by round, each prompt initiates one round. (Source: Claude official blog)

Human control round by round: you write one instruction, the AI runs one round, you check, then write the next. You hold the steering wheel the entire time. It's suitable for scattered, short tasks that don't enter a process or schedule.

To reduce back‑and‑forth, write the steps you normally check manually into a SKILL.md file and let the AI verify its own work.

The more quantifiable the checks are, the better the AI can judge if it's done correctly, and the less you need to oversee.

The second type is the goal loop (/goal).

Goal loop: an evaluator model checks against criteria; if not met, sends it back for rework. (Source: Claude official blog)

First, lock in a goal, like "get the homepage Lighthouse score above 90, stop after 5 attempts."

Every time Claude tries to stop, an evaluator model checks against your criteria. If not met, it's sent back to keep working until the goal is achieved or the set number of rounds is exhausted.

Quantifiable standards like number of passing tests or score thresholds work well because Claude doesn't have to agonize over "is it good enough?"—the evaluator decides for it. It won't guess "that's probably enough" and stop prematurely, and the loop can conclude cleanly.

The third type is the time loop (/loop and /schedule).

Triggered at time intervals, like an alarm. Some tasks are repetitive, with the task remaining constant and only the input changing, such as summarizing Slack messages every morning.

Some tasks require monitoring external systems. The simplest way is to check at intervals, see what changed, and then react—for example, a PR that might receive reviews or have a failing CI.

Use /loop to rerun a prompt at intervals. To keep it running after you shut down your computer, use /schedule to move the loop to the cloud.

This logic is almost identical to the cron jobs familiar to programmers.

The fourth type is the proactive loop.

Proactive loop: triggered by events or time, fully unattended, runs until you manually stop it. (Source: Claude official blog)

Triggered by events or time, fully unattended.

Combined with auto mode and dynamic workflows, it fully automates long‑running tasks: scanning a feedback channel hourly, automatically triaging, fixing, and replying to each bug report received—running end‑to‑end without stopping to ask for permissions.

Each subtask exits upon achieving its goal, while the overall routine task runs until you manually stop it. It's suitable for源源不断 (continuous), well‑defined work: bug reporting, issue classification, dependency upgrades.

Four types of loops essentially answer "when to stop" in four ways: judged by a human, judged by an evaluator, judged by time, judged by an event.

Looking one layer deeper.

According to the official Agent SDK documentation, the core mechanism is also quite simple:

Claude evaluates your prompt, calls tools to act, retrieves results, then repeats until in a round it no longer calls any tools—only then does the loop end.

The agent loop from Claude Code's official Agent SDK documentation: after a prompt enters, Claude evaluates, calls tools, results flow back for re‑evaluation, until a round calls no tools, then outputs the final answer. (Source: Claude Code official documentation)

An autonomous agent, in essence, is just such a circle.

What's Really Changing Isn't the Loop Itself

Of course, we can't call "designing loops" a revolution from 0 to 1.

Scheduled tasks, orchestration, feedback loops—these practices have existed for a long time. What Claude is doing here is more about unifying them under a name and categorizing them into a set of standards.

So, what actually changed? The focus is on the "stopping condition."

Among the numerous practical tips summarized by Claude Code's official team, the one singled out and labeled as "the most valuable one" is verification:

Give Claude a way to check its own output.

The reasoning is straightforward.

For example, asking an engineer to build a webpage without giving them a browser—will the page look good? With a browser, they can see the effect immediately after each change, iterating until satisfied before submitting.

And the power of a model loop precisely comes from this ability to "close the loop by itself."

In this process, prompts aren't dead; they've just degenerated into a component within the loop.

The real core becomes designing stopping conditions, designing verifiers, controlling token budgets, and multi‑round execution strategies.

Loops Without Gates Are Powerful and Dangerous

Does a loop mean you can let the AI run on its own all day?

Certainly not.

The first obstacle is money. A loop without limits can burn through token costs.

Reportedly, Steinberger calls himself "the man with unlimited tokens," as unlimited free tokens are one of the perks of working at OpenAI. Ordinary folks don't have that luxury.

The second is more insidious. An agent can fall into a dead loop that "seems to make progress but actually spins in place": repeatedly modifying the same files without ever producing a new passing test.

It might even confidently make an incorrect solution more and more "complete."

The consensus in the engineering community is direct: loops are powerful, but without gating conditions, they are dangerous.

In engineering discussions on Reddit, someone summarized the essential gates into three rules that must be designed before writing a loop.

Done condition: And it must be machine‑determinable, such as all tests passing or a specific spec item being closed.

Hard limits: Including maximum rounds and maximum cost, specifically to prevent cost overruns and infinite loops.

No‑progress detection: Once it's detected repeatedly touching the same set of files without new passing tests, force a stop.

The official team also provides a full set of cost‑saving disciplines:

Don't force multi‑agent setups for small tasks.

If a cheap, fast small model can do it, don't use the strongest one for everything.

Test‑run on a small subset before large‑scale execution.

Hand deterministic work to scripts; running scripts is much cheaper than having a model reason step‑by‑step.

Don't run routine tasks more frequently than necessary.

Therefore, a loop is a整套 (complete set of) design about "how to control the AI," not about "letting the AI run wild."

This also determines that for now, it's most suitable for well‑defined, structured tasks, not free‑form creative exploration.

Before, It Was About Who Could Talk Best; Now, It's About Who Can Build Systems

In this shift, what's truly changing is the focus of programming: moving from "content design" to "behavioral system design."

Previously, you designed the content of a single instruction. Now, you design an entire behavioral system: how it triggers, how it verifies, how it stops.

Claude Code's official team leaves a simple starting point for those wanting to design loops:

Look at the work you do every day, pick one bottleneck环节 (segment), and ask yourself three questions:

Verification: Can I write out that verification check for it?

Goal: Is the goal description clear enough?

Rhythm: Does the work appear at a fixed rhythm?

If the answer to any of these is yes, you've found your first candidate for a loop to hand off.

AI programming used to be about prompt engineering技巧 (skills); now it's about who can build systems: who can design a loop that verifies itself and knows when to stop.

The era of writing prompts won't vanish overnight, but its spotlight is shifting toward loops.

And the true designers of loops have just taken the stage.

References:

https://claude.com/blog/getting-started-with-loops

https://code.claude.com/docs/en/agent-sdk/agent-loop

https://support.claude.com/en/articles/14554000-claude-code-power-user-tips?utm_source=chatgpt.com https://www.reddit.com/r/ClaudeWorkflows/comments/1ujy4wq/workflow_designing_robust_claude_agent_loops/

This article is from the WeChat public account "新智元," author: 元宇 (Yuan Yu)

Criptos en tendencia

Preguntas relacionadas

QWhat are the four types of 'loops' defined by the Claude Code team for autonomous AI agents to work automatically?

AThe four types of loops defined by the Claude Code team are: 1. Turn-based loops (controlled by the user, one prompt at a time), 2. Goal loops (stop when a predetermined goal is met or a number of attempts is exhausted), 3. Time loops (triggered by time intervals or schedules), and 4. Proactive loops (event or time-triggered, running autonomously until manually stopped).

QWhat is the most valuable practical tip for designing robust loops according to Claude Code?

AThe most valuable practical tip is 'verification'. It involves giving the AI agent a way to self-check and verify its own outputs within the loop. This creates a feedback mechanism, allowing the agent to iterate and refine its work until a set condition is satisfied.

QWhat are the three essential 'gating conditions' needed to control a loop and prevent potential risks?

AThe three essential gating conditions are: 1. A clear 'done' condition (machine-verifiable, e.g., all tests pass). 2. Hard caps (maximum iterations or cost limit) to prevent infinite loops and budget overruns. 3. A 'lack of progress' detection mechanism to stop the loop if it gets stuck repeatedly modifying the same files without achieving new passed tests.

QAccording to the article, how does the emergence of 'loop engineering' change the core focus for developers using AI?

AThe focus shifts from 'prompt design' (crafting content and instructions) to 'system behavior design'. Developers now design the entire system: how the AI is triggered, how it validates its work, and the conditions under which it stops. The core skills become orchestrating workflows and defining clear, verifiable stopping criteria.

QWhat simple starting point does the article suggest for finding tasks suitable for automation via loops?

AThe article suggests looking at your own daily work, identifying a bottleneck, and asking three questions: 1. Can I articulate the verification check for this task? 2. Is the goal clear and well-defined? 3. Does the work appear at a regular, predictable pace? If the answer to any of these is 'yes', it is a potential candidate for an automated loop.

Lecturas Relacionadas

A Critical Review of Base Co-founder's "Letter of Self-Criticism"

Yesterday, Base co-founder Jesse Pollak published a self-critical post on X, reflecting on Base's successes and failures over the past two years. While his candor is commendable, the author argues his analysis still misses key points. Jesse admitted his primary mistake was heavily betting that onchain social platforms (like Farcaster) and creator tokens would drive mainstream crypto adoption. The author harshly criticizes this strategy, giving it a "0/100" score. They argue onchain social offers no superior user experience, and creator tokens, like Jesse's own $JESSE, fail to solve fundamental issues about value and creator adoption, unlike successful memecoins on other chains. The author is more forgiving regarding Base lagging in areas like perpetual DEXs and prediction markets, giving this an "80/100". They note strong competitors like Hyperliquid had unique advantages, and Base has found significant success in other narratives like AI and RWA. The author gives Jesse's overall reflection a "60/100" or passing grade. While Jesse now correctly sees multiple paths to adoption (stablecoins, payments, AI Agents) beyond just social, he, along with other industry leaders like Toly and Vitalik, still underestimates the powerful role of memecoins in driving mainstream awareness and adoption. The critique concludes that leaders often leverage memes for user acquisition but fail to genuinely embrace or thoughtfully develop the space, revealing a retreat from idealism and a disconnect from grassroots, viral growth mechanisms.

marsbitHace 13 min(s)

A Critical Review of Base Co-founder's "Letter of Self-Criticism"

marsbitHace 13 min(s)

When Traditional Finance Fails People in Crisis, Bitcoin Succeeds

When traditional finance fails to reach people in crisis, Bitcoin succeeds. This article highlights how fundraising platforms like GoFundMe face severe limitations in delivering aid to conflict zones like Gaza due to banking regulations, sanctions, and compliance rules. For instance, Sami Jamal Al-Shannat raised over £55,000 for his family but couldn't receive the funds directly; instead, money had to be routed through a beneficiary in another country, leading to disputes and loss of access. The piece explores how compliance requirements often force reliance on intermediaries, shifting risk and responsibility away from platforms and onto individuals. In contrast, Bitcoin and blockchain-based platforms like Geyser and Agora enable direct, peer-to-peer transactions, bypassing traditional financial bottlenecks. These platforms shift trust from centralized institutions to verifiers—local partners or trusted organizations—who validate projects, allowing donors to send funds directly to recipients' wallets. While not a panacea, Bitcoin offers a way to circumvent "transnational financial repression," where sanctions and AML rules inadvertently harm legitimate aid recipients, activists, and dissidents. The conclusion emphasizes that open payment networks and decentralized trust models represent a systemic shift, empowering beneficiaries and providing more resilient humanitarian fundraising in crisis situations. However, challenges around verification, accountability, and fraud prevention remain.

marsbitHace 40 min(s)

When Traditional Finance Fails People in Crisis, Bitcoin Succeeds

marsbitHace 40 min(s)

Bitcoin Shifts Towards Consolidation, Long-Term Holder Selling Pressure Significantly Eases

Bitcoin's Bottoming Process Shows Signs of Shifting Dynamics Bitcoin's bottom formation is ongoing, but key characteristics are changing. The capitulation selling by long-term holders (LTHs), a primary source of selling pressure this cycle, has begun to cool from its recent peak. Buyers successfully absorbed the selling at the June lows, and price is now recovering to challenge overhead resistance. The market is testing higher resistance levels. Bitcoin reacted more strongly to soft inflation data than major equity indices, signaling sellers may be exhausted and buyers are waiting for a catalyst. Its correlation with stocks is weakening while its inverse relationship with the USD is deepening, suggesting liquidity dynamics are now more influential than risk sentiment. On-chain, price sits between the network's Realized Price (a historical bear market floor) and the Short-Term Holder (STH) cost basis near $69k, a key resistance level where recent buyers break even. LTH profit-taking has largely dried up, and losses now dominate realized on-chain volume—a typical late bear market signal. Crucially, the pace of LTH capitulation has started to decline. Derivatives markets show bearish positions are being unwound, with put/call ratios falling and crash protection costs moderating. However, this derisking hasn't been accompanied by significant spot buying, a missing link for sustained recovery. US spot ETF outflows have slowed but not reversed. In conclusion, foundational elements for a bottom are forming: LTH selling is easing, low-point selling was absorbed, and the market is responding to positive macro cues. The next critical test is whether spot-driven buying can push price through and hold above the STH cost basis near $69k. The follow-through is not yet confirmed.

marsbitHace 58 min(s)

Bitcoin Shifts Towards Consolidation, Long-Term Holder Selling Pressure Significantly Eases

marsbitHace 58 min(s)

Defending Champions or New Kings? World Cup Final Sees All AIs Backing the Same Side

Will the 2026 World Cup final see Argentina successfully defend their title or a new champion crowned? AI models from various platforms have made their prediction. The final in Buenos Aires pits defending champions Argentina against a resilient Spanish side that has reached this stage with a record of exceptional defensive solidity, conceding only one goal in seven matches. Argentina's path was dramatically different, filled with late comebacks and narrow victories, including a semi-final win over England secured by late goals assisted by the 39-year-old Lionel Messi. A poignant subplot adds narrative weight: a nearly 20-year-old photo shows a young Messi bathing an infant Lamine Yamal, who is now a 19-year-old key player for Spain, symbolizing a potential passing of the torch. In the semi-finals, most AI models incorrectly predicted a French victory over Spain, with only Google's Gemini correctly picking Spain's advancement and also accurately forecasting Argentina's win over England. For the final, however, all six surveyed AIs—ChatGPT, Claude, Gemini, Grok, DeepSeek, and Qwen—unanimously predict a Spanish victory. Their reasoning centers on Spain's superior defense, midfield control, and better physical preparedness after a less strenuous knockout stage journey. While consensus favors Spain as champions, five of the six AIs believe the match will be tightly contested, predicting a draw (1-1 or 0-0) within regular time, with Spain's advantage potentially telling in extra time or even a penalty shootout. Only DeepSeek forecasts a clear Spanish victory within 90 minutes. The stage is set for a clash between Argentina's legendary fighting spirit and Spain's machine-like consistency, with artificial intelligence firmly backing the latter to lift the trophy.

Odaily星球日报Hace 1 hora(s)

Defending Champions or New Kings? World Cup Final Sees All AIs Backing the Same Side

Odaily星球日报Hace 1 hora(s)

Trading

Spot

Artículos destacados

Cómo comprar 4

¡Bienvenido a HTX.com! Hemos hecho que comprar 4 (4) sea simple y conveniente. Sigue nuestra guía paso a paso para iniciar tu viaje de criptos.Paso 1: crea tu cuenta HTXUtiliza tu correo electrónico o número de teléfono para registrarte y obtener una cuenta gratuita en HTX. Experimenta un proceso de registro sin complicaciones y desbloquea todas las funciones.Obtener mi cuentaPaso 2: ve a Comprar cripto y elige tu método de pagoTarjeta de crédito/débito: usa tu Visa o Mastercard para comprar 4 (4) al instante.Saldo: utiliza fondos del saldo de tu cuenta HTX para tradear sin problemas.Terceros: hemos agregado métodos de pago populares como Google Pay y Apple Pay para mejorar la comodidad.P2P: tradear directamente con otros usuarios en HTX.Over-the-Counter (OTC): ofrecemos servicios personalizados y tipos de cambio competitivos para los traders.Paso 3: guarda tu 4 (4)Después de comprar tu 4 (4), guárdalo en tu cuenta HTX. Alternativamente, puedes enviarlo a otro lugar mediante transferencia blockchain o utilizarlo para tradear otras criptomonedas.Paso 4: tradear 4 (4)Tradear fácilmente con 4 (4) en HTX's mercado spot. Simplemente accede a tu cuenta, selecciona tu par de trading, ejecuta tus trades y monitorea en tiempo real. Ofrecemos una experiencia fácil de usar tanto para principiantes como para traders experimentados.

795 Vistas totalesPublicado en 2025.10.20Actualizado en 2026.06.02

Cómo comprar 4

Discusiones

Bienvenido a la comunidad de HTX. Aquí puedes mantenerte informado sobre los últimos desarrollos de la plataforma y acceder a análisis profesionales del mercado. A continuación se presentan las opiniones de los usuarios sobre el precio de 4 (4).

活动图片