Lv.1 0 XP

The Observe-Think-Act-Respond Cycle — The Cognitive Loop of an Agent

Core 8 min +35 XP
💡
THE ANALOGY

A chess player's thinking process. Observe the board position. Think through possible moves and consequences. Act by moving a piece. Observe the opponent's response. Repeat until checkmate or draw. An agent does exactly this — except the 'board' is a complex real-world task.

⚠️ EXAM TRAP — The Wrong Answer People Choose

Assuming the 'think' phase is visible to your code. Claude's reasoning happens inside the model — you only see its output (text or tool calls). The think phase is opaque. You interact with observe (what you send) and act (what Claude returns).

KEY POINTS
1 Observe: Claude receives the current conversation state — user message, prior tool results, and conversation history.
2 Think: Claude reasons internally about what to do next — this is opaque to your code.
3 Act: Claude outputs either text (task complete) or tool_use blocks (needs more information or action).
4 Respond: your code executes the action and appends the result, enabling the next observe phase.
5 The entire agentic loop implements this cycle — stop_reason tells you which phase came out: end_turn (task complete) or tool_use (needs more).