Intermediate · Shaping the Output
Precognition (think step-by-step)
Claude generates text token by token, left to right. The text it has already produced is visible to it as it produces the next token. This is not a metaphor or a simplification — it is a description of how the model works.
The implication is direct: if Claude articulates its reasoning before it produces an answer, the reasoning is on the page when the answer is generated. The answer is conditioned on the reasoning. Answers conditioned on written reasoning are more accurate than answers produced without it.
This is what "think step by step" does. It is not encouragement. It is an instruction to produce the reasoning before the conclusion.
The bat and ball problem
"A bat and a ball cost $11 in total. The bat costs $10 more than the ball. How much does the ball cost?"
Without step-by-step reasoning, the intuitive answer is $1. That answer is wrong. The ball costs $0.50 (bat = $10.50, ball = $0.50, total = $11.00).
Most people get this wrong. Claude without step-by-step reasoning gets this wrong. Claude with step-by-step reasoning — "Let x be the cost of the ball. The bat costs x + 10. Together they cost x + (x + 10) = 11, so 2x = 1, x = 0.50." — gets it right.
The technique does not require the phrase "think step by step." Any instruction that asks Claude to produce its reasoning before its conclusion has the same effect:
- "Explain your reasoning before answering."
- "Show your work."
- "List the steps you are following."
- "Walk through this one step at a time."
When to use it
Step-by-step reasoning helps with: multi-step math, logical deduction, code debugging, causal analysis, any task where a wrong intermediate step produces a confidently wrong final answer.
It does not help with: tasks where the answer is a single fact, creative writing, formatting tasks. Adding "think step by step" to "Write a haiku" just produces a haiku with a paragraph of preamble.
Asking Claude to think first, then answer
For high-stakes reasoning tasks, separate the thinking from the answer:
"Calculate the ROI on a $50,000 marketing spend that generated 1,200 leads and 45 conversions at $1,200 annual contract value. Show your calculations. Then state the ROI as a percentage in a single final line."
The last sentence separates the answer from the reasoning, which makes the output easier to scan.
If you get stuck
If step-by-step reasoning produces a wrong answer, the error is usually in one specific step. Identify which step went wrong and add a constraint for that step: "When calculating percentages, always use the base amount in the denominator."
If the reasoning is correct but the conclusion contradicts it, ask Claude to re-read its own reasoning: "Given the steps above, what is the correct answer?"
Cross-reference
L11 (Using examples) shows how to combine step-by-step reasoning with example patterns for classification tasks. L13 (Building complex prompts from scratch) covers how to structure multi-step tasks where each step feeds the next.
Deliverable
Take the ROI calculation prompt from this lesson. Fill in actual numbers from your work — a real campaign, a real budget, a real conversion rate. Run it with "Show your work." Check whether the answer is correct. If it is wrong, find the step where the error occurs and add a constraint.
Try these prompts
- A bat and ball cost $11 total. The bat costs $10 more than the ball. How much does the ball cost? Think step by step.
- Calculate the ROI on a $50K marketing spend that generated 1,200 leads and 45 conversions at $1,200 ACV. Show your work.
Sign in to keep your place and tick off lessons. Reading stays open either way.