Claude Code Plan Mode 是什么?

解释 Claude Code Plan Mode 的作用、进入方式、适用场景,以及如何在编辑前审查计划。

Plan Mode 是 Claude Code 的安全探索模式。Claude 可以读文件、搜索项目、运行必要的探索命令并写出计划,但在你批准前不会修改源代码。

最后核查:2026 年 5 月 24 日。权限模式名称和 UI 可能变化,但核心流程不变:先计划,再批准,再编辑。

短答案

当错误修改的成本高于先做计划的成本时,就应该用 Plan Mode。多文件修改、迁移、价格页面、权限配置和数据库相关任务,都应该先 plan。

如何进入

场景方法
CLI 会话中Shift+Tab 切到 Plan Mode。
单次 prompt/plan 开头。
启动时进入claude --permission-mode plan
项目默认.claude/settings.jsonpermissions 里设置 "defaultMode": "plan"
Web 或 Desktop使用可用的 mode selector。

Plan Mode 能做什么

动作行为
读文件可以,但仍受权限提示影响。
搜索仓库可以。
提出计划这是主要目的。
编辑文件不会,除非你批准进入编辑模式。
运行命令可用于探索,但仍受 permissions 约束。
绕过保护路径不会。

好的 Plan Mode 提示词

Before editing anything, inspect the current route and content structure.
List the files you would change, why each file matters, and any SEO risk.
Wait for my approval before making changes.
/plan Fix the pricing FAQ so it matches the official Claude pricing structure.
Preserve existing URLs and internal links.

批准前检查什么

  • 是否只改必要文件?
  • 是否保留 URL、metadata 和内部链接?
  • 是否说明验证步骤?
  • 是否避开危险命令和大范围重构?
  • 是否标出需要官方信息源核查的事实?

什么时候不用 Plan Mode

单个错别字、一个简单链接、很小的文案修正可以直接改。迁移、价格、认证、数据库、MCP 权限、SEO 页面和支付相关内容,建议先用 Plan Mode。

相关页面

官方来源