Elffuss BraidHub

kikocis/continue public

main · 11.6 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| **@Terminal** | `@Terminal` | Debugging with output |
117| **@Git Diff** | `@Git Diff` | Change impact analysis |
118
119<Accordion title="Advanced Context Examples">
120<AccordionGroup>
121 <Accordion title="Component Analysis">
122 **After highlighting a React component**:
123 `Analyze this component for performance bottlenecks and plan optimization strategies.`
124 </Accordion>
125
126<Accordion title="Configuration Review">
127 `@Files docker-compose.yml Dockerfile - Review our containerization setup and
128 suggest improvements for production deployment.`
129</Accordion>
130
131<Accordion title="API Design Review">
132 `@Folder src/api - Evaluate our REST API design patterns and identify
133 opportunities for better consistency.`
134</Accordion>
135
136 <Accordion title="Cross-Platform Migration">
137 `@Codebase - Plan a strategy to migrate this web app to also support mobile using React Native.`
138 </Accordion>
139</AccordionGroup>
140</Accordion>
141
142## Prompt Library
143
144### Codebase Exploration
145
146<AccordionGroup>
147 <Accordion title="Understanding Systems">
148 **Data Flow Analysis**:
149 `Help me understand how state management works in this Redux app. Map out the data flow from actions to components.`
150
151 **Microservices Communication**:
152 `Analyze how our microservices communicate and identify potential bottlenecks in service-to-service calls.`
153
154 **Database Schema Review**:
155 `Examine the database schema and relationships to understand how user data is structured and accessed.`
156
157 </Accordion>
158
159 <Accordion title="Legacy Code Investigation">
160 **System Mapping**:
161 `Map out this legacy codebase architecture. What are the main components and how do they communicate?`
162
163 **Technical Debt Assessment**:
164 `Analyze this codebase for technical debt hotspots and maintenance pain points.`
165
166 **Modernization Planning**:
167 `Assess this legacy system and recommend modernization opportunities that provide the highest impact with lowest risk.`
168
169 </Accordion>
170</AccordionGroup>
171
172### Implementation Planning
173
174<AccordionGroup>
175 <Accordion title="Migrations & Upgrades">
176 **Cloud Migration**:
177 `Plan a migration from on-premise servers to AWS, considering our current Node.js application architecture.`
178
179 **Package Manager Migration**:
180 `Create a plan to migrate from npm to pnpm, analyzing dependencies and potential breaking changes.`
181
182 **Monorepo Conversion**:
183 `Plan how to convert our multiple repositories into a single monorepo using Nx or Lerna.`
184
185 </Accordion>
186
187 <Accordion title="Refactoring & Integration">
188 **Service Extraction**:
189 `Plan a refactor to extract shared authentication logic into a reusable service across these microservices.`
190
191 **Payment Integration**:
192 `We need to add Stripe payments to this e-commerce app. Plan the integration considering our current architecture.`
193
194 **API Migration**:
195 `@Codebase - Plan a migration from REST to GraphQL across our entire API.`
196
197 </Accordion>
198</AccordionGroup>
199
200### Issue Investigation
201
202<AccordionGroup>
203 <Accordion title="Performance Problems">
204 **Dashboard Performance**:
205 `Users report slow page loads on the dashboard. Investigate performance bottlenecks in the @Files and related components.`
206
207 **API Optimization**:
208 `Plan a performance optimization strategy for this Node.js API, focusing on database queries and caching.`
209
210 **Bundle Analysis**:
211 `Analyze this React app for performance bottlenecks. What are the most expensive operations?`
212
213 </Accordion>
214
215 <Accordion title="Bug Investigation">
216 **Race Condition Analysis**:
217 `Users occasionally see stale data in the UI. Investigate potential race conditions in our async data fetching.`
218
219 **Production Incidents**:
220 `@Git Diff We're seeing 500 errors in production. Analyze recent changes and identify what might be causing the issue.`
221
222 **Deployment Issues**:
223 `Our staging environment works fine, but production deployments fail. Analyze environment differences.`
224
225 </Accordion>
226</AccordionGroup>
227
228### Architecture Analysis
229
230<AccordionGroup>
231 <Accordion title="Scalability & Performance">
232 **Traffic Planning**:
233 `Analyze this @codebase architecture and identify potential bottlenecks for handling 10x more traffic.`
234
235 **CDN Implementation**:
236 `Plan a CDN strategy for our global user base, considering asset optimization and edge caching.`
237
238 **Caching Strategy**:
239 `Show me 3 different approaches to implementing caching in this API, with pros and cons for each.`
240
241 </Accordion>
242
243 <Accordion title="Security & Compliance">
244 **Security Audit**:
245 `Audit this API for security vulnerabilities, focusing on authentication, authorization, and data validation.`
246
247 **Threat Modeling**:
248 `Model potential security threats for this user registration flow and plan mitigation strategies.`
249
250 **Compliance Planning**:
251 `Plan GDPR compliance implementation for this user data handling system.`
252
253 </Accordion>
254</AccordionGroup>
255
256## How to Transition From Plan to Execution
257
258### When to Transition to Agent Mode
259
260Move to Agent Mode when you have:
261
262✅ **Clear understanding** of the current system
263✅ **Detailed implementation plan** with specific steps
264✅ **Risk assessment** and mitigation strategies
265✅ **Team approval** (if required)
266✅ **Success criteria** defined
267
268### Key Takeaways
269
270The 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.
271
272**Remember:**
273
274- Choose the right mode for each task
275- Start broad, then focus your planning sessions for better results
276- Transition to Agent mode with clear execution steps
277
278The best code is planned code.