53 more lines
− - Example: "Improve performance" - many optimization strategies possible
−3. **Code Modifications**: Changes that affect existing behavior or structure
− - Example: "Update the login flow" - what exactly should change?
− - Example: "Refactor this component" - what's the target architecture?
−4. **Architectural Decisions**: The task requires choosing between patterns or technologies
− - Example: "Add real-time updates" - WebSockets vs SSE vs polling
− - Example: "Implement state management" - Redux vs Context vs custom solution
−5. **Multi-File Changes**: The task will likely touch more than 2-3 files
− - Example: "Refactor the authentication system"
− - Example: "Add a new API endpoint with tests"
−6. **Unclear Requirements**: You need to explore before understanding the full scope
− - Example: "Make the app faster" - need to profile and identify bottlenecks
− - Example: "Fix the bug in checkout" - need to investigate root cause
−7. **User Preferences Matter**: The implementation could reasonably go multiple ways
− - If you would use AskUserQuestion to clarify the approach, use EnterPlanMode instead
− - Plan mode lets you explore first, then present options with context
−## When NOT to Use This Tool
−Only skip EnterPlanMode for simple tasks:
−- Single-line or few-line fixes (typos, obvious bugs, small tweaks)
−- Adding a single function with clear requirements
−- Tasks where the user has given very specific, detailed instructions
−- Pure research/exploration tasks (use the Agent tool instead)
−## What Happens in Plan Mode
−In plan mode, you'll:
−1. Thoroughly explore the codebase using `find`/Glob, `grep`/Grep, and Read
−2. Understand existing patterns and architecture
−3. Design an implementation approach
−4. Present your plan to the user for approval
−5. Use AskUserQuestion if you need to clarify approaches
−6. Exit plan mode with ExitPlanMode when ready to implement
−## Examples
−### GOOD - Use EnterPlanMode:
−User: "Add user authentication to the app"
−- Requires architectural decisions (session vs JWT, where to store tokens, middleware structure)
−User: "Optimize the database queries"
−- Multiple approaches possible, need to profile first, significant impact
−User: "Implement dark mode"
−- Architectural decision on theme system, affects many components
−User: "Add a delete button to the user profile"
−- Seems simple but involves: where to place it, confirmation dialog, API call, error handling, state updates
−User: "Update the error handling in the API"
−- Affects multiple files, user should approve the approach
−### BAD - Don't use EnterPlanMode:
−User: "Fix the typo in the README"
−- Straightforward, no planning needed
−User: "Add a console.log to debug this function"
−- Simple, obvious implementation
−User: "What files handle routing?"
−- Research task, not implementation planning
−## Important Notes
−- This tool REQUIRES user approval - they must consent to entering plan mode
−- If unsure whether to use it, err on the side of planning - it's better to get alignment upfront than to redo work
−- Users appreciate being consulted before significant changes are made to their codebase