planning-mode-guard — Claude Code rule: setup guide
planning-mode-guard prevents AI models from altering production code during planning and locks output to the user language.
MIT ★ 359 updated 2025-12-01
.claude/rules/planning-mode-guard.mdWhat planning-mode-guard does
This rule separates software planning from execution. While in planning mode, the agent examines the project and writes implementation_plan.md. It cannot modify production files or invoke edit tools such as replace_file_content. The assistant may only update the planning files themselves.
Code modification remains blocked until the user provides an explicit instruction to begin. The rule also enforces an absolute language protocol: all responses, task.md, and walkthrough.md files must match the language of the developer's latest prompt.
What it helps with
- prevent unexpected code modifications during planning phases
- prepare structured implementation plans before changing project files
- maintain consistency between the user language and agent documentation
Example prompts for the agent
- Create implementation_plan.md for the new feature without writing code
- Inspect the repository and list migration steps in task.md
- Plan looks good, implement it
How to install planning-mode-guard
Manually: put the files in place
.claude/rules/planning-mode-guard.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/planning-mode-guard.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/planning-mode-guard.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/planning-mode-guard.mdManually: put the files in place
.clinerules/planning-mode-guard.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about planning-mode-guard
How to install planning-mode-guard in Claude Code?
Save the rule into .claude/rules/planning-mode-guard.md in your project root. For Windsurf, put it into .devin/rules/planning-mode-guard.md.
What does planning-mode-guard do?
It stops the assistant from modifying code until you explicitly confirm the plan. The agent is restricted to researching files and writing plans.
Can the model edit any files in planning mode?
Yes, it is allowed to write and update planning documents such as implementation_plan.md. Application source code remains off-limits.
Source text
planning-mode-guard.md · MIT
--- trigger: always_on description: Rule to prevent code implementation during Planning mode --- # Planning Mode Guard ## 0. 🚨 Language Protocol (Highest Priority - Absolute Compliance) **All outputs must use the same language as the user's most recent input.** - **Scope**: - Conversation responses - implementation_plan.md - task.md - walkthrough.md - **Prohibited**: - Example: Creating plans or task lists in English when the user is using Japanese. - *Excludes variable names and reserved words in code. ## 1. Mode Confirmation and Behavior Definition Before generating each response, confirm the current mode (`task_boundary` Mode or user specification) and behave according to the following definitions. ### 🛡️ Planning Mode (PLANNING) **Purpose**: Formulating implementation plans, defining requirements, building consensus with users - **✅ What to do**: - Create and present implementation plans (`implementation_plan.md`) aligned with user requests - Investigate and understand existing code - **🚫 Strictly Prohibited**: - **Implementing or editing production code** (use of `replace_file_content`, etc. is prohibited) - Starting implementation before obtaining explicit user approval (instructions like "implement it") - *Updating plan files themselves is permitted ### 🚀 Execution Mode (Fast / Agent / EXECUTION) **Purpose**: Task execution, coding - **✅ What to do**: - Execute tasks instructed by the user promptly based on approved plans
© kinopeee · MIT · kinopeee/windsurf-antigravity-rules