AIToday
Large Language ModelsAI Coding AssistantsAI Business & IndustryITmedia AI+Published: Jul 7, 2026, 06:00 JST

Anthropic breaks down AI coding loops into 4 types for Claude Code users

Anthropic breaks down AI coding loops into 4 types for Claude Code users

3 Key Points

  1. What happened

    Anthropic published a guide titled "Getting started with loops" on June 30, 2026, explaining how Claude Code's loop feature works across four distinct patterns: turn-based, goal-based, time-based, and proactive loops. The guide organizes each loop by what triggers it, when it stops, what primitive it uses, and what comes after.

  2. Why it matters

    AI agents often get stuck repeating tasks without clear stopping points. By naming and contrasting these four loop types, Anthropic helps developers and AI teams design more predictable automation—each pattern suits different workflows (e.g., turn-based for human-driven feedback, goal-based for autonomous targets, time-based for scheduled checks, proactive for human-directed agent behavior). This clarity reduces confusion about when and how to apply loops in Claude Code.

  3. What to watch

    The guide emphasizes the difference between /loop (local, runs on your PC) and /schedule (cloud-based, runs as a background service). Developers can also use "Routines" in Claude Desktop to automate loop execution. The distinction between these two command types and the proactive loop design may help teams avoid costly repeated token consumption and better manage agent workload.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

Anthropic's guide addresses a practical pain point in AI agent design: loops are powerful but easy to misuse. The body notes that prior guides referred to loops generically as "recursive loops" or "agent loops," leaving developers uncertain about which pattern fit their use case. By dividing loops into four named, structured types—each defined by trigger, stop condition, primitive, and sequel—Anthropic has made the feature more teachable and less error-prone.

The distinction between turn-based and goal-based loops is particularly significant: turn-based loops depend on human feedback at each step, while goal-based loops allow the agent to decide when to stop once a target is met. Time-based loops introduce a temporal constraint, and proactive loops grant the human control over start/stop without requiring a schedule or goal. This taxonomy helps developers match their automation intent to the right tool, reducing cases where an agent runs amok or consumes unexpected resources.

The guide's emphasis on /loop (local, synchronous) versus /schedule (cloud, asynchronous) further clarifies deployment trade-offs. For teams using Claude Code, this structural clarity may lower the barrier to confidently building multi-turn agent workflows. The mention of Routines in Claude Desktop suggests Anthropic is also making loop automation accessible via UI, not just CLI commands, though the guide centers on command-line usage.

FAQ
What are the four loop types Anthropic describes?
Turn-based loops follow human instruction and iteration; goal-based loops pursue a stated target; time-based loops run on a schedule (via /loop or /schedule commands); and proactive loops run when triggered by human direction, not on a timetable or goal condition.
What is the difference between /loop and /schedule commands?
/loop runs locally on your PC and stops when the PC shuts down, producing a synchronous heartbeat. /schedule runs in the cloud as a background service and is better suited for asynchronous, external-loop tasks; it is closer to how a proactive loop would run outside the local environment.
Why is the stop condition important for loops?
AI agents running loops consume tokens (the unit of text processed) as long as they keep executing. Defining a clear stop condition—what makes the loop end—prevents the agent from running indefinitely and helps manage cost and performance.

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleBroadcom Stock Down 24% Despite Record AI Growth, Jalapeño Chip Launch