Elffuss BraidHub

kikocis/continue public

main · 4.5 KiBRawPermalink
1---
2title: "How Plan Works"
3description: "Plan mode provides a restricted environment with read-only tools, enabling safe exploration and planning without making changes to your codebase."
4---
5
6## Understanding Plan mode
7
8Plan mode is designed to help you understand code and construct plans before making changes. It sits between Chat mode (no tools) and Agent mode (all tools), providing a middle ground where you can explore and analyze without risk.
9
10### The key difference: Read-only tools
11
12While Agent mode has access to all tools including those that modify files, Plan mode restricts access to only read-only tools. This ensures that:
13
14- No files are created, modified, or deleted
15- No commands are executed that could change system state
16- All exploration is safe and non-destructive
17- You can confidently investigate without unintended consequences
18
19## How Plan mode works
20
21When you select Plan mode:
22
231. Continue sends a special system message instructing the model to focus on understanding and planning
242. The tool list is filtered to include only read-only tools
253. The model can use these tools to explore and analyze your codebase
264. When you're ready to implement changes, you switch to Agent mode
27
28### Available tools in Plan mode
29
30Plan mode includes these read-only built-in tools:
31
32- **Read file** (`read_file`): Read the contents of any file in the project
33- **Read currently open file** (`read_currently_open_file`): Read the contents of the currently open file
34- **List directory** (`ls`): List files and directories
35- **Glob search** (`glob_search`): Search for files matching a pattern
36- **Grep search** (`grep_search`): Search file contents using regex patterns
37- **Fetch URL content** (`fetch_url_content`): Retrieve content from web URLs
38- **Search web** (`search_web`): Perform web searches for additional context
39- **View diff** (`view_diff`): View the current git diff
40- **View repo map** (`view_repo_map`): Get an overview of the repository structure
41- **View subdirectory** (`view_subdirectory`): Get a detailed view of a specific directory
42- **Codebase tool** (`codebase_tool`): Advanced codebase analysis capabilities
43
44### MCP tools support
45
46In addition to built-in read-only tools, Plan mode also supports all MCP (Model Context Protocol) tools. This allows integration with external services that provide additional context or analysis capabilities without modifying your local environment.
47
48<Info>
49 While Plan mode restricts built-in tools to read-only operations, MCP tools
50 are not filtered by Continue. Some MCP tools may have write capabilities that
51 could modify your system or external services. Always verify what actions your
52 MCP tools can perform before using them in Plan mode.
53</Info>
54
55## The planning workflow
56
57A typical Plan mode workflow follows these steps:
58
591. **Exploration**: Use read-only tools to understand the current state
602. **Analysis**: Identify what needs to change and potential impacts
613. **Planning**: Develop a detailed plan for implementation
624. **Verification**: Review the plan and ensure it addresses all requirements
635. **Execution**: Switch to Agent mode to implement the plan
64
65### Example: Planning a refactor
66
67```
68User: Help me plan a refactor to extract the authentication logic into a separate module
69
70Plan mode:
711. Reads relevant files to understand current structure
722. Analyzes dependencies and usage patterns
733. Identifies all places that need updates
744. Creates a step-by-step refactoring plan
755. Suggests: "Switch to Agent mode to implement this plan"
76```
77
78## System message and behavior
79
80Plan mode uses a dedicated system message that:
81
82- Instructs the model to focus on understanding and planning
83- Emphasizes using only read-only tools
84- Reminds the model to suggest switching to Agent mode for implementation
85- Encourages thorough analysis before suggesting changes
86
87<Info>
88 The system message can be customized per model. See it [directly in
89 the
90 code](https://github.com/continuedev/continue/blob/main/core/llm/defaultSystemMessages.ts).
91</Info>
92
93## When to use Plan mode vs other modes
94
95### Use Plan mode when:
96
97- Exploring unfamiliar codebases
98- Planning complex refactors or features
99- Debugging and understanding issues
100- Reviewing code architecture
101- Creating implementation strategies
102
103### Use Chat mode when:
104
105- Having discussions without needing file access
106- Asking general programming questions
107- Getting explanations without exploring code
108
109### Use Agent mode when:
110
111- Ready to implement changes
112- Need to create or modify files
113- Want to run commands or tests
114- Implementing a plan developed in Plan mode