-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Description
Problem
Cline currently allows destructive file operations (write_to_file, replace_in_file, execute_command) in Plan Mode, which violates the intended purpose of Plan Mode as a planning and information-gathering phase. This occurs because tool restrictions rely solely on system prompt instructions that models frequently ignore, especially under certain conditions like:
• After switching between Plan and Act modes multiple times
• During long conversations approaching context limits
• With certain models (particularly Gemini variants and o3-mini)
• When users provide prompts that sound like approval
For example:
• Users expect Plan Mode to only gather information and create plans
• Instead, Cline modifies files without explicit approval or mode switching
• This breaks user trust and wastes tokens on unintended operations
Solution
Implement code-level restrictions that prevent destructive tools from being available in Plan Mode:
- Modify tool availability logic to exclude destructive tools in Plan Mode
- Restrict write_to_file, replace_in_file, and execute_command tools when mode === 'plan'
- Allow only information-gathering tools (read_file, list_files, search_files, etc.) and plan_mode_respond
- Provide clear error messages if models attempt to use restricted tools
- Ensure the restriction is enforced at the tool execution level, not just prompt level
Related Issues
• Closes #1621 - Cline Writes/Edits Files in plan Mode
• Closes #1676 - since latest versions CLINE seems to be editing files even in Plan mode
• Closes #1735 - Cline: 3.3.1 - Plan Mode leads to file changes with o3-mini
• Closes #3806 - Plan mode -> AI changes files
• Closes #3934 - Cline is Writing and Changing Code In Plan Mode
• Closes #2024 - Sometimes Cline ACTs on PLAN mode
• Closes #2131 - Cline editting files while in Plan mode
• Related to #1416 - Cline took 'action' while in Plan Mode (already closed in favor of #1621)