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

marsbitОпубліковано о 2026-07-17Востаннє оновлено о 2026-07-17

Анотація

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)

Трендові криптовалюти

Пов'язані питання

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.

Пов'язані матеріали

Stock Price Falls Below IPO Price, First Launch After IPO Hits a Snag, Where Will SpaceX Go From Here?

SpaceX Faces Post-IPO Pressure as Starship Launch Aborted, Stock Slumps SpaceX's highly anticipated 13th test flight of its Starship rocket was aborted during the final ignition sequence on July 17th due to issues with some Raptor engines failing to start as expected. CEO Elon Musk stated the company will replace two engines and aims for another launch attempt early next week. This setback comes at a critical time for SpaceX. Following its historic IPO last month, the company's stock (SPCX) has recently fallen below its offering price, down nearly 40% from its peak. The market had hoped a successful test would bolster the declining share price, but the abort triggered further after-hours selling. The article highlights a shift in investor perspective post-IPO. While previous Starship test failures were often viewed within SpaceX's "fail fast, iterate" Silicon Valley engineering culture as valuable data points, public market investors are now more focused on timelines, commercialization prospects, and their impact on valuation and future cash flows. Each delay or issue is now quickly factored into the stock price. While public listing provides crucial capital for ambitious projects like Starlink and Starship, it also brings increased scrutiny and pressure for predictable progress. The upcoming launch attempt is now seen as more than a technical milestone; its success or failure is likely to significantly influence market sentiment and the stock's near-term trajectory as SpaceX navigates the new realities of being a publicly traded company.

Odaily星球日报4 хв тому

Stock Price Falls Below IPO Price, First Launch After IPO Hits a Snag, Where Will SpaceX Go From Here?

Odaily星球日报4 хв тому

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.

marsbit30 хв тому

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

marsbit30 хв тому

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.

marsbit57 хв тому

When Traditional Finance Fails People in Crisis, Bitcoin Succeeds

marsbit57 хв тому

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.

marsbit1 год тому

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

marsbit1 год тому

Торгівля

Спот

Популярні статті

Як купити 4

Ласкаво просимо до HTX.com! Ми зробили покупку 4 (4) простою та зручною. Дотримуйтесь нашої покрокової інструкції, щоб розпочати свою криптовалютну подорож.Крок 1: Створіть обліковий запис на HTXВикористовуйте свою електронну пошту або номер телефону, щоб зареєструвати обліковий запис на HTX безплатно. Пройдіть безпроблемну реєстрацію й отримайте доступ до всіх функцій.ЗареєструватисьКрок 2: Перейдіть до розділу Купити крипту і виберіть спосіб оплатиКредитна/дебетова картка: використовуйте вашу картку Visa або Mastercard, щоб миттєво купити 4 (4).Баланс: використовуйте кошти з балансу вашого рахунку HTX для безперешкодної торгівлі.Треті особи: ми додали популярні способи оплати, такі як Google Pay та Apple Pay, щоб підвищити зручність.P2P: Торгуйте безпосередньо з іншими користувачами на HTX.Позабіржова торгівля (OTC): ми пропонуємо індивідуальні послуги та конкурентні обмінні курси для трейдерів.Крок 3: Зберігайте свої 4 (4)Після придбання 4 (4) збережіть його у своєму обліковому записі на HTX. Крім того, ви можете відправити його в інше місце за допомогою блокчейн-переказу або використовувати його для торгівлі іншими криптовалютами.Крок 4: Торгівля 4 (4)Легко торгуйте 4 (4) на спотовому ринку HTX. Просто увійдіть до свого облікового запису, виберіть торгову пару, укладайте угоди та спостерігайте за ними в режимі реального часу. Ми пропонуємо зручний досвід як для початківців, так і для досвідчених трейдерів.

473 переглядів усьогоОпубліковано 2025.10.20Оновлено 2026.06.02

Як купити 4

Обговорення

Ласкаво просимо до спільноти HTX. Тут ви можете бути в курсі останніх подій розвитку платформи та отримати доступ до професійної ринкової інформації. Нижче представлені думки користувачів щодо ціни 4 (4).

活动图片