来源:https://academy.claude.com/courses/ai-native-sdlc-playbook/plan-mode 读这篇之前:03 需求和设计 不确定:ZH 是 Clint 译官方英文课体,不是 Anthropic 中文。
本课词汇
| English | 中文 | 怎么记 |
|---|---|---|
| plan mode | 计划模式 | 能读代码库、先不能改文件,直到人接受计划 |
| plan.md | 实现计划 | 改哪些文件、顺序、风险、怎么证明 |
| auto mode | 自动模式 | 计划批过之后,不再每个编辑都问一声 |
| source of truth | 权威记录 | Jira 和 Markdown 只能有一个说了算,另一个留副本或链接 |
| MCP | 模型上下文协议 | Claude 读写 Jira 等外部系统的那层连接 |
| worktree | 工作树 | 同一仓库另一份检出,给并行会话隔离文件 |
对照正文
先问计划 / Start in plan mode
EN Engineers start Claude Code sessions in plan mode, give Claude the approved spec.md from Stage 2: Design, and let it interview them, iterating on the plan until they are happy with it.
ZH 工程师开 Claude Code 会话时用 plan mode,把 Stage 2: Design 批过的 spec.md 给 Claude,让它来采访,计划改到他们满意。
什么变了 / What changes
EN
| Traditional | AI-native |
|---|---|
| An engineer reads the design and starts writing code. How the change will be made, down to which files and which tests, stays in the engineer’s head or at best in a ticket comment. Nobody else can review it. The first thing a reviewer sees is the finished diff, and by then rework is slow. | Work starts with a written plan that Claude produces in plan mode, where it can read the codebase without changing anything. The engineer corrects the plan before code is written, and the approved version is committed as plan.md for later stages to check against. |
ZH
| 传统 | AI-native |
|---|---|
| 工程师读设计就开始写代码。怎么改、改哪些文件、哪些测试,留在工程师脑子里,顶多在工单评论里。别人审不了。审查者先看到的是做完的 diff,那时返工已经慢了。 | 工作从书面计划开始:Claude 在 plan mode 里产出,能读代码库、先不改任何东西。工程师在写代码前改正计划,批过的版本提交成 plan.md,后面阶段对照它检查。 |
怎么起步 / Getting started
EN Prerequisites: The intent artifact (intent.md or spec.md) if one exists, and the CLAUDE.md file helps.
Infrastructure: Claude Code with access to the repository.
ZH 先决条件:如果有意图工件(intent.md 或 spec.md)就带上;CLAUDE.md 有帮助。
基础设施:Claude Code 能访问仓库。
怎么做 / How to execute it
EN 1. The engineer starts the session in plan mode with Claude.
2. The engineer gives Claude the intent.md and the spec.md and asks for an implementation plan that names the files that change, the order of the work, and the tests that prove it.
3. Interrogate the plan by asking what the change could break, which step is most risky, and what other options Claude chose not to do.
4. Iterate until an engineer who has never seen the conversation could implement the change from the plan alone.
5. Commit the approved plan as plan.md. The plan joins the audit trail, and the PR review play (Stage 5: Deploy) checks the eventual diff against it.
6. Accept the plan and let Claude implement. With a solid plan, the implementation is often a single pass.
7. When implementation departs from the plan, update plan.md in the same commit. Consider using a hook to enforce synchronization between the two.
ZH 1. 工程师用 plan mode 开会话。
2. 把 intent.md 和 spec.md 给 Claude,要一份实现计划:点名改哪些文件、干活顺序、用哪些测试证明。
3. 拷问计划:可能弄坏什么、哪一步最险、Claude 没选的别的方案是什么。
4. 改到一个从没看过这场对话的工程师,单靠计划也能实现这次改动。
5. 批过的计划提交成 plan.md。它进入审计链;PR 审查打法(Stage 5: Deploy)会拿最终 diff 对照它。
6. 接受计划,让 Claude 实现。计划扎实的话,实现常常一趟过。
7. 实现偏离计划时,同一提交里更新 plan.md。可以考虑用 hook 强制两者同步。
长什么样 / What it looks like
EN plan.md:
ZH plan.md:
# Plan: claims status self-service (from intent.md 2026-06-02)
## Files that change
portal/src/claims/StatusPanel.tsx (new), claims-api/routes/status.py, claims-api/tests/test_status.py
## Order of work
1. Add the status endpoint behind existing auth.
2. Panel against the endpoint.
3. Wire into the portal nav.
## Risks
The claims-core API rate-limits at 50 rps; the panel must cache.
## Proof
test_status.py covers the four claim states; screenshot matches the approved mock.
ZH 官方示例,保持英文。理赔状态自助:改哪些文件、顺序、风险(限流要缓存)、证明(测试覆盖四种状态,截图对上 mock)。
治理 / Governance considerations
EN Design review happens before any code is generated, when changing course is still a matter of editing a document. Plan mode enforces this itself, since Claude cannot edit files until the engineer accepts the plan. The plan and its revisions are logged along with who accepted it. Routine changes are approved by the engineer, and anything the organization classes as higher risk goes to a tech lead or architect.
ZH 设计审查发生在生成任何代码之前,改方向还只是改一份文档。Plan mode 自己就强制这一点:工程师接受计划之前,Claude 不能改文件。计划和修订,连同谁接受的,都会记下。常规改动工程师批;组织定为更高风险的,交给技术负责人或架构师。
怎么衡量 / How to measure it
EN Leading indicator: Share of changes that merge from the first implementation pass, and time from plan approval to merged PR with the required data within the PR metadata.
Lagging indicator: Rework cycles per change, again from the PR metadata, and how often the merged diff still matches the committed plan.md.
ZH 领先指标:第一次实现就合并的改动占比;从计划批准到合并 PR 的时间(PR 元数据里该有)。
滞后指标:每次改动的返工轮次(还是 PR 元数据),以及合并后的 diff 还对得上已提交 plan.md 的频率。
Claude Code 的 auto mode / Claude Code in auto mode
EN Claude Code can also run in auto mode, where the engineer iterates on and approves the plan, and Claude then applies each change without a per-edit prompt. As the guardrails from the later plays mature (a tuned CLAUDE.md, skills that encode policy, hooks that block unsafe actions, and a test suite Claude can run), auto mode becomes the default for routine work: a tight spec.md, a small blast radius, and code the tests already cover.
ZH Claude Code 也能跑 auto mode:工程师把计划改到批过,之后每次改动不再逐条问。后面几课的护栏成熟之后(调过的 CLAUDE.md、把政策写成的 skills、拦住不安全动作的 hooks、Claude 能跑的测试套件),auto mode 会变成常规活的默认:spec.md 收得紧、爆炸半径小、测试已经盖住的代码。
EN The shift is now away from the user watching the agent make the edits and reviewing actions, toward the review of artifacts after longer autonomous sessions. Auto mode further enables parallelism across individuals and the team when used with worktrees and is fundamental to running the SDLC autonomously and closing the loop as described in Stage 6: Maintain.
ZH 现在不再是人盯着 agent 改、审每一个动作,而是更长的自主会话之后审工件。Auto mode 配上 worktree,还能让个人和团队并行;它是 SDLC 自主跑起来、并按 Stage 6: Maintain 把环闭合的基础。
遗留系统和权威记录 / Legacy systems and the source of truth
EN Existing SDLC processes likely already track artifacts, just not in Markdown files. Work items may be in Jira, requirements in a tool with regulatory traceability built in, designs in Figma, and change approvals with a change board. Those systems are hard to displace because auditors and regulators already accept them and other teams depend on them, so the AI-native SDLC has to fit around what exists. For each artifact the process produces, one system should be named the source of truth and the others hold a copy or a link.
ZH 现有 SDLC 多半已经在追工件,只是不在 Markdown 里。工项可能在 Jira,需求在带监管追溯的工具里,设计在 Figma,变更批准走变更委员会。这些系统难换,因为审计和监管已经认它们,别的团队也靠它们,所以 AI-native SDLC 必须迁就已有的。流程产出的每份工件,应点名一个系统当权威记录,其余留副本或链接。
EN The below configurations can be set up to have one source of truth with the choice differing per artifact:
ZH 可以按工件分别选一种「只有一个说了算」的配法:
EN The repo as the source of truth. The Markdown artifacts are the authoritative record, and the legacy system references files within commits. This can be one of the cleanest configurations for engineering-led organizations as all records live in one tool with one timestamp authority.
The legacy system is the truth. Jira, ServiceNow, or the requirements tool holds the authoritative record, and the Markdown artifacts are working copies. Claude reads the record at the start of the session and writes the outcome back through a Model Context Protocol (MCP) connector in the same session that produced the spec or the plan.
Linkage as the minimum bar. All artifacts note the record ID, and all legacy records contain the commit SHA of the Markdown file. The linkage option is a good place to start when transitioning to the AI-native SDLC as there are two sources of truth.
ZH 仓库说了算。 Markdown 工件是权威记录,遗留系统引用提交里的文件。对工程主导的组织,这往往最干净:记录都在一个工具、一个时间戳权威。
遗留系统说了算。 Jira、ServiceNow 或需求工具拿着权威记录,Markdown 是工作副本。Claude 开会话时读记录,产出 spec 或计划的同一会话里,经 MCP 连接器写回去。
最低标准是互链。 所有工件注明记录 ID,所有遗留记录带上 Markdown 的 commit SHA。往 AI-native SDLC 过渡时,这是好起点——因为暂时有两份权威。
EN Both the legacy system and the AI-native Markdown-first system can coexist so long as there is a link between the two or one is declared the source of truth.
ZH 遗留系统和以 Markdown 为先的 AI-native 系统可以共存,只要两者有链接,或点名一个说了算。
读完能记住的三句话
EN Plan mode lets Claude read the repo but not edit until a human accepts plan.md.
ZH Plan mode 让 Claude 读仓库,人接受 plan.md 之前不能改。
EN Auto mode is for later, once CLAUDE.md, skills, hooks, and tests are in place.
ZH Auto mode 是后话,等 CLAUDE.md、skills、hooks 和测试到位。
EN Pick one source of truth per artifact. Linking Jira to a commit SHA is the minimum. ZH 每份工件只点名一个权威。Jira 链到 commit SHA 是最低标准。