Glossary
ReAct pattern
A common design for automated work: alternate between working out what to do and doing it, using what came back to decide the next step.
In plain terms
Think a bit, do one thing, look at what happened, think again. The alternative is planning everything in advance and executing blindly, which fails as soon as reality differs from the plan, and reality usually does.
Why it matters
Because it is the shape almost every practical agent takes, and understanding it explains both why agents can recover from surprises and why they sometimes go around in circles for twenty steps without anybody noticing.
How it works
The loop alternates between deciding and doing. A step of reasoning selects one action, the action produces a result, and that result becomes part of what the next reasoning step considers, so the plan is revised continuously rather than fixed at the start.
That is what makes recovery possible. A system that planned everything in advance has no mechanism for noticing that step three returned something unexpected, whereas this shape treats every result as information about what to do next.
The same property is what allows loops. Nothing in the pattern prevents trying a variation of something that already failed, so an agent can spend many steps making no progress while each individual step looks reasonable.
That makes a step limit part of the design rather than a safeguard added later. Without one there is no natural point at which the process concludes it is not getting anywhere, because each step is decided locally.
The written reasoning is the part to be careful about. It reads as an explanation of why the action was chosen and is better understood as text produced alongside it, so it is useful for following what happened and is not evidence of why.
Each pass costs a full round of thinking, which is where the expense comes from. A task that takes fifteen steps has paid for fifteen decisions plus everything accumulated along the way, so the same work done as a fixed sequence is not marginally cheaper but substantially so.
Where the pattern earns its cost is in tasks whose steps depend on results. Where every step is known in advance, an ordinary sequence is cheaper, faster and easier to debug, and using an agent for it is paying for adaptability that will never be exercised.
The loop, and where it needs a limit
Seen in the wild
An agent that tries a search, reads the result and refines its next query.
ManusA coding agent that runs a test, reads the failure and changes what it does next.
Claude CodeA workflow whose steps are all known in advance, where this pattern is unnecessary.
n8n
Common misconceptions
People assume
The reasoning it prints explains the action.
In fact
It is text generated alongside the action rather than a record of a cause. It is genuinely useful for following what a run did, and treating it as an audit trail attributes more to it than it can support.
People assume
It is the right shape for any multi-step task.
In fact
It pays for adaptability. Where every step is known in advance, an ordinary sequence is cheaper, faster and far easier to debug, and the loop adds cost and variability in exchange for flexibility nothing will use.
Questions
- Why do agents sometimes loop for many steps?
- Because each step is decided locally, so nothing recognises that the last five attempts were variations of the same failed idea. Every individual step looks reasonable, which is why a step limit belongs in the design rather than being added after somebody notices.
- Can we use the printed reasoning as an audit trail?
- Not as evidence of why an action was chosen. It is produced alongside the action rather than causing it, so it is valuable for following what a run did and should not be relied on to explain a decision to somebody who needs a real answer.
- When is a plain sequence better?
- Whenever the steps are known in advance and do not depend on what came back. A fixed sequence is cheaper, runs faster, behaves the same way twice and is far easier to debug, and choosing it is not a lesser option.
Key takeaways
- Reason, act, observe, repeat: the plan is revised as it goes.
- That is why agents recover from surprises and why they can loop.
- A step limit is part of the design, not a later safeguard.
- Printed reasoning follows the run; it does not explain the choice.
Tools that use this
- Manus
Searching, reading the result, refining the next query.
- Claude Code
Running a test, reading the failure, changing course.
- n8n
Steps known in advance, where the loop is unnecessary.
Last checked August 2026