Agent loop
A model uses tools in a loop, deciding each next step from what the last one returned.
Also called Tools in a loop, ReAct, Agentic loop
Yao et al., Anthropic, Simon Willison
The problem
You cannot predict the number of steps or hardcode the path.
Agents can be used for open-ended problems where it’s difficult or impossible to predict the required number of steps, and where you can’t hardcode a fixed path.
Therefore
An LLM agent runs tools in a loop to achieve a goal.
They are typically just LLMs using tools based on environmental feedback in a loop.
In use
Anthropic
In our own implementation, agents can now solve real GitHub issues in the SWE-bench Verified benchmark based on the pull request description alone.
Claude Code
Each tool use gives Claude new information that informs the next step. This is the agentic loop in action.
Where it breaks
Autonomy costs more, errors compound, and the model can repeat itself without leaving the loop.
The autonomous nature of agents means higher costs, and the potential for compounding errors.
there is one frequent error pattern specific to ReAct, in which the model repetitively generates the previous thoughts and actions
Sources
- ReAct: Synergizing Reasoning and Acting in Language ModelsShunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, Yuan Cao, Yao et al., Oct 6, 2022
We apply our approach, named ReAct, to a diverse set of language and decision making tasks and demonstrate its effectiveness over state-of-the-art baselines in addition to improved human interpretability and trustworthiness.
- Building effective AI agentsAnthropic, Dec 19, 2024
- How Claude Code worksAnthropic
- I think “agent” may finally have a widely enough agreed upon definition to be useful jargon nowSimon Willison, Simon Willison, Sep 18, 2025
The “tools in a loop” definition has been popular for a while—Anthropic in particular have settled on that one
Added Nov 14, 2026

