Chain-of-thought
Chain-of-thought (CoT) prompting is a technique that instructs Claude to break a complex problem into a sequence of intermediate reasoning steps before producing a final answer. Rather than jumping directly to a conclusion, Claude is guided to 'show its work,' which reduces logical leaps, mathematical errors, and unsupported analytical claims. The core idea is that structured deliberation produces more accurate, nuanced, and verifiable outputs than immediate text generation.
There are two broad implementation paths. The simpler path uses natural-language instructions in the prompt itself — phrases like 'think step by step' or 'reason through this in <thinking> tags before answering.' This works with any model and any plan. The more powerful path uses the API's native thinking parameter, which lets Claude allocate dedicated compute to reasoning and returns structured thinking blocks alongside the final response.
Anthropic's thinking capability has evolved rapidly. Early versions required setting a fixed token budget (budget_tokens). Newer models — Opus 4.6+, Sonnet 4.6+, and later releases — use Adaptive Thinking, where Claude dynamically decides how much to reason based on query complexity and a developer-chosen effort level (low, medium, or high). The older budget_tokens approach is deprecated on these newer models.
When you’d use it
- ◆Multi-step math and logic problems — A student or analyst needs to solve a problem with several dependent calculations, such as compound interest, combinatorics, or a logic puzzle. Without CoT, Claude may skip steps and produce a wrong answer. With CoT, each sub-step is made explicit and checkable.
- ◆Legal and contract document analysis — A paralegal needs to extract obligations, exceptions, and residual risks from a dense contract clause. CoT prompting guides Claude to identify each element systematically before synthesizing a plain-English summary, reducing the chance of missing a critical carve-out.
- ◆Code debugging and self-correction — A developer asks Claude to find a bug in a function. With CoT, Claude traces execution line by line, identifies where output diverges from expected behavior, and explains the fix — rather than guessing at a patch.
- ◆Structured essay and document planning — A writer asks Claude to draft a long-form report. Using CoT, Claude first outlines the argument structure, identifies supporting evidence, and flags gaps before generating the prose — resulting in a more coherent final document.
- ◆Decision-making with explicit trade-off analysis — A product manager needs to choose between two technical architectures. CoT prompting forces Claude to enumerate criteria, score each option against those criteria, and surface the reasoning behind its recommendation — making the logic auditable.
What changed recently
- ◆2026-05 — Claude Sonnet 4.6 became the default model for Free and Pro plans on claude.ai. Sonnet 4.6 supports Adaptive Thinking with effort-level control ('low', 'medium', 'high') and does not accept the legacy budget_tokens parameter.
- ◆2026-05 — Claude Opus 4.8 released. This model strictly rejects manual thinking budgets (budget_tokens) and requires the Adaptive Thinking architecture. Interleaved thinking between tool calls is enabled automatically when adaptive mode is active.
- ◆2026-02 — Claude Opus 4 and Claude Sonnet 4 released as hybrid models supporting both near-instant responses and Extended Thinking with tool use (beta). These models introduced interleaved thinking, allowing Claude to reason between sequential tool calls.
- ◆2026-02 — For Claude 4-series models with Extended Thinking enabled, the Messages API returns a summary of Claude's thinking process rather than the raw inner monologue, to prevent misuse. Full thinking output for Claude 4 models requires contacting Anthropic sales.
This is the short version
The full chapter has three worked examples, the common pitfalls, and the workflow that makes it pay — plus the other 84 features, kept current.
Get Claude Master — $97 →