Claude Code Tutorial: Project Development Workflow¶
This tutorial walks you through the complete workflow for developing a project using Claude Code with the Haiku → Sonnet → Opus escalation strategy.
Overview: The Three-Model Workflow¶
The recommended workflow uses three Claude models in sequence:
- Sonnet - Planning phase: discovers tasks and requirements
- Opus - Validation phase: validates plan and asks additional questions
- Sonnet - Coding phase: implements the project based on final plan
This approach ensures thorough planning before coding begins.
Step 1: Initialize Your Project¶
Create Empty Project Folder¶
1 2 3 | |
Write a Comprehensive README¶
1 | |
In the README file, describe your project in detail:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
Example: Weather Data Analyzer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
Save the file: Ctrl+X, then Y, then Enter.
Step 2: Planning with Sonnet¶
Launch Claude with Sonnet Model¶
1 | |
Run Project Initialization¶
Once Claude Code is running:
1 2 | |
Claude will: - Read the README.md file - Analyze your requirements - Create a project inventory - Generate a CLAUDE.md file with implementation tasks
Wait for Claude to complete the analysis. You should see: - List of identified tasks - File structure recommendations - Implementation strategy
Review Generated CLAUDE.md¶
Open the generated CLAUDE.md file in another terminal:
1 2 3 | |
This file contains: - Task breakdown - Implementation steps - Configuration notes - Testing strategy
Step 3: Validate with Sonnet Questions¶
Ask Claude for Clarification¶
In the Claude Code session, ask:
1 | |
Claude will ask 5-10 clarifying questions. Answer all questions in a single line format:
1 | |
Example response:
1 | |
Continue Clarification Loop¶
After you answer, ask again:
1 | |
Keep answering until Claude says it has no more questions. This ensures complete understanding before coding.
Step 4: Deep Review with Opus¶
Switch to Opus Model¶
1 2 | |
Opus will: - Review Sonnet's plan - Identify edge cases - Ask additional architectural questions - Suggest optimizations
Answer Opus Questions¶
Same process as Step 3 - answer all questions in one line:
1 | |
Continue Until Complete¶
Keep asking "Do you have more questions?" until Opus is satisfied. This final validation ensures the plan is bulletproof.
Step 5: Code Implementation with Sonnet¶
Switch Back to Sonnet¶
1 | |
Start Coding¶
1 | |
Sonnet will: 1. Create all necessary files 2. Write complete, production-ready code 3. Execute the code to test it 4. Fix any runtime errors 5. Provide a summary of what was created
Wait patiently. Complex projects may take 10-20+ minutes.
Step 6: Review and Debug¶
Monitor the Output¶
Watch for: - File creation messages - Execution output - Error messages (if any) - Success confirmations
If Errors Occur¶
If Sonnet encounters errors:
1 | |
Sonnet will: - Analyze the error - Fix the code - Re-execute - Confirm success
For Complex Errors¶
If Sonnet can't fix an error, escalate to Opus:
1 2 3 | |
Opus will provide deeper analysis and solutions.
Complete Example Walkthrough¶
Starting State¶
1 2 3 4 5 6 7 | |
In Claude Code Session¶
1 2 | |
[Wait for analysis to complete]
1 | |
Claude asks: "Should the report include severity levels for weather alerts? Should predictions use machine learning or simple linear extrapolation? Should the script support multiple cities?"
Your response:
1 | |
1 | |
Claude: "Just one more - how should we handle missing data points?"
Your response:
1 | |
1 | |
Claude: "I believe I have all the information needed to create a solid plan."
Now switch models:
1 2 | |
[Opus reviews and asks additional questions]
After Opus is satisfied:
1 2 3 | |
[Wait 10-20 minutes for implementation]
Result¶
You now have: - ✅ Complete weather analyzer script - ✅ Fully tested and working code - ✅ Error handling and logging - ✅ Documented functions - ✅ Ready for production or further enhancement
Tips for Success¶
Planning Phase Tips¶
- Be specific - Vague requirements lead to confused AI models
- Include examples - Show what input/output should look like
- Mention constraints - Budget, time, performance requirements
- List edge cases - What shouldn't break the system?
- Define success - How do you know it works?
Question Phase Tips¶
- Answer quickly - Don't overthink responses
- Be concise - Use one-liners, not paragraphs
- Clarify assumptions - If Claude assumes wrong, correct it
- Ask for confirmation - "Does that match your expectation?"
Coding Phase Tips¶
- Stay patient - Complex projects take time
- Don't interrupt - Let Claude complete the implementation
- Review output - Check the generated code makes sense
- Test thoroughly - Claude tests but you should too
- Iterate if needed - Ask for improvements after first run
Escalation Guide¶
Use Haiku for: - Simple bug fixes - Small code additions - Quick questions
Use Sonnet for: - New feature development - Planning and architecture - Most general coding tasks
Use Opus for: - Complex problem-solving - Architectural review - Difficult debugging - When Sonnet gets stuck
Common Patterns¶
"Don't start coding yet" Instruction¶
After the planning phase is complete but before implementation, you can say:
1 2 | |
This ensures perfect clarity before coding begins.
Handling Unexpected Issues¶
If Claude makes incorrect assumptions:
1 2 | |
Requesting Specific Technologies¶
During planning questions, you can be very specific:
1 | |
Workflow Checklist¶
- Created project directory and git initialized
- Wrote comprehensive README.md with all project details
- Ran Sonnet with
/initto generate plan - Reviewed generated CLAUDE.md file
- Answered all Sonnet clarification questions
- Ran Opus with
/initfor additional validation - Answered all Opus clarification questions
- Switched back to Sonnet for implementation
- Ran and debugged the code
- Tested the output thoroughly
- Project complete and committed to git
Next Steps¶
After implementing your project:
- Test thoroughly - Try edge cases and error conditions
- Commit to git - Save your work with descriptive commit messages
- Iterate - Ask Claude for improvements or new features
- Deploy - Put your project to work in the real world
- Maintain - Use Claude Code for ongoing improvements
Troubleshooting¶
Claude Code won't start¶
1 2 3 4 5 | |
/init command doesn't work¶
1 2 3 4 5 | |
Model switching issues¶
1 2 3 4 5 6 | |
Timeouts on large projects¶
Large projects may take 20-30 minutes. This is normal. Don't interrupt the process.
FAQ¶
Q: Do I need to write the README perfectly? A: No! The more detail the better, but Claude will ask clarifying questions if needed.
Q: Can I skip the Opus review? A: You can, but we recommend it for important projects. Opus often catches issues Sonnet misses.
Q: What if I don't like the generated code? A: Ask Claude to rewrite specific sections or adjust the approach.
Q: Can I use this for really large projects? A: Yes! Complex projects may take longer (20-40 minutes), but Claude can handle them.
Q: What if Claude gets stuck? A: Try escalating to a more capable model (Opus) or simplify the task scope.