Plan Stack
What this lesson teaches
Plan Stack is a methodology for AI-assisted development: create a plan first, implement second, review always. This structure prevents wasted effort and improves code quality.
The Core Cycle
- Plan — Write down what you'll build before touching code
- Implement — Execute the plan with Claude's help
- Review — Check the result against the plan
This isn't bureaucracy—it's how you avoid redoing work and catch mistakes early.
Writing a Plan
Create a plan file (e.g., docs/plans/20240115_add_auth.md) before starting:
# Add User Authentication
## Goal
Users can log in with email/password and stay logged in.
## Approach
- Use JWT tokens stored in httpOnly cookies
- Add /api/auth/login and /api/auth/logout endpoints
- Create auth middleware for protected routes
## Files to Change
- src/api/auth.ts (new)
- src/middleware/auth.ts (new)
- src/api/user.ts (modify)
## Success Criteria
- Login returns token on valid credentials
- Protected routes reject requests without valid token
- Tests pass
Why write it down? Plans are context for Claude and documentation for your future self. They also prevent scope creep.
Using Plans with Claude
Share your plan at the start of a session:
> I'm implementing user auth. Here's my plan:
> [paste plan]
> Let's start with the login endpoint.
Claude now knows the full scope and can make consistent decisions across files.
Including Plans in Commits
Link your commits to plans:
git commit -m "Add login endpoint
Implements: docs/plans/20240115_add_auth.md (step 1)"
This creates a traceable history of decisions and implementations.
Plans aren't contracts: If you discover the plan is wrong during implementation, update it. The point is clarity, not rigidity.
Key Takeaways
- Plan → Implement → Review cycle prevents wasted work
- Written plans are context for Claude and documentation for you
- Share plans with Claude at session start
- Link commits to plans for traceability