多数人对着 Claude Code 一句接一句地聊,让它边想边改 —— 然后奇怪它为什么跑偏。它真正的用法是一个循环:先在计划模式里让它把打算怎么做讲给你听、你批准,再放它动手改文件、跑命令,最后你审那份 diff。权限模式决定它哪些能自己做、哪些要问你;checkpoint 让你随时倒回。这一章把这个「计划 → 动手 → 验收」循环讲透 —— 它是你从「自己写」过渡到「派活」的第一步,也是全书其余章节的地基。Most people chat at Claude Code line by line, letting it think and edit at once — then wonder why it drifts. Its real use is a loop: first, in plan mode, it tells you how it intends to proceed and you approve; then it acts — editing files, running commands; finally you review the diff. Permission modes decide what it may do alone and what it must ask; checkpoints let you rewind. This chapter pins down that plan → act → review loop — the first step from doing the work yourself to delegating it, and the foundation for every chapter that follows.
10 分钟 · 初稿 2026.0710 Min · Drafted 2026.07
多数人对着 Claude Code 一句接一句地聊:说一个想法,看它边想边改,不对再补一句。三十分钟后 diff 大得没法看,你也说不清它是在哪一步拐错的。问题不在模型,在没有节奏 —— 它真正的用法是一个循环:先计划,你批准;再动手,权限定自由度;最后验收,不对就倒回。这一章把这个循环装进你的手里。Most people chat at Claude Code line by line: toss an idea, watch it think and edit at once, patch with another sentence when it's off. Thirty minutes later the diff is too big to read and you can't say where it turned wrong. The problem isn't the model — it's the missing cadence. Its real use is a loop: plan first, you approve; then act, with permissions setting the freedom; then review, and rewind when it's wrong. This chapter puts that loop in your hands.
— I
先计划:方案没批,一个字不许改Plan First: No Edits Until the Plan Is Approved.
计划模式是循环的第一格。进入之后,Claude 只做三件事:读文件、跑只读的探索命令、写出一份「我打算怎么做」—— 在你批准这份计划之前,任何编辑都被挡在门外。1注 1Note 1Claude Code Docs · Permission modes —— 计划模式:让 Claude 调研、提方案,但不动手改源码;读文件、跑只读探索命令、写出计划,批准前编辑一律被挡。Shift+Tab 或 /plan 进入,Ctrl+G 在编辑器里直接改计划;批准时可选「手动逐个批」或切自动模式。模式表:default(只读免批)、acceptEdits(文件编辑与常见文件系统命令免批)、plan(只读)、auto(分类器盯着放行一切、拦越界)、dontAsk(只跑预批准项)、bypassPermissions(全放行,仅限隔离环境)。截至 2026-07-17。Claude Code Docs · Permission modes — plan mode: Claude researches and proposes without touching source; it reads files, runs read-only exploration, and writes a plan, with edits blocked until you approve. Enter via Shift+Tab or /plan, press Ctrl+G to edit the plan directly; on approval choose manual per-edit review or auto mode. The mode table: default (reads only), acceptEdits (file edits and common filesystem commands run free), plan (reads only), auto (a classifier watches everything and blocks overreach), dontAsk (pre-approved only), bypassPermissions (everything, isolated environments only). As of 2026-07-17.进入方式有三种:会话里按 Shift+Tab 循环切换,或在单条 prompt 前加 /plan,或启动时 claude --permission-mode plan。计划出来后别急着点头:按 Ctrl+G 能把它整份丢进你的编辑器,删掉过度设计的那段、补上它漏掉的边界情况,再让它照改好的版本动手。1注 1Note 1Claude Code Docs · Permission modes —— 计划模式:让 Claude 调研、提方案,但不动手改源码;读文件、跑只读探索命令、写出计划,批准前编辑一律被挡。Shift+Tab 或 /plan 进入,Ctrl+G 在编辑器里直接改计划;批准时可选「手动逐个批」或切自动模式。模式表:default(只读免批)、acceptEdits(文件编辑与常见文件系统命令免批)、plan(只读)、auto(分类器盯着放行一切、拦越界)、dontAsk(只跑预批准项)、bypassPermissions(全放行,仅限隔离环境)。截至 2026-07-17。Claude Code Docs · Permission modes — plan mode: Claude researches and proposes without touching source; it reads files, runs read-only exploration, and writes a plan, with edits blocked until you approve. Enter via Shift+Tab or /plan, press Ctrl+G to edit the plan directly; on approval choose manual per-edit review or auto mode. The mode table: default (reads only), acceptEdits (file edits and common filesystem commands run free), plan (reads only), auto (a classifier watches everything and blocks overreach), dontAsk (pre-approved only), bypassPermissions (everything, isolated environments only). As of 2026-07-17.Plan mode is the loop's first cell. Inside it, Claude does three things only: reads files, runs read-only exploration commands, and writes out how it intends to proceed — and until you approve that plan, every edit stays blocked.1注 1Note 1Claude Code Docs · Permission modes —— 计划模式:让 Claude 调研、提方案,但不动手改源码;读文件、跑只读探索命令、写出计划,批准前编辑一律被挡。Shift+Tab 或 /plan 进入,Ctrl+G 在编辑器里直接改计划;批准时可选「手动逐个批」或切自动模式。模式表:default(只读免批)、acceptEdits(文件编辑与常见文件系统命令免批)、plan(只读)、auto(分类器盯着放行一切、拦越界)、dontAsk(只跑预批准项)、bypassPermissions(全放行,仅限隔离环境)。截至 2026-07-17。Claude Code Docs · Permission modes — plan mode: Claude researches and proposes without touching source; it reads files, runs read-only exploration, and writes a plan, with edits blocked until you approve. Enter via Shift+Tab or /plan, press Ctrl+G to edit the plan directly; on approval choose manual per-edit review or auto mode. The mode table: default (reads only), acceptEdits (file edits and common filesystem commands run free), plan (reads only), auto (a classifier watches everything and blocks overreach), dontAsk (pre-approved only), bypassPermissions (everything, isolated environments only). As of 2026-07-17. Three ways in: cycle with Shift+Tab, prefix a single prompt with /plan, or launch with claude --permission-mode plan. When the plan lands, don't nod it through: Ctrl+G drops the whole thing into your editor, where you delete the over-engineered section and add the edge case it missed, then let it act on the corrected version.1注 1Note 1Claude Code Docs · Permission modes —— 计划模式:让 Claude 调研、提方案,但不动手改源码;读文件、跑只读探索命令、写出计划,批准前编辑一律被挡。Shift+Tab 或 /plan 进入,Ctrl+G 在编辑器里直接改计划;批准时可选「手动逐个批」或切自动模式。模式表:default(只读免批)、acceptEdits(文件编辑与常见文件系统命令免批)、plan(只读)、auto(分类器盯着放行一切、拦越界)、dontAsk(只跑预批准项)、bypassPermissions(全放行,仅限隔离环境)。截至 2026-07-17。Claude Code Docs · Permission modes — plan mode: Claude researches and proposes without touching source; it reads files, runs read-only exploration, and writes a plan, with edits blocked until you approve. Enter via Shift+Tab or /plan, press Ctrl+G to edit the plan directly; on approval choose manual per-edit review or auto mode. The mode table: default (reads only), acceptEdits (file edits and common filesystem commands run free), plan (reads only), auto (a classifier watches everything and blocks overreach), dontAsk (pre-approved only), bypassPermissions (everything, isolated environments only). As of 2026-07-17.这份被你改过、批过的计划,不只是开工许可 —— 它是第 9 章验收时的基线:活交回来,diff 就对着它逐条核。所以计划请求本身值得写好:说清目标,更要说清验收标准和禁区。This plan — edited and approved by you — isn't just a permit to start. It's the baseline chapter 9 reviews against: when the work comes back, the diff is read against it item by item. Which is why the planning request itself deserves care: state the goal, and state the acceptance criteria and the no-go zones.
提示词Prompt计划请求模板Planning request template
/plan 我要做:<一句话目标>。
先读 <相关目录或文件>,把打算怎么做写成计划,包括:要改哪些文件、为什么。
验收标准:<能检验的标准,做完要能通过>。
禁区:<不许动的目录 / 不许引的依赖 / 不许做的重构>。
拿不准的地方列成问题问我,别自己猜。/plan I want: <one-sentence goal>.
Read <relevant dirs or files> first, then write a plan: which files change and why.
Acceptance criteria: <a checkable standard the result must pass>.
Off-limits: <directories not to touch / dependencies not to add / refactors not to do>.
List open questions instead of guessing.
/plan 我要做:给登录接口加限流。
先读 src/middleware/ 和 src/auth/,把打算怎么做写成计划,包括:要改哪些文件、为什么。
验收标准:同一 IP 一分钟内第 6 次请求返回 429,已有登录测试全部仍然通过。
禁区:不动数据库 schema,不新引限流库,用项目里已有的 Redis 客户端。
拿不准的地方列成问题问我,别自己猜。/plan I want: rate limiting on the login endpoint.
Read src/middleware/ and src/auth/ first, then write a plan: which files change and why.
Acceptance criteria: the 6th request from one IP within a minute returns 429, and all existing login tests still pass.
Off-limits: no database schema changes, no new rate-limit library — use the Redis client already in the project.
List open questions instead of guessing.
计划也有成本,别处处开。官方的判断尺很好用:方案不确定、改动跨多个文件、代码不熟 —— 值得计划;一句话能说清那个 diff 的活,直接干。2注 2Note 2Claude Code Docs · Best practices —— 推荐工作流:探索、计划、实现、提交四步;计划在方案不确定、改动跨多文件、代码不熟时最值,「如果一句话能说清那个 diff,跳过计划」。跑偏时尽早纠:Esc 打断、同一问题纠正两次仍不对就 /clear 带着教训重开。截至 2026-07-17。Claude Code Docs · Best practices — the recommended workflow: explore, plan, implement, commit; planning pays most when the approach is uncertain, the change spans files, or the code is unfamiliar — 'if you could describe the diff in one sentence, skip the plan.' Course-correct early: Esc to interrupt, and after two failed corrections on the same issue, /clear and restart with what you learned. As of 2026-07-17.改个错字还要走审批,是把仪式当成了纪律。Planning has a cost too — don't run it everywhere. The official yardstick works: uncertain approach, multi-file change, unfamiliar code — plan it; if one sentence describes the diff, just do it.2注 2Note 2Claude Code Docs · Best practices —— 推荐工作流:探索、计划、实现、提交四步;计划在方案不确定、改动跨多文件、代码不熟时最值,「如果一句话能说清那个 diff,跳过计划」。跑偏时尽早纠:Esc 打断、同一问题纠正两次仍不对就 /clear 带着教训重开。截至 2026-07-17。Claude Code Docs · Best practices — the recommended workflow: explore, plan, implement, commit; planning pays most when the approach is uncertain, the change spans files, or the code is unfamiliar — 'if you could describe the diff in one sentence, skip the plan.' Course-correct early: Esc to interrupt, and after two failed corrections on the same issue, /clear and restart with what you learned. As of 2026-07-17. Routing a typo fix through approval mistakes ceremony for discipline.
— II
再动手:权限模式定自由度Then Act: Permission Modes Set the Freedom.
批准计划后它开始动手,而「动手时哪些事要问你」由权限模式决定。六档从紧到松:After approval it starts acting — and which actions must ask you first is set by the permission mode. Six settings, tight to loose:
模式Mode
不问就能做Runs without asking
适合Best for
default
只读操作Reads only
敏感代码、刚上手Sensitive code, getting started
acceptEdits
文件编辑 + 常见文件系统命令File edits + common filesystem commands
你事后看 diff 的日常活Daily work you review by diff afterward
plan
只读操作Reads only
动手前的调研Research before touching anything
auto
几乎全部,分类器在后台拦越界Nearly everything, a classifier blocks overreach
方向可信的长任务Long tasks whose direction you trust
dontAsk
只有预批准的工具Only pre-approved tools
锁死的 CI 与脚本Locked-down CI and scripts
bypassPermissions
一切Everything
只在隔离容器 / VM 里用Isolated containers / VMs only
日常的甜点位是 acceptEdits:文件随它改,你看最终 diff —— 逐个批编辑的第十次点击之后,你其实已经不在审了。要走得更远用 auto:不是全放行,而是有一个独立的分类器在每个动作前把关,拦下越权范围、生产部署、危险删除这类动作,常规工作不再弹窗。1注 1Note 1Claude Code Docs · Permission modes —— 计划模式:让 Claude 调研、提方案,但不动手改源码;读文件、跑只读探索命令、写出计划,批准前编辑一律被挡。Shift+Tab 或 /plan 进入,Ctrl+G 在编辑器里直接改计划;批准时可选「手动逐个批」或切自动模式。模式表:default(只读免批)、acceptEdits(文件编辑与常见文件系统命令免批)、plan(只读)、auto(分类器盯着放行一切、拦越界)、dontAsk(只跑预批准项)、bypassPermissions(全放行,仅限隔离环境)。截至 2026-07-17。Claude Code Docs · Permission modes — plan mode: Claude researches and proposes without touching source; it reads files, runs read-only exploration, and writes a plan, with edits blocked until you approve. Enter via Shift+Tab or /plan, press Ctrl+G to edit the plan directly; on approval choose manual per-edit review or auto mode. The mode table: default (reads only), acceptEdits (file edits and common filesystem commands run free), plan (reads only), auto (a classifier watches everything and blocks overreach), dontAsk (pre-approved only), bypassPermissions (everything, isolated environments only). As of 2026-07-17.原则一句话:信方向,就松档;信不过的那几个点,用规矩钉死 —— 怎么钉,第 7 章的 hooks。The everyday sweet spot is acceptEdits: let it edit freely and review the final diff — by the tenth per-edit approval you weren't really reviewing anyway. To go further, use auto: not a blanket pass, but a separate classifier screening each action, blocking scope escalation, production deploys, and dangerous deletions while routine work stops prompting.1注 1Note 1Claude Code Docs · Permission modes —— 计划模式:让 Claude 调研、提方案,但不动手改源码;读文件、跑只读探索命令、写出计划,批准前编辑一律被挡。Shift+Tab 或 /plan 进入,Ctrl+G 在编辑器里直接改计划;批准时可选「手动逐个批」或切自动模式。模式表:default(只读免批)、acceptEdits(文件编辑与常见文件系统命令免批)、plan(只读)、auto(分类器盯着放行一切、拦越界)、dontAsk(只跑预批准项)、bypassPermissions(全放行,仅限隔离环境)。截至 2026-07-17。Claude Code Docs · Permission modes — plan mode: Claude researches and proposes without touching source; it reads files, runs read-only exploration, and writes a plan, with edits blocked until you approve. Enter via Shift+Tab or /plan, press Ctrl+G to edit the plan directly; on approval choose manual per-edit review or auto mode. The mode table: default (reads only), acceptEdits (file edits and common filesystem commands run free), plan (reads only), auto (a classifier watches everything and blocks overreach), dontAsk (pre-approved only), bypassPermissions (everything, isolated environments only). As of 2026-07-17. The principle in one line: trust the direction, loosen the mode; pin the few points you don't trust with rules — how to pin them is chapter 7's hooks.
— III
随时倒回:checkpoint 是你敢放手的底气Rewind Anytime: Checkpoints Are Why You Dare Let Go.
循环的最后一格是验收,而验收敢严,是因为错了能倒回。你每发一条 prompt,Claude Code 就自动存一个 checkpoint(会话保留最近 100 个);按两次 Esc 或输入 /rewind 打开菜单,可以只恢复对话、只恢复代码、或两者一起倒回任一节点,还能把跑偏的那段对话压成摘要腾出上下文。3注 3Note 3Claude Code Docs · Checkpointing —— 每条用户 prompt 自动创建一个 checkpoint,会话保留最近 100 个,checkpoint 随会话保存、续开后仍可倒回。Esc Esc 或 /rewind 打开菜单:恢复代码与对话、只恢复对话、只恢复代码、从此处起摘要、摘要至此处。界限写得明白:只追踪 Claude 文件编辑工具的改动,Bash 命令与外部修改不在内,「补充而非替代版本控制」。截至 2026-07-17。Claude Code Docs · Checkpointing — every user prompt creates a checkpoint, a session keeps the 100 most recent, and checkpoints are saved with the conversation so a resumed session can still rewind. Esc Esc or /rewind opens the menu: restore code and conversation, conversation only, code only, summarize from here, summarize up to here. The limits are stated plainly: only edits made through Claude's file-editing tools are tracked — bash commands and external changes are not — and checkpoints 'complement but don't replace' version control. As of 2026-07-17.这改变的不只是安全感,是策略:一个激进方案,试错成本从「手工收拾残局」降到「按两下 Esc」,你就敢让它先试再说。The loop's last cell is review — and review can afford to be strict because mistakes can be rewound. Every prompt you send stores a checkpoint automatically (a session keeps the last 100); double-tap Esc or type /rewind to open the menu and restore conversation only, code only, or both to any point — or compress a derailed stretch into a summary to free context.3注 3Note 3Claude Code Docs · Checkpointing —— 每条用户 prompt 自动创建一个 checkpoint,会话保留最近 100 个,checkpoint 随会话保存、续开后仍可倒回。Esc Esc 或 /rewind 打开菜单:恢复代码与对话、只恢复对话、只恢复代码、从此处起摘要、摘要至此处。界限写得明白:只追踪 Claude 文件编辑工具的改动,Bash 命令与外部修改不在内,「补充而非替代版本控制」。截至 2026-07-17。Claude Code Docs · Checkpointing — every user prompt creates a checkpoint, a session keeps the 100 most recent, and checkpoints are saved with the conversation so a resumed session can still rewind. Esc Esc or /rewind opens the menu: restore code and conversation, conversation only, code only, summarize from here, summarize up to here. The limits are stated plainly: only edits made through Claude's file-editing tools are tracked — bash commands and external changes are not — and checkpoints 'complement but don't replace' version control. As of 2026-07-17. That changes strategy, not just comfort: when the cost of a bold approach drops from cleaning up by hand to two taps of Esc, you let it try first.倒回之外还有两个更轻的纠偏动作:Esc 随时打断它、补一句再继续;同一个问题纠正两次还不对,说明上下文里已经堆满失败尝试 —— /clear 清场,把学到的教训写进新的第一句,几乎总比在旧会话里继续拉扯更快。2注 2Note 2Claude Code Docs · Best practices —— 推荐工作流:探索、计划、实现、提交四步;计划在方案不确定、改动跨多文件、代码不熟时最值,「如果一句话能说清那个 diff,跳过计划」。跑偏时尽早纠:Esc 打断、同一问题纠正两次仍不对就 /clear 带着教训重开。截至 2026-07-17。Claude Code Docs · Best practices — the recommended workflow: explore, plan, implement, commit; planning pays most when the approach is uncertain, the change spans files, or the code is unfamiliar — 'if you could describe the diff in one sentence, skip the plan.' Course-correct early: Esc to interrupt, and after two failed corrections on the same issue, /clear and restart with what you learned. As of 2026-07-17.Beyond rewinding, two lighter corrections: Esc interrupts it anytime — add a sentence and continue; and when the same issue survives two corrections, the context is piled with failed attempts — /clear the slate and fold the lesson into a fresh opening line, which almost always beats wrestling on in the old session.2注 2Note 2Claude Code Docs · Best practices —— 推荐工作流:探索、计划、实现、提交四步;计划在方案不确定、改动跨多文件、代码不熟时最值,「如果一句话能说清那个 diff,跳过计划」。跑偏时尽早纠:Esc 打断、同一问题纠正两次仍不对就 /clear 带着教训重开。截至 2026-07-17。Claude Code Docs · Best practices — the recommended workflow: explore, plan, implement, commit; planning pays most when the approach is uncertain, the change spans files, or the code is unfamiliar — 'if you could describe the diff in one sentence, skip the plan.' Course-correct early: Esc to interrupt, and after two failed corrections on the same issue, /clear and restart with what you learned. As of 2026-07-17.
— IV
循环连起来,就是最小的派活单元Closed, the Loop Is the Smallest Unit of Delegation.
把三格连起来看:计划,是你在定义这件活和它的验收标准;权限模式,是你在决定盯多紧;diff 加倒带,是你在收活。这正是第 1 章说的那个切换的最小版本 —— 你已经不是在写代码,是在派一件活、收一件活。后面的章节只是把这个循环放大:记忆让你不用每次重新交代(第 3 章),subagent 让循环并行开好几个(第 5 章),headless 让循环在没有你的地方转(第 8 章)。顺带一个第 10 章的预告:opusplan 模型档专为这个循环而设 —— 计划阶段用 Opus 想,执行阶段换 Sonnet 干。4注 4Note 4Claude Code Docs · Model configuration —— opusplan 模型别名:计划模式用 Opus,退出计划、进入执行切到 Sonnet。截至 2026-07-17。Claude Code Docs · Model configuration — the opusplan model alias: Opus during plan mode, switching to Sonnet for execution. As of 2026-07-17.Connect the three cells: the plan is you defining the job and its acceptance criteria; the permission mode is you deciding how closely to watch; diff plus rewind is you collecting the work. That's the smallest version of chapter 1's shift — you're no longer writing code, you're sending out one job and taking one back. The later chapters only scale this loop: memory spares the re-briefing (chapter 3), subagents run several loops in parallel (chapter 5), headless runs the loop where you aren't (chapter 8). And one chapter-10 preview: the opusplan model setting exists precisely for this loop — Opus to think in plan mode, Sonnet to execute.4注 4Note 4Claude Code Docs · Model configuration —— opusplan 模型别名:计划模式用 Opus,退出计划、进入执行切到 Sonnet。截至 2026-07-17。Claude Code Docs · Model configuration — the opusplan model alias: Opus during plan mode, switching to Sonnet for execution. As of 2026-07-17.动手 · 用一件真实的活跑一遍完整循环:Hands-on · run one real job through the full loop:
01
用 /plan 起手,亲手改一次计划Open with /plan, edit the plan by hand once
挑一件跨几个文件的中等改动,用上面的模板请求计划。计划出来按 Ctrl+G,至少删掉或改写其中一条 —— 感受「审方案」和「审代码」的差别。Pick a medium change spanning a few files and request a plan with the template above. When it lands, press Ctrl+G and delete or rewrite at least one item — feel the difference between reviewing an approach and reviewing code.
02
切到 acceptEdits,数你被打断几次Switch to acceptEdits and count the interruptions
批准计划后用 acceptEdits 放它做完,只在结尾看 diff。数一数这一轮你被问了几次 —— 那几次就是该进第 7 章 hooks 或权限规则的候选。After approving, let it finish in acceptEdits and read the diff only at the end. Count how many times it still asked — those are your candidates for chapter 7's hooks or permission rules.
03
故意 /rewind 一次Deliberately /rewind once
随便挑一个节点倒回代码再重做,确认这条退路真的存在。敢试的底气,来自亲手验证过的退路。Pick any point, restore the code, redo it — confirm the escape route actually exists. The nerve to experiment comes from a retreat you've tested yourself.
先批方案,再收结果,
中间的键盘留给它.
Approve the plan, collect the result —
leave the keys in between to it.
Aklman Library
— 讨论Discussion
讨论Discussion.
评论区初始化中…Initializing comments…
01 / 01
没有匹配结果No matches.
换个关键词,或按 Esc 回到页面Try another keyword, or press Esc to return