Elffuss BraidHub

kikocis/continue public

57d99ced5e24 · 12.0 KiBRawPermalink
1---
2title: "Using Plan Mode with Continue"
3description: "Plan Mode gives you a safe, read-only environment to explore your codebase, map out solutions, and collaborate with AI before making any changes. Think of it as your sandbox for understanding and strategy."
4---
5
6Plan Mode prevents unintentional file modifications, letting you think through solutions and build confidence before committing to action. The core principle is understand before you change, giving you a research-first approach that prevents costly mistakes and creates better architectural decisions.
7
8<Accordion title="Learn how to choose the right mode" icon="lightbulb">
9 <Columns cols={3}>
10 <Card title="Chat Mode" icon="comments">
11 *Learn and discuss without changing code.*
12
13 **Mental Model:** Talking to a knowledgeable colleague
14 **Best For:** Explaining concepts, comparing approaches, code review discussions.
15
16 </Card>
17
18 <Card title="Plan Mode" icon="binoculars">
19 *Safely explore and plan with read-only tools.*
20
21 **Mental Model:** Architect surveying before renovation
22 **Best For:** Understanding a codebase, bug investigation, planning implementations.
23
24 </Card>
25
26 <Card title="Agent Mode" icon="hammer">
27 *Make actual changes with full tool access.*
28
29 **Mental Model:** Contractor executing approved blueprints
30 **Best For:** Implementing features, fixing bugs, running tests and commands.
31
32 </Card>
33</Columns>
34 </Accordion>
35
36## What Are the Use Cases for Plan Mode
37
38Plan Mode excels in four key scenarios where understanding before acting prevents expensive mistakes:
39
40<Columns cols={2}>
41 <Card title="Codebase Exploration" icon="map">
42 Navigate unfamiliar systems and trace data flows without modification risk.
43
44 [See exploration prompts →](#prompt-library)
45 </Card>
46
47 <Card title="Implementation Planning" icon="clipboard-list">
48 Map dependencies and sequence complex changes before execution. <br />
49
50[See planning prompts →](#prompt-library)
51
52 </Card>
53
54 <Card title="Issue Investigation" icon="magnifying-glass">
55 Debug systematically by tracing execution paths and analyzing root causes.{" "}
56
57[See debugging prompts →](#prompt-library)
58
59 </Card>
60
61 <Card title="Architecture Analysis" icon="building">
62 Assess system health, identify bottlenecks, and plan improvements.
63
64 [See analysis prompts →](#prompt-library)
65 </Card>
66</Columns>
67
68## What Are the Best Practices for Plan Mode?
69
70### How to Plan Faster
71
721. **Scope your requests**: `Focus analysis on the user authentication module only, ignore the admin features`
732. **Use targeted context**: `Analyze @Files and its direct imports for security issues`
74
75### How to Create Higher Quality Plans
76
771. **Provide business context**: `This feature needs to handle Black Friday traffic (10x normal load). Plan accordingly.`
782. **Share technical constraints**: `We're on AWS with strict security requirements. Plan a file upload system that meets SOC2 compliance.`
793. **Ask for risk analysis**: `What could go wrong with this database migration? Plan rollback procedures.`
804. **Request multiple perspectives**: `Show me 3 different approaches to implementing caching in this API, with pros and cons for each.`
81
82## How to Enable Plan Mode
83
84You can switch to `Plan` in the mode selector below the chat input box.
85
86![How to select plan mode](../images/plan-mode-selector.png)
87
88## What Tools Are Available in Plan Mode?
89
90| Tool | Available | Description |
91| :-------------------------------- | :-------- | :--------------------------------------------------- |
92| **File/directory reading** | ✅ | Browse and read any file or folder in your workspace |
93| **Grep/glob search** | ✅ | Search for patterns across files and directories |
94| **Repository structure analysis** | ✅ | Understand codebase organization and dependencies |
95| **Git history/diffs** | ✅ | Review commits, branches, and changes |
96| **Web content fetching** | ✅ | Access external documentation and resources |
97| **External API access** | ✅ | Read-only calls to external services |
98| **MCP tools** | ✅ | Model Context Protocol integrations |
99| **Database schema examination** | ✅ | Analyze database structure (read-only) |
100| **File creation/editing** | ❌ | Creating or modifying files |
101| **Terminal command execution** | ❌ | Running shell commands |
102| **System modifications** | ❌ | Changing system settings or configurations |
103| **Package installation** | ❌ | Installing dependencies or packages |
104| **Git commits/pushes** | ❌ | Making changes to version control |
105| **Database modifications** | ❌ | Altering database data or structure |
106
107## How Context Integration Works in Plan Mode
108
109Context is the foundation of effective planning. Without proper context, AI models fall back on generic patterns, leading to plans that don't fit your specific system. Continue's [context system](/features/chat/context-selection) transforms broad suggestions into actionable strategies:
110
111| Context Type | Usage | Best For |
112| :------------------- | :----------------------------------------------------- | :---------------------------- |
113| **Highlighted Code** | `cmd/ctrl + L` (VS Code) or `cmd/ctrl + J` (JetBrains) | Component-specific analysis |
114| **Active File** | `opt/alt + enter` when sending request | Current file context |
115| **@Files** | `@Files package.json tsconfig.json` | Specific file analysis |
116| **@Folder** | `@Folder src/auth` | Directory-wide planning |
117| **@Codebase** | `@Codebase` | Comprehensive system analysis |
118| **@Docs** | `@Docs React Router` | Standards-compliant planning |
119| **@Terminal** | `@Terminal` | Debugging with output |
120| **@Git Diff** | `@Git Diff` | Change impact analysis |
121
122<Accordion title="Advanced Context Examples">
123<AccordionGroup>
124 <Accordion title="Component Analysis">
125 **After highlighting a React component**:
126 `Analyze this component for performance bottlenecks and plan optimization strategies.`
127 </Accordion>
128
129<Accordion title="Configuration Review">
130 `@Files docker-compose.yml Dockerfile - Review our containerization setup and
131 suggest improvements for production deployment.`
132</Accordion>
133
134<Accordion title="API Design Review">
135 `@Folder src/api - Evaluate our REST API design patterns and identify
136 opportunities for better consistency.`
137</Accordion>
138
139 <Accordion title="Cross-Platform Migration">
140 `@Codebase - Plan a strategy to migrate this web app to also support mobile using React Native.`
141 </Accordion>
142</AccordionGroup>
143</Accordion>
144
145## Prompt Library
146
147### Codebase Exploration
148
149<AccordionGroup>
150 <Accordion title="Understanding Systems">
151 **Data Flow Analysis**:
152 `Help me understand how state management works in this Redux app. Map out the data flow from actions to components.`
153
154 **Microservices Communication**:
155 `Analyze how our microservices communicate and identify potential bottlenecks in service-to-service calls.`
156
157 **Database Schema Review**:
158 `Examine the database schema and relationships to understand how user data is structured and accessed.`
159
160 </Accordion>
161
162 <Accordion title="Legacy Code Investigation">
163 **System Mapping**:
164 `Map out this legacy codebase architecture. What are the main components and how do they communicate?`
165
166 **Technical Debt Assessment**:
167 `Analyze this codebase for technical debt hotspots and maintenance pain points.`
168
169 **Modernization Planning**:
170 `Assess this legacy system and recommend modernization opportunities that provide the highest impact with lowest risk.`
171
172 </Accordion>
173</AccordionGroup>
174
175### Implementation Planning
176
177<AccordionGroup>
178 <Accordion title="Migrations & Upgrades">
179 **Cloud Migration**:
180 `Plan a migration from on-premise servers to AWS, considering our current Node.js application architecture.`
181
182 **Package Manager Migration**:
183 `Create a plan to migrate from npm to pnpm, analyzing dependencies and potential breaking changes.`
184
185 **Monorepo Conversion**:
186 `Plan how to convert our multiple repositories into a single monorepo using Nx or Lerna.`
187
188 </Accordion>
189
190 <Accordion title="Refactoring & Integration">
191 **Service Extraction**:
192 `Plan a refactor to extract shared authentication logic into a reusable service across these microservices.`
193
194 **Payment Integration**:
195 `We need to add Stripe payments to this e-commerce app. Plan the integration considering our current architecture.`
196
197 **API Migration**:
198 `@Codebase - Plan a migration from REST to GraphQL across our entire API.`
199
200 </Accordion>
201</AccordionGroup>
202
203### Issue Investigation
204
205<AccordionGroup>
206 <Accordion title="Performance Problems">
207 **Dashboard Performance**:
208 `Users report slow page loads on the dashboard. Investigate performance bottlenecks in the @Files and related components.`
209
210 **API Optimization**:
211 `Plan a performance optimization strategy for this Node.js API, focusing on database queries and caching.`
212
213 **Bundle Analysis**:
214 `Analyze this React app for performance bottlenecks. What are the most expensive operations?`
215
216 </Accordion>
217
218 <Accordion title="Bug Investigation">
219 **Race Condition Analysis**:
220 `Users occasionally see stale data in the UI. Investigate potential race conditions in our async data fetching.`
221
222 **Production Incidents**:
223 `@Git Diff We're seeing 500 errors in production. Analyze recent changes and identify what might be causing the issue.`
224
225 **Deployment Issues**:
226 `Our staging environment works fine, but production deployments fail. Analyze environment differences.`
227
228 </Accordion>
229</AccordionGroup>
230
231### Architecture Analysis
232
233<AccordionGroup>
234 <Accordion title="Scalability & Performance">
235 **Traffic Planning**:
236 `Analyze this @codebase architecture and identify potential bottlenecks for handling 10x more traffic.`
237
238 **CDN Implementation**:
239 `Plan a CDN strategy for our global user base, considering asset optimization and edge caching.`
240
241 **Caching Strategy**:
242 `Show me 3 different approaches to implementing caching in this API, with pros and cons for each.`
243
244 </Accordion>
245
246 <Accordion title="Security & Compliance">
247 **Security Audit**:
248 `Audit this API for security vulnerabilities, focusing on authentication, authorization, and data validation.`
249
250 **Threat Modeling**:
251 `Model potential security threats for this user registration flow and plan mitigation strategies.`
252
253 **Compliance Planning**:
254 `Plan GDPR compliance implementation for this user data handling system.`
255
256 </Accordion>
257</AccordionGroup>
258
259## How to Transition From Plan to Execution
260
261### When to Transition to Agent Mode
262
263Move to Agent Mode when you have:
264
265✅ **Clear understanding** of the current system
266✅ **Detailed implementation plan** with specific steps
267✅ **Risk assessment** and mitigation strategies
268✅ **Team approval** (if required)
269✅ **Success criteria** defined
270
271### Key Takeaways
272
273The three-mode system—Chat for learning, Plan for strategy, and Agent for execution—provides a complete development workflow that scales from simple bug fixes to complex system architecture.
274
275**Remember:**
276
277- Choose the right mode for each task
278- Leverage context providers (@Codebase, @Files, @Docs, etc.) for better planning
279- Start broad, then focus your planning sessions for better results
280- Transition to Agent mode with clear execution steps
281
282The best code is planned code.