home/glossary/Chain of Thought
Context Engineering

Chain of Thought

definition

Chain-of-thought prompting instructs models to show their reasoning steps before arriving at an answer, significantly improving accuracy on complex tasks like math, logic, and multi-step planning. For agent systems, visible reasoning makes decisions transparent and debuggable, helping developers understand why an agent chose a particular tool or action — without chain-of-thought, agent failures become opaque black boxes.

Chain-of-thought prompting instructs models to show their reasoning steps before arriving at an answer, significantly improving accuracy on complex tasks like math, logic, and multi-step planning. For agent systems, visible reasoning makes decisions transparent and debuggable, helping developers understand why an agent chose a particular tool or action — without chain-of-thought, agent failures become opaque black boxes. Extended thinking features in models like Claude 3.7 Sonnet provide dedicated reasoning space that does not count against output tokens, creating a computational "scratchpad" the model uses to work through complex problems before committing to a response. This technique is especially important for agentic coding because it forces the model to plan before acting, reducing costly mistakes in multi-step tool-use loops. This concept connects to the ReAct pattern which formalizes the think-act cycle, reasoning models which build chain-of-thought directly into the architecture, and trace analysis for debugging agent reasoning chains.