Chain-of-Thought (CoT) prompting asks the model to reason step-by-step before its final answer. This dramatically improves accuracy on tasks requiring logic, multi-step analysis, or decisions with real tradeoffs.
The trigger is simple: "Think step by step" — or define the reasoning steps yourself.
02 Weak vs. Strong
EX 01Architecture decision for a real startup
We're building HR tech SaaS: applicant tracking, onboarding, document management. State: 3 engineers, 40 beta customers, pre-launch.
Deciding: start with a Go monolith or go microservices from day one.
Think step by step:
Step 1: Operational realities of each approach for 3 engineers with no dedicated DevOps
Step 2: Specific features of HR workflows and document management that push toward one or the other
Step 3: Migration cost: monolith→microservices in 18 months vs. starting microservices and finding it too complex
Step 4: What do companies at exactly our stage (pre-launch, <5 engineers) typically find empirically?
Step 5: Recommendation with 2 strongest reasons FOR and 1 strongest counterargument to prepare for
Don't give the recommendation before completing all 5 steps.
→ Why it works
Steps force analysis before concluding.
EX 02Debugging a compound interest function
This Python function calculates compound interest but returns wildly wrong numbers.
```python
def compound_interest(principal, annual_rate_pct, years):
monthly_rate = annual_rate_pct / 12
total_months = years * 12
return principal * (1 + monthly_rate) ** total_months
```
Test case that fails:
- compound_interest(10000, 5, 10)
- Expected (5% APY, 10 years): ~$16,470
- Actual result: $2,193,040,000
Work through step by step:
1. Trace what monthly_rate equals when annual_rate_pct=5 (show the arithmetic)
2. Compare to what monthly_rate should be for a 5% annual rate
3. Identify the exact bug in one sentence
4. Show the corrected function
5. Show what the corrected function returns for the test case
→ Why it works
Specific test case with expected vs actual.
03 Key Points
01'Think step by step' is the most reliable quality boost for complex tasks
02Ask for reasoning BEFORE the conclusion — not as an afterthought
03Define specific reasoning steps for specialized analysis
04CoT makes errors visible and correctable — you see where logic went wrong
05Combine with: 'Check your reasoning before giving the final answer'
04 Model-Specific Notes
Claude has extended thinking on Opus models. 'Think carefully before responding' activates deeper reasoning that's visible and auditable.
05 For Your Role
Add 'explain your thinking before the answer' to any complex question. You get a better answer AND can see where logic goes wrong.