Lab 3.1: Deep Thought
Module: 3.1 - Extended Thinking | ← SlidesDuration: 30 minutes Sample Project: hackathon-starter
Learning Objectives
By the end of this lab, you will be able to:
- Use extended thinking for complex technical questions
- Formulate questions that benefit from deep analysis
- Compare extended thinking responses to standard responses
- Apply insights to technical decision-making
What is Extended Thinking?
Extended Thinking gives Claude more time to reason through complex problems. Use it for:
- Architectural decisions
- Migration strategies
- Complex debugging
- Trade-off analysis
Thinking Mode Hierarchy
Claude Code supports multiple levels of extended thinking:
| Keyword | Thinking Budget | When to Use |
|---|---|---|
think | Low | Simple analysis |
think hard | Medium | Multi-step problems |
think harder | High | Complex trade-offs |
ultrathink | Maximum | Architecture decisions, security audits |
Note: Higher thinking modes consume more tokens. Use ultrathink only when you truly need deep analysis.
Token Usage
The "think" keywords trigger additional token consumption. If you're budget-conscious, use "consider" or "evaluate" instead for routine questions.
Setup
# Navigate to the sample project
cd sample-projects/hackathon-starter
# Start Claude Code
claudeTasks
Task 1: Formulate a Complex Question (5 min)
Think of a question that requires deep analysis.
Good questions for extended thinking:
| Category | Example |
|---|---|
| Architecture | "Should we migrate from MongoDB to PostgreSQL?" |
| Migration | "How should we upgrade from Express 4 to Express 5?" |
| Design | "What's the best authentication strategy for a multi-tenant app?" |
| Performance | "Why is our API slow and how can we optimize it?" |
| Security | "What security vulnerabilities might exist in our auth flow?" |
Pick a question relevant to the hackathon-starter project.
Success criteria:
- [ ] Question is complex (not a simple lookup)
- [ ] Question has trade-offs to consider
- [ ] Question is relevant to the codebase
Task 2: Ask with Extended Thinking (10 min)
Ask your question using the ultrathink keyword.
Prompt template:
ultrathink: [Your complex question]
Consider:
- Trade-offs between options
- Risks and mitigations
- Implementation complexity
- Long-term maintainabilityExample:
ultrathink: Should this application migrate from Passport.js to a custom JWT-based authentication system?
Consider:
- Security implications
- Development effort
- Maintainability
- Scalability for future featuresObserve:
- How long does Claude take to respond?
- How detailed is the analysis?
- Are trade-offs presented?
Success criteria:
- [ ] Used
ultrathinkkeyword - [ ] Received detailed analysis
- [ ] Multiple perspectives considered
Task 3: Compare with Standard Response (10 min)
Ask the same question without extended thinking.
Should this application migrate from Passport.js to a custom JWT-based authentication system?Compare:
| Aspect | Extended | Standard |
|---|---|---|
| Depth of analysis | ||
| Trade-offs listed | ||
| Risks identified | ||
| Actionability |
Success criteria:
- [ ] Both responses received
- [ ] Differences identified
- [ ] Understand when to use extended thinking
Task 4: Apply Insights (5 min)
Use the extended thinking analysis to make a decision.
Questions to answer:
- What decision would you make based on the analysis?
- What follow-up questions do you have?
- What would you need to validate before proceeding?
Document your decision:
## Decision: [Topic]
### Analysis Summary
[Key points from extended thinking response]
### Decision
[What we decided and why]
### Next Steps
1. [Action item]
2. [Action item]
3. [Action item]
### Risks to Monitor
- [Risk 1]
- [Risk 2]Success criteria:
- [ ] Decision documented
- [ ] Reasoning explained
- [ ] Next steps identified
When to Use Extended Thinking
Use extended thinking for:
- Architecture and design decisions
- Migration planning
- Complex debugging
- Security analysis
- Performance optimization strategy
Don't use for:
- Simple code generation
- Documentation
- Straightforward refactoring
- Quick lookups
Tips for Better Questions
- Provide context - "Given our current tech stack of..."
- List constraints - "We have 2 developers and 3 months"
- Ask for trade-offs - "What are the pros and cons?"
- Request specifics - "Include concrete examples"
Example Extended Thinking Questions
ultrathink: We're experiencing slow API response times (>500ms). Analyze the hackathon-starter codebase and identify potential bottlenecks. Consider database queries, middleware, and async patterns.ultrathink: Our team is debating whether to add TypeScript to this JavaScript project. Given the codebase size and our 6-month timeline, what's your recommendation?ultrathink: What would be the impact of switching from Express sessions to JWT tokens? Consider security, scalability, and implementation effort.Deliverables
At the end of this lab, you should have:
- A complex technical question formulated
- Extended thinking response received and analyzed
- Comparison with standard response
- Documented decision based on the analysis
Next Steps
After completing this lab, move on to Lab 3.3: Workflow Automation.