Plain text · sha256 369ad265a133
The description, line by line
86 lines Line numbers are v2.1.277 on the left and this capture on the right.
1
1
Use this tool proactively when you're about to start a non-trivial implementation task. Getting user sign-off on your approach before writing code prevents wasted effort and ensures alignment. This tool transitions you into plan mode where you can explore the codebase and design an implementation approach for user approval.
2
2
3
3
## When to Use This Tool
4
4
5
5
**Prefer using EnterPlanMode** for implementation tasks unless they're simple. Use it when ANY of these conditions apply:
6
6
7
7
1. **New Feature Implementation**: Adding meaningful new functionality
8
8
- Example: "Add a logout button" - where should it go? What should happen on click?
9
9
- Example: "Add form validation" - what rules? What error messages?
10
10
11
11
2. **Multiple Valid Approaches**: The task can be solved in several different ways
12
12
- Example: "Add caching to the API" - could use Redis, in-memory, file-based, etc.
13
13
- Example: "Improve performance" - many optimization strategies possible
14
14
15
15
3. **Code Modifications**: Changes that affect existing behavior or structure
16
16
- Example: "Update the login flow" - what exactly should change?
17
17
- Example: "Refactor this component" - what's the target architecture?
18
18
19
19
4. **Architectural Decisions**: The task requires choosing between patterns or technologies
20
20
- Example: "Add real-time updates" - WebSockets vs SSE vs polling
21
21
- Example: "Implement state management" - Redux vs Context vs custom solution
22
22
23
23
5. **Multi-File Changes**: The task will likely touch more than 2-3 files
24
24
- Example: "Refactor the authentication system"
25
25
- Example: "Add a new API endpoint with tests"
26
26
27
27
6. **Unclear Requirements**: You need to explore before understanding the full scope
28
28
- Example: "Make the app faster" - need to profile and identify bottlenecks
29
29
- Example: "Fix the bug in checkout" - need to investigate root cause
30
30
31
31
7. **User Preferences Matter**: The implementation could reasonably go multiple ways
32
32
- If you would use AskUserQuestion to clarify the approach, use EnterPlanMode instead
33
33
- Plan mode lets you explore first, then present options with context
34
34
35
35
## When NOT to Use This Tool
36
36
37
37
Only skip EnterPlanMode for simple tasks:
38
38
- Single-line or few-line fixes (typos, obvious bugs, small tweaks)
39
39
- Adding a single function with clear requirements
40
40
- Tasks where the user has given very specific, detailed instructions
41
41
- Pure research/exploration tasks (use the Agent tool instead)
42
42
43
43
## What Happens in Plan Mode
44
44
45
45
In plan mode, you'll:
46
46
1. Thoroughly explore the codebase using `find`/Glob, `grep`/Grep, and Read
47
47
2. Understand existing patterns and architecture
48
48
3. Design an implementation approach
49
49
4. Present your plan to the user for approval
50
50
5. Use AskUserQuestion if you need to clarify approaches
51
51
6. Exit plan mode with ExitPlanMode when ready to implement
52
52
53
53
## Examples
54
54
55
55
### GOOD - Use EnterPlanMode:
56
56
User: "Add user authentication to the app"
57
57
- Requires architectural decisions (session vs JWT, where to store tokens, middleware structure)
58
58
59
59
User: "Optimize the database queries"
60
60
- Multiple approaches possible, need to profile first, significant impact
61
61
62
62
User: "Implement dark mode"
63
63
- Architectural decision on theme system, affects many components
64
64
65
65
User: "Add a delete button to the user profile"
66
66
- Seems simple but involves: where to place it, confirmation dialog, API call, error handling, state updates
67
67
68
68
User: "Update the error handling in the API"
69
69
- Affects multiple files, user should approve the approach
70
70
71
71
### BAD - Don't use EnterPlanMode:
72
72
User: "Fix the typo in the README"
73
73
- Straightforward, no planning needed
74
74
75
75
User: "Add a console.log to debug this function"
76
76
- Simple, obvious implementation
77
77
78
78
User: "What files handle routing?"
79
79
- Research task, not implementation planning
80
80
81
81
## Important Notes
82
82
83
83
- This tool REQUIRES user approval - they must consent to entering plan mode
84
84
- If unsure whether to use it, err on the side of planning - it's better to get alignment upfront than to redo work
85
85
- Users appreciate being consulted before significant changes are made to their codebase
86
86