Claude Certification
Prompt Engineering & Structured Output
Lesson 5 · 7 min

Extended Thinking

When to enable thinking budgets and what they cost.

Extended thinking gives Claude scratchpad tokens before producing the final response. Use it for hard reasoning (math, multi-step planning, code analysis). Bill is on thinking tokens too; budget explicitly.

Production scenario

Real-world example: Math tutoring on word problems

A K-12 math tutor handles two query types: arithmetic lookups ("what's 234 × 7?") and word problems ("Lisa has three times as many marbles as Tom..."). The first needs no thinking budget. The second does.

const thinking = isWordProblem(question) ? { budget_tokens: 4000 } : undefined;
const reply = await claude.messages.create({
  model: "claude-opus-4-7",
  thinking,
  system: TUTOR_PROMPT,
  messages: [{ role: "user", content: question }],
});

Pass rate on word problems jumps from 71% to 89% with extended thinking. Lookups stay fast and cheap.

Why this matters: extended thinking is worth its tokens on genuinely multi-step reasoning. Don't sprinkle it on everything — gate it on the question shape.

Knowledge points in this lesson
  • Extended thinking gives a scratchpad budget
  • Bill is paid in thinking tokens too
  • Best for hard multi-step reasoning
  • Overkill on simple lookup tasks
  • Budget thinking explicitly per call
Quick check
Prompt EngineeringSelect one
How many few-shot examples typically peak performance?