Plan-Driven Development
Last updated:
Confidence: Tier 1 (based on Claude Codeβs native /plan mode functionality).
Use /plan mode for anything non-trivial. Claude explores the codebase (read-only), then proposes an implementation plan for your approval.
Table of Contents
Section titled βTable of Contentsβ- TL;DR
- The /plan Workflow
- When to Use
- Plan File Structure
- Integration with Other Workflows
- Tips
- Advanced: Custom Markdown Plans (Boris Tane Pattern)
- See Also
1. Enter Plan Mode (Shift+Tab twice) or ask complex question2. Claude explores codebase (read-only)3. Claude writes plan to .claude/plans/4. You review and approve5. Claude executesThe /plan Workflow
Section titled βThe /plan WorkflowβStep 1: Enter Plan Mode
Section titled βStep 1: Enter Plan ModeβToggle Plan Mode with Shift+Tab (press twice to cycle Normal β Auto-Accept β Plan):
# Press Shift+Tab twice to enter Plan Mode# (Plan Mode indicator appears in the UI)Or ask a complex question that triggers plan mode automatically:
How should I refactor the authentication system to support OAuth?Step 2: Claude Explores
Section titled βStep 2: Claude ExploresβIn plan mode, Claude:
- Reads relevant files
- Searches for patterns
- Understands existing architecture
- CANNOT make any changes
Step 3: Claude Writes Plan
Section titled βStep 3: Claude Writes PlanβClaude creates a plan file at .claude/plans/[name].md:
# Plan: Refactor Authentication for OAuth
## SummaryAdd OAuth support while maintaining existing email/password auth.
## Files to Modify- src/auth/providers/index.ts (add OAuth provider)- src/auth/middleware.ts (handle OAuth tokens)- src/config/auth.ts (OAuth config)
## Files to Create- src/auth/providers/oauth.ts- src/auth/providers/google.ts
## Implementation Steps1. Create OAuth provider interface2. Implement Google OAuth provider3. Update middleware to detect token type4. Add OAuth routes5. Update config schema
## Risks- Breaking existing sessions during migration- Token format differences between providersStep 4: You Review
Section titled βStep 4: You ReviewβReview the plan for:
- Completeness (all requirements covered)
- Correctness (right approach for your codebase)
- Scope (not over-engineering)
Step 5: Approve and Execute
Section titled βStep 5: Approve and ExecuteβLooks good. Proceed with the plan.Or request changes:
Modify the plan: also add support for GitHub OAuth, not just Google.When to Use
Section titled βWhen to UseβUse Plan Mode
Section titled βUse Plan Modeβ| Scenario | Why |
|---|---|
| Multi-file changes | See all affected files upfront |
| Architecture changes | Validate approach before coding |
| New features | Ensure complete implementation |
| Unfamiliar codebase | Let Claude explore first |
| Risky operations | Review before execution |
Skip Plan Mode
Section titled βSkip Plan Modeβ| Scenario | Why |
|---|---|
| Single-line fixes | Obvious, low risk |
| Typo corrections | No planning needed |
| Simple questions | Exploration, not implementation |
| Adding comments | Trivial change |
Plan File Structure
Section titled βPlan File StructureβPlans are stored in .claude/plans/ with auto-generated names.
Typical Plan Sections
Section titled βTypical Plan Sectionsβ# Plan: [Title]
## Summary[1-2 sentence overview]
## Context[Why this change is needed]
## Files to Modify[List of existing files that will change]
## Files to Create[List of new files]
## Files to Delete[List of files to remove, if any]
## Implementation Steps[Ordered list of steps]
## Testing Strategy[How to verify the changes]
## Risks & Mitigations[What could go wrong and how to handle it]
## Open Questions[Things to clarify before proceeding]Integration with Other Workflows
Section titled βIntegration with Other WorkflowsβPlan + TDD
Section titled βPlan + TDDβ# Enter Plan Mode (Shift+Tab twice), then:
I need to implement a rate limiter.Plan the test cases first, then the implementation.Claude plans both tests and implementation in proper TDD order.
Plan + Spec-First
Section titled βPlan + Spec-Firstβ# Enter Plan Mode (Shift+Tab twice), then:
Review the Payment Processing spec in CLAUDE.md.Create an implementation plan that satisfies all acceptance criteria.Plan + Task Tool
Section titled βPlan + Task ToolβAfter plan approval, Claude can break down into tasks:
Approved. Create tasks from this plan and start implementing.Be Specific About Scope
Section titled βBe Specific About Scopeβ# Too vague (after entering Plan Mode via Shift+Tab twice)Improve the API
# BetterAdd pagination to the /users endpoint with cursor-based navigation.Maintain backwards compatibility with existing clients.Request Plan Modifications
Section titled βRequest Plan ModificationsβThe plan looks good but:- Add error handling for network failures- Skip the caching optimization for now- Include rollback procedureUse for Architecture Decisions
Section titled βUse for Architecture Decisionsβ# Enter Plan Mode (Shift+Tab twice), then:
I'm considering two approaches for state management:A) Redux ToolkitB) Zustand
Explore the codebase and recommend which fits better.Save Plans for Documentation
Section titled βSave Plans for DocumentationβPlans in .claude/plans/ serve as decision documentation:
- Why certain approaches were chosen
- What files were expected to change
- Implementation order rationale
Advanced: Custom Markdown Plans (Boris Tane Pattern)
Section titled βAdvanced: Custom Markdown Plans (Boris Tane Pattern)βSource: Boris Tane, Engineering Lead @ Cloudflare, in βHow I use Claude Codeβ (Feb 2026). 9 months of production usage. Confidence: Tier 2 (practitioner-validated pattern, not official Anthropic documentation).
When Plan Mode isnβt enough, iterative human/agent planning before any code is written.
Why Custom Plans Over /plan
Section titled βWhy Custom Plans Over /planβ| Factor | Plan Mode (native) | Custom .md plan |
|---|---|---|
| Persistence | Lost on context compaction | Survives compaction, shareable |
| Review surface | Chat-based, linear | Structured file, diffs |
| Iteration | Back-and-forth in conversation | Annotate file, re-run |
| Shared state | Per-session | βShared mutable stateβ between human and agent |
| Best for | Standard features, <30 min tasks | Complex features, architectural decisions |
Decision rule: Use Plan Mode (Shift+Tab twice) for known scope. Use custom .md plans when you expect misunderstandings or want explicit sign-off on approach before a single line of code.
The Three-Phase Workflow
Section titled βThe Three-Phase Workflowβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Phase 1: RESEARCH ββ β Emphatic prompt β research.md (written, not verbal) ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β Phase 2: PLANNING (Annotation Cycle) ββ β plan.md draft β human annotates β agent updates β repeat ββ β Exit: plan approved, no open questions ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β Phase 3: IMPLEMENTATION ββ β Mechanical execution, decisions already made ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββPhase 1: Emphatic Research
Section titled βPhase 1: Emphatic ResearchβClaude skims without strong signal. Use emphatic language to force depth:
Research the authentication system in this codebase deeply.Understand the intricacies of how sessions are managed, in great detail.Cover edge cases, existing patterns, and any non-obvious dependencies.
Write your findings to research.md β do not implement anything.Why it works: βdeeplyβ, βin great detailβ, βintricaciesβ shift Claude from surface scan to thorough investigation. Output must be written to a file. Verbal summaries disappear on context compaction.
Research.md should include:
- Existing patterns and conventions
- File paths and key functions
- Non-obvious dependencies
- Constraints and risks identified
Phase 2: The Annotation Cycle
Section titled βPhase 2: The Annotation CycleβThe core of the Boris Tane pattern. Iterate on plan.md until ready, before any implementation.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ANNOTATION CYCLE ββ ββ Human prompt βββ Agent writes plan.md ββ β β ββ Annotate plan Human reviews plan.md ββ (add comments, β ββ ask questions, Issues found? ββ flag trade-offs) ββ Yes β Annotate β loop ββ ββ No β Approved β Phase 3 ββ ββ Typical: 1-6 iterations before approval βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββGuard prompt. Always include this to prevent premature implementation:
Based on research.md, write a plan for implementing [feature].
Include: approach, affected file paths, code snippets for key decisions,trade-offs considered, and open questions.
Write to plan.md. Do NOT implement anything yet.What plan.md should contain:
# Plan: [Feature Name]
## Approach[Strategy and rationale]
## Files Affected- path/to/file.ts β what changes and why- path/to/other.ts β what changes and why
## Key Implementation Details[Code snippets for non-obvious parts β not the full implementation]
## Trade-offs- Option A vs B: chose A because X- Considered but rejected: Y (reason)
## Open Questions- [ ] Should we handle edge case Z?- [ ] Does this affect the mobile client?Annotation example:
## ApproachUse JWT tokens stored in httpOnly cookies.<!-- Human annotation: β Agreed. But also consider refresh token rotation -->
## Open Questions- [ ] Should we handle token expiry in middleware?<!-- Human annotation: Yes, centralize this β don't leave it to each route -->Exit criteria. The plan is ready when:
- No open questions remain
- Trade-offs are documented and agreed
- File paths are specific (not βsome auth fileβ)
- Key snippets show the approach, not just describe it
βThe markdown file acts as shared mutable state between you and the agent.β (Boris Tane)
Phase 3: Mechanical Implementation
Section titled βPhase 3: Mechanical ImplementationβOnce the plan is approved, implementation becomes execution; no creative decisions left.
Implement everything in plan.md.Work through each item sequentially.Mark tasks as completed as you go with [x].Do not stop between tasks to ask for confirmation β keep going until done.Feedback during implementation:
- Keep it terse: short phrases or screenshots, not paragraphs
- Decisions are already made; redirect scope changes back to plan.md
- If something unexpected comes up: pause, update plan.md, continue
Mindset shift: Phase 3 is mechanical. All thinking happened in Phase 2.
Complementary Techniques
Section titled βComplementary Techniquesβ| Technique | What | When |
|---|---|---|
| Cherry-picking | Implement subset of plan.md | Plan too large, ship incrementally |
| Scope trimming | Remove items from plan before implementing | Reduce risk, focus on core |
| Reference-based guidance | Point to existing code: βdo it like auth.tsβ | Enforce consistency |
| Revert & re-scope | git revert + restart with narrower plan | Plan went wrong, reset cleanly |
See Also
Section titled βSee Alsoβ- exploration-workflow.md: Explore alternatives before planning
- ../ultimate-guide.md: Section 2.3 Plan Mode
- tdd-with-claude.md: Combine with TDD
- spec-first.md: Combine with Spec-First
- iterative-refinement.md: Post-plan iteration
- task-management.md: Track plan execution across sessions with Tasks API
- dual-instance-planning.md: Advanced: Use two Claude instances (planner + implementer) for quality-focused workflows