Claude Code Officially Introduces Four Types of Loops for Autonomous AI Workflows

icon MarsBit
Share
AI summary iconSummary
Claude Code introduces four AI workflow loops for autonomous tasks: turn-based, goal-driven, time-triggered, and proactive loops that enable AI agents to complete tasks until stopping conditions are met. Developers now focus on building structured systems for self-validation and termination. This update appears in AI + crypto news and reflects growing on-chain interest in AI automation.

The real threshold of cycling isn't about keeping the AI running continuously, but whether it can stop itself.

"No more writing prompts"—recently, this phrase has been going viral in the AI community.

From Peter Steinberger, the father of OpenClaw and now leading the development of next-generation personal agents at OpenAI, to Boris Cherny, creator of Claude Code, these Silicon Valley giants are collectively shifting toward "loops."

Also among them is Google engineer Addy Osmani, who named this trend "loop engineering."

Cherny said he now hardly writes prompts by hand himself.

An agent is writing prompts for him to send to Claude, and he only communicates with the new Claude that coordinates everything.

He also dropped a bold statement: a decade from now, loops and similar features will be among his most proud achievements.

Steinberger put it even more bluntly: Stop writing prompts for programming agents—you should design the cycles that feed them prompts.

He also demonstrated on X how he cycles it: having Codex wake up every five minutes to automatically maintain code repositories and assign tasks, with some work fully autonomous.

Agent

What exactly is this "cycle" that everyone keeps talking about?

Recently, the Claude Code team provided a clear definition on their official blog and outlined four types of loops, establishing engineering guidelines for "agent-driven automation."

Agent

The Claude Code team has published an article formally defining "cycles" and identifying four typical types: turn-based, goal-oriented, time-based, and active cycles.

Behind it all: AI programming is shifting from “writing a single line” to “designing an autonomous system.”

One prompt earns you one response; the cycle you set in motion results in a system that continues working for you even after you close your laptop.

And programmers are transitioning from writing content to designing systems.

Four loops, four "stopping conditions"

What exactly is a cycle?

There has been a long debate on X, with many differing answers, but the Claude Code team has provided a clear definition:

Looping is when an agent repeatedly performs one round of work after another until a stopping condition is triggered.

Four loops, four "stopping conditions"—this sentence is key to understanding Claude Code's technical blog on loops.

Claude Code categorizes loops into four types based on the dimensions of how to trigger them, how to stop them, what primitives to use, and what tasks they are suitable for.

First, turn-based cycling.

Agent

Turn-based cycle, with players taking turns to control; each prompt initiates a round. (Source: Claude's official blog)

Human-controlled, step-by-step: you write one sentence, the AI runs one round, you review it, then write the next—全程你握着方向盘. It’s ideal for scattered, short tasks that don’t require formal workflows or scheduling.

To reduce the number of back-and-forth steps, write the manual checks you normally perform into a SKILL.md file and let the AI verify them on its own.

The more quantified the check, the better it can judge for itself whether it’s done correctly, and the less you need to monitor.

Second, goal cycle (/goal).

Agent

Target cycle: The evaluator model assesses against established criteria; if standards are not met, it is sent back for revision. (Source: Claude official blog)

First, set a fixed target, such as "Achieve a Lighthouse score above 90 on the homepage, and stop after 5 attempts."

Each time Claude wants to stop, an evaluator model checks its output against your criteria; if it doesn’t meet the standards, it’s sent back to continue until the goal is achieved or your set number of rounds is exhausted.

Quantifiable standards such as the number of passed tests and score thresholds work well because Claude doesn't have to wrestle with whether it's "good enough"—the evaluator makes the call. It doesn't need to guess "close enough" and stop prematurely, allowing the loop to end cleanly and efficiently.

Third, time cycling (using /loop and /schedule).

Triggered at time intervals, like an alarm. Some tasks are repetitive—the task remains the same, only the input changes—such as summarizing Slack messages every morning.

Some live systems monitor external systems by simply checking at regular intervals to see what has changed and then responding accordingly—for example, a pull request that may receive reviews or fail a CI check.

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

This logic is almost identical to the scheduled tasks (cron) familiar to programmers.

Fourth, proactive cycling.

Agent

Active cycling, triggered by events or time, fully unattended until you manually turn it off. (Image source: Claude's official blog)

Triggered by events or time, fully unattended.

With auto mode and dynamic workflows, seamlessly automate long-running tasks: scan the feedback channel every hour; upon receiving a bug report, automatically triage, fix, and respond—all in one continuous flow, without ever pausing to ask for your permission.

Each task exits upon achieving its goal, while the entire batch of routine tasks continues running until you manually stop it. It’s ideal for continuous, well-defined tasks: bug reporting, issue categorization, and dependency upgrades.

Four types of loops, in essence, are four answers to the question: “When should I stop?”—decided by a person, an evaluator, time, or an event.

Look one level deeper.

According to the official Agent SDK documentation, the core of this mechanism is also very simple:

Claude evaluates your prompt, invokes tools to take action, retrieves the results, and repeats this process until, in one iteration, it no longer calls any tools, at which point the cycle ends.

Agent

The agent loop described in the official Claude Code Agent SDK documentation: after a prompt is entered, Claude evaluates it, calls tools, receives the results, and re-evaluates—repeating this cycle until no further tool calls are made, at which point it outputs the final answer. (Source: Official Claude Code documentation)

A self-contained agent, in essence, is exactly such a circle.

What truly changed is not the cycle itself.

Of course, the "design loop" cannot be described as a revolution from zero to one.

Scheduling, orchestration, and feedback loops have long existed; what Claude has done this time is primarily to unify them under consistent terminology and organize them into a standardized classification system.

So, what exactly changed? The focus is on the "stop condition."

Among the practical tips compiled by Claude Code, the one singled out and labeled as "the most valuable" is verification:

Give Claude a way to self-check its output.

The concept is not hard to understand.

For example, if you ask an engineer to build a webpage but don’t provide a browser, can the page look good? But if you give them a browser, they can see the results immediately with every change, refining it repeatedly until they’re satisfied before submitting.

And the power of the model's loop lies precisely in its ability to close the loop on itself.

In this process, prompts did not die; they simply became a component within the loop.

The true core lies in designing stop conditions, verifiers, token budget control, and multi-round execution strategies.

A loop without a gate—powerful and dangerous

Does looping mean you can let the AI work on its own all day?

Of course not.

The first hurdle is money—an unlimited cycle can burn through token costs.

According to reports, Steinberger described himself as "the man with infinite tokens," since receiving free tokens is one of the perks of working at OpenAI—a benefit not available to the general public.

The second is more subtle. The agent gets trapped in a vicious cycle that appears to make progress but actually goes nowhere: repeatedly modifying the same file yet never producing a new version that passes the test.

It will confidently make a wrong solution even more “complete.”

The engineering community’s consensus is straightforward: cycles are strong, but without a gating condition, they are dangerous.

In a Reddit engineering discussion, someone summarized the essential gates as three principles that must be designed before writing any loops.

Done condition: Must be machine-determinable, such as all tests passing in green or a specific spec item being disabled;

Hard cap: Includes maximum rounds and maximum spending to prevent cost overruns and infinite loops;

No progress detection: Force a stop if it repeatedly hits the same set of files without any new passes.

The official team has also provided a complete set of cost-saving guidelines:

Don't overcomplicate simple tasks with multi-agent systems;

Use smaller, cheaper, and faster models when possible instead of always relying on the strongest ones;

Before running at full scale, test with a small portion first;

Leave deterministic tasks 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, the cycle is a comprehensive design for "how to govern AI," not "letting AI run wild."

This also means it is currently best suited for well-defined, structured tasks rather than unfettered, creative freeform work.

Previously, it was about who could speak; now it’s about who can build systems.

In this round of change, what has truly shifted is the programming focus: from "content design" to "behavior system design."

Previously, you designed the content of a single instruction; now you are designing an entire set of behaviors: how it is triggered, how it is verified, and how it is stopped.

Claude Code offers a simple starting point for those who want to design loops:

Look at the work you do every day, pick one bottleneck step, and ask yourself three questions:

Verification: Can I write out that verification check?

Goal: Is the goal description clear enough?

Rhythm: Does the work appear at a consistent pace?

If at least one answer is yes, you’ve found the first cycle to submit.

Agent

AI programming used to be about mastering prompt techniques; now it’s about who can build systems: those who can design a loop that verifies itself and knows when to stop.

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

And the real circular designers have just entered the stage.

Reference materials:

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 "New Intelligence Yuan," authored by Yuan Yu.

Disclaimer: The information on this page may have been obtained from third parties and does not necessarily reflect the views or opinions of KuCoin. This content is provided for general informational purposes only, without any representation or warranty of any kind, nor shall it be construed as financial or investment advice. KuCoin shall not be liable for any errors or omissions, or for any outcomes resulting from the use of this information. Investments in digital assets can be risky. Please carefully evaluate the risks of a product and your risk tolerance based on your own financial circumstances. For more information, please refer to our Terms of Use and Risk Disclosure.