Skip to content

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:

KeywordThinking BudgetWhen to Use
thinkLowSimple analysis
think hardMediumMulti-step problems
think harderHighComplex trade-offs
ultrathinkMaximumArchitecture 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

bash
# Navigate to the sample project
cd sample-projects/hackathon-starter

# Start Claude Code
claude

Tasks

Task 1: Formulate a Complex Question (5 min)

Think of a question that requires deep analysis.

Good questions for extended thinking:

CategoryExample
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 maintainability

Example:

ultrathink: Should this application migrate from Passport.js to a custom JWT-based authentication system?

Consider:
- Security implications
- Development effort
- Maintainability
- Scalability for future features

Observe:

  • How long does Claude take to respond?
  • How detailed is the analysis?
  • Are trade-offs presented?

Success criteria:

  • [ ] Used ultrathink keyword
  • [ ] 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:

AspectExtendedStandard
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:

  1. What decision would you make based on the analysis?
  2. What follow-up questions do you have?
  3. What would you need to validate before proceeding?

Document your decision:

markdown
## 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

  1. Provide context - "Given our current tech stack of..."
  2. List constraints - "We have 2 developers and 3 months"
  3. Ask for trade-offs - "What are the pros and cons?"
  4. 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:

  1. A complex technical question formulated
  2. Extended thinking response received and analyzed
  3. Comparison with standard response
  4. Documented decision based on the analysis

Next Steps

After completing this lab, move on to Lab 3.3: Workflow Automation.

Claude for Coders Training Course