Agentic Loop
Agentic Loop
The execution pattern that makes an LLM into an agent rather than a chatbot. Also called the ReAct pattern — Reason, Act, observe, repeat.
The loop
- Task arrives (via Slack, iMessage, CLI, API, etc)
- Assemble context: conversation history + long-term memory + system instructions + available tools
- Send to LLM for reasoning
- Need a tool?
- Yes → execute the tool, get result, append to context, go back to step 3
- No → return final response
- Loop until no more tools needed
- Respond
"And that, my friends, is the core pattern behind every agent framework out there." — What is OpenClaw (IBM Technology)
Where it appears in this wiki
- OpenClaw — explicit ReAct implementation around its Gateway
- Claude Code — same pattern, with extensions like
/loopand sub-agents adding meta-loops on top - Blitzy — autonomous-platform variant; the loop runs entirely server-side without IDE interaction
- Printing Press — CLIs are tools the loop can call; designed for short, clean tool outputs
A role-labeled view of the same loop (Sandeep)
You're Not Behind (Yet) Learn AI Agents (theMITmonk) gives the same mechanism with role labels instead of step labels — useful when explaining agents to non-technical audiences:
| Role | What it does in one pass of the loop |
|---|---|
| Analyst | Finds the pattern in raw inputs |
| Planner | Decides what matters and what to do |
| Operator | Executes — calls tools, produces output |
| Auditor | Checks the result, refines |
The four roles aren't separate processes — they're labels for what one LLM is doing on successive passes of the ReAct loop. Useful framing for board-level / CMO explanations.
The same source contributes OODA Loop as the adversarial-speed framing layered on top of the agentic loop — ReAct is the mechanism; OODA is the bar.
Variants worth knowing
- One-shot retrieval — no loop; classic RAG
- Agentic RAG — loop over retrieval (decide if you have enough, fetch more) — see Context Engineering and GraphRAG (IBM Technology)
- Multi-agent / sub-agents — loops within loops; one agent spawns others. The product instance is Claude Code Workflows / Ultracode: a planning agent fans out to hundreds of parallel sub-agents (per MYTHOS MYTHOS MYTHOS (Matthew Berman), 63–100+ at once on Fable 5)
- Scheduled loops —
/loopcron-style (Boris Cherny on Coding Is Solved (Sequoia AI Ascent)) — agentic loop wrapped in a recurring trigger - Outer goal-loops ("software factories") — wrap autonomous agents + parallel workflows in a loop that burns tokens toward a goal until reached. Berman frames loops (per Steinberger / Boris Cherny) as "the next abstraction layer above agentic engineering"; loops × workflows × Fable 5 is his "nobody understands what's coming" thesis — see MYTHOS MYTHOS MYTHOS (Matthew Berman) and How Loops Are Improving Work — Sunil's Research Brief
- Auto-research loops — meta-loop layered over agentic loops; each "experiment" is one or more ReAct executions wrapped in a keep/revert + never-stop control structure against a fixed metric. See Build Self-Improving Claude Code Skills (Simon Scrapes) for a skill-layer instance with Binary Eval Assertions
Empirical design notes — what wins (MAC, June 2026)
Meta-Agent Challenge (Autonomous Agent Development Benchmark) ran 39 (model × domain × run) configurations and qualitatively analyzed the artifacts produced by frontier meta-agents. Top-performing agentic artifacts on SWE-Bench and Terminal-Bench were minimal ReAct-style loops over a small toolset, sharing three design choices:
- Prompt caching on API calls to minimize per-loop latency
- Pre-search warming from issue symbols to populate context before the first LLM invocation (cuts wasted loops)
- A singular verification nudge forcing the model to verify all requirements before terminating
Notably, no top reasoning artifact used tree search or planner-worker decomposition despite their prevalence in the literature. Reasoning winners converged on parallel sampling + majority voting + prompt diversification. The empirical answer to "elaborate scaffolding vs minimal loop" is, at least for current frontier models: minimal loop wins.
Failure modes
- Compounding errors — one bad tool result feeds the next decision; in multi-agent setups, this gets bad fast (per Agentic AI in the Enterprise (Praveen Akkiraju, CXOTalk))
- Tool selection wrong — agent picks
curlfor a JS-rendered page and starts reverse-engineering Next.js (see CLI vs MCP (IBM Technology)) - Prompt injection — untrusted tool output (web page, email) carries instructions; agent treats them as legitimate
2026-06-13 — cross-references (where the loop runs, and who pays for it)
Three threads converging on the agentic loop's economics and deployment surface:
- Edge / on-device inference. Apple's new Siri (Apple's New Siri Bets on Google Models (Economist)) runs the loop on-device on Apple silicon, keeping personal data on the handset and sidestepping data-centre spend — the loop doesn't have to live in a hyperscaler's data centre.
- Agents-don't-need-seats economics. The SaaSpocalypse thesis (Fear of the SaaSpocalypse (Economist)) is the business-model consequence of this page's mechanism: once the loop does the work, per-seat SaaS pricing decouples from value and consumption/token pricing takes over.
- Assisted → agentic demand shift. The move from a human-in-the-loop assisted model to autonomous agentic execution multiplies tokens burned per task — driving the token-scarcity pressure tracked in The New Dumbest Chart in AI (AI Daily Brief) and Token Maxing. More loop iterations per outcome is the demand side of the compute squeeze.
Sources
- What is OpenClaw (IBM Technology)
- You're Not Behind (Yet) Learn AI Agents (theMITmonk) (Analyst/Planner/Operator/Auditor role labels; OODA adaptation layer)