Part 2 · The Harness Around the Model

ReAct Loop: Think → Act → Observe

A task to remove console.log goes through 14 iterations, including self-correction

THE QUESTION THIS PAGE ANSWERS

ANSWER FIRST

What is the key idea behind “ReAct Loop: Think → Act → Observe”?

A task to remove console.log goes through 14 iterations, including self-correction

DECISION RULE

Make the claim earn its place. Use this page as a decision aid, not a definition to memorize. Connect the idea to one real task, one observable result, and one failure that would change your mind.

TRY NEXT

Write one question you could answer with evidence after trying this idea.

WATCH FOR

A conclusion that sounds complete but leaves the key assumption untested.

User instruction
Remove all console.log calls from the project, then run the tests to make sure nothing is broken
🧠
Thought
🔧
Action
👁
Observation
↩ Back to Thought (loop continues)
Current loop 0 / 50
Tool calls 0
Tokens consumed 0
ReAct execution trace
Thought
Action
Observation
8 steps total · watch how a complex task unfolds across multiple loops
Takeaway
Takeaway An Agent works as a loop: "Think → Act → Observe → Think again." A complex task may loop a dozen or more times. This is the fundamental difference between an Agent and a simple chatbot: it adjusts its strategy based on execution results.

How “User instruction” changes an answer

“A task to remove console.log goes through 14 iterations, including self-correction” shows that a model does not process the “word count” we see. It processes Token pieces. Tokenization affects input length, how much context fits, and how much computation a request consumes.

Length, information, and context are different

As “A task to remove console.log goes through 14 iterations, including self-correction” grows, separate three questions: how many Tokens the text becomes, which pieces can change the current decision, and whether older material has fallen outside the context window. Removing repetition is often more useful than simply making the window larger.

Keep what can change the decision

Use “A task to remove console.log goes through 14 iterations, including self-correction” as an A/B test: keep the same question while removing repeated background, compressing format, and trimming irrelevant history. Compare answer quality, latency, and Token count.

Take the example one step further

The page first makes this point: “Remove all console.log calls from the project, then run the tests to make sure nothing is broken 🧠 Thought ↓ 🔧 Action ↓ 👁 Observation ↩ Back to Thought (loop continues) Current loop 0 / 50 Tool calls 0 Token…”. Turn it into a small exercise rather than a sentence to memorize: write down the input, expected result, and the observation that would make you re-check the judgment.

Carry the judgment into the next situation

For long text, keep what can change the conclusion before compressing format and history. A larger context is worth its cost only when the added information is useful.

  • “User instruction”: Remove all console.log calls from the project, then run the tests to make sure nothing is broken 🧠 Thought ↓ 🔧 Action ↓ 👁 Observation ↩ Back to Thought (loop continues) Current loop 0 / 50 Tool calls 0 Token…

Finish with a small, reversible exercise: put the page's judgment into a real input, write the expected result, and name the signal that would make you stop and verify it.

Mark as learned Your reading progress updates automatically
← PreviousNext →

Keep reading

The next useful article in the thread.

ARTICLE DISCUSSION

Leave one useful thought here.

Keep the idea that clicked, the question that stayed open, or a small note for the next learner.

Discussing ReAct Loop: Think → Act → Observe The Harness Around the Model
3discussionsArticle discussion · synced with the Circle
View in the learning circle
AM
Asha MorganContent editor
INSIGHTField note

I turned one judgment from this article into a small experiment I could run today. Knowing what to observe next is more useful than simply remembering the conclusion.

ARTICLE DISCUSSION7 helpful
LH
Lin HarperIndie developer
INSIGHTInsight

After reading this, I first looked for the conditions behind the idea instead of copying the method into a project. That order made the later trade-offs much clearer.

ARTICLE DISCUSSION5 helpful
KM
Kiki MooreProduct operations
QUESTIONQuestion

When this judgment reaches real work, which constraint should be added first? I am curious which step matters most between reading and the first practical attempt.

ARTICLE DISCUSSION4 helpful