ReAct (Reasoning + Acting) is the most common architecture for agentic AI. It's what Claude Code uses, what most agent frameworks implement, and what you'll use as a default pattern.
Instead of the model thinking everything through then acting, or acting without thinking, ReAct interleaves reasoning and action:
Thought: I need to find the bug. Let me look at the error log first.
Action: Read the error log file
Observation: "TypeError: Cannot read property 'name' of undefined at line 42"
Thought: The issue is on line 42, accessing 'name' on something undefined. Let me check what's passed to that function.
Action: Read the source file around line 42
Observation: function getUser(id) { return users.find(u => u.id === id).name }
Thought: The find() could return undefined if no user matches. I need to add a null check.
Action: Edit the file to add null handling
Each cycle: think about what you know, take one action, observe the result, think again.
You just read a ReAct trace. Can you reconstruct the sequence?
ReAct isn't perfect. Common failure modes:
Infinite loops: The agent keeps trying the same approach that doesn't work. Solution: track attempted actions and force variation after N failures.
Hallucinated tools: The model invents tools that don't exist. Solution: strong tool descriptions and listing available tools in the system prompt.
Premature termination: The agent declares victory before actually solving the problem. Solution: require verification steps (run the test, check the output).
Context window saturation: Long ReAct chains fill the context window with observations. Solution: summarize intermediate results, drop old observations.
In Claude Code, you see ReAct in action every time it:
The CLAUDE.md rules like "When there's a bug, start by writing a test that reproduces it, then fix it" are essentially ReAct templates — they structure the reasoning-action pattern for specific scenarios.
Time to consolidate what you learned.