Skip to content

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.

01

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.

02

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

The loop, and where it needs a limitDrawn as a cycle it is obvious that nothing in the shape ends it. Each pass through is locally sensible: given what is known, the next action is a reasonable one, and the fact that it closely resembles the previous three is not something any single step is positioned to notice. That is the structural reason agents loop, and it is why the remedy is structural too. A step limit ends the run; a rule about repeated actions catches the narrower case of the same thing being tried twice; and a requirement to report what has been established so far, every few passes, forces the accumulated state into a form somebody can read. The last of those does double duty, because it is also the summary that keeps a long run from drifting as its earliest instructions are displaced. None of this makes the pattern worse. It is the right shape for work whose next step genuinely depends on the last result, and the limits are what make it safe to leave running.chooses oneactionreturns a resultfeeds the nextdecisionReasonWHAT TO DO NEXTActONE STEP, NOT THE PLANObserveWHAT CAME BACK
Drawn as a cycle it is obvious that nothing in the shape ends it. Each pass through is locally sensible: given what is known, the next action is a reasonable one, and the fact that it closely resembles the previous three is not something any single step is positioned to notice. That is the structural reason agents loop, and it is why the remedy is structural too. A step limit ends the run; a rule about repeated actions catches the narrower case of the same thing being tried twice; and a requirement to report what has been established so far, every few passes, forces the accumulated state into a form somebody can read. The last of those does double duty, because it is also the summary that keeps a long run from drifting as its earliest instructions are displaced. None of this makes the pattern worse. It is the right shape for work whose next step genuinely depends on the last result, and the limits are what make it safe to leave running.
03

Seen in the wild

  • An agent that tries a search, reads the result and refines its next query.

    Manus
  • A coding agent that runs a test, reads the failure and changes what it does next.

    Claude Code
  • A workflow whose steps are all known in advance, where this pattern is unnecessary.

    n8n
04

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.

05

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.
06

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.
08

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

All glossary terms