Planning Mode Examples
AdvancedPro10 minupdated 2026-10-21
Real-world examples demonstrating effective use of planning mode in Claude Code.
Example 1: Building a REST API
Without Planning Mode
User: Build a REST API for a blog
Claude: I'll create the API...
[Starts coding immediately, may miss requirements]With Planning Mode
User: /plan Build a REST API for a blog
Claude: Let me create a comprehensive plan for the blog API.
## Blog REST API Implementation Plan
### Phase 1: Project Setup (15 min)
1. Initialize Node.js project with Express
2. Set up TypeScript configuration
3. Install dependencies (express, pg, jwt, joi)
4. Configure environment variables
5. Set up project structure
### Phase 2: Database Layer (30 min)
6. Design database schema
- users table (id, email, password_hash, created_at)
- posts table (id, user_id, title, content, published, created_at, updated_at)
- comments table (id, post_id, user_id, content, created_at)
7. Create migration files
8. Set up database connection pool
9. Implement database models
### Phase 3: Authentication (45 min)
10. Implement user registration endpoint
11. Implement login endpoint with JWT
12. Create authentication middleware
13. Add password hashing with bcrypt
14. Implement token refresh logic
### Phase 4: Posts API (40 min)
15. GET /api/posts - List all published posts (with pagination)
16. GET /api/posts/:id - Get single post
17. POST /api/posts - Create new post (auth required)
18. PUT /api/posts/:id - Update post (auth required, ownership check)
19. DELETE /api/posts/:id - Delete post (auth required, ownership check)
20. GET /api/users/:id/posts - Get user's posts
### Phase 5: Comments API (30 min)
21. GET /api/posts/:id/comments - Get post comments
22. POST /api/posts/:id/comments - Add comment (auth required)
23. DELETE /api/comments/:id - Delete comment (auth required, ownership check)
### Phase 6: Validation & Error Handling (30 min)
24. Add request validation with Joi
25. Implement global error handler
26. Add input sanitization
27. Implement rate limiting
### Phase 7: Testing (60 min)
28. Write unit tests for models
29. Write integration tests for auth endpoints
30. Write integration tests for posts endpoints
31. Write integration tests for comments endpoints
32. Achieve 80%+ code coverage
### Phase 8: Documentation & Deployment (30 min)
33. Generate API documentation with Swagger
34. Create README with setup instructions
35. Add Docker configuration
36. Set up CI/CD pipeline
**Estimated Time**: 4.5 hours
**Files to Create**: ~25This guide continues on the Pro plan
You have seen the introduction and the first example. With Pro you unlock this guide and every other one - updated every day, with ready-to-copy examples.
In this guide (Pro): Example 2: Database Migration · MongoDB to PostgreSQL Migration Plan · Example 3: Frontend Refactoring · React Class to Hooks Migration Plan · Example 4: Security Implementation · Web Application Security Implementation Plan · Example 5: Performance Optimization · E-commerce Performance Optimization Plan · Key Takeaways
€7.99/month · No commitment · Cancel anytime
Open-source community guide (MIT) · curated and maintained by Doutor AI.
Need a tailor-made solution?
Not sure where to start with AI in your business? Get a free assessment and a tailored plan - no commitment.
Save hours every week with AI, no hassle
Doutor AI gives you 1,859 ready-to-copy AI prompts, by industry and in plain English - plus a complete technical library for those who want to go further.