只在適合的問題進入 Plan Mode
需求不清、architecture change、migration 或 blast radius 廣的工作適合先規劃。單一路徑的 typo fix 或 read-only investigation 通常不需要這套流程。
可用 /plan 進入、在同一 command 加上 task description,或透過 Shift+Tab 切換 mode。要求 agent 先找出 unknowns 並探索 repository,再做設計決定。
/plan
/plan Migrate authentication to rotating JWTs without changing the public API. 把 plan 當成可審查 artifact
即使在 auto 或 always-approve 下,preview 仍不會被跳過。對選取行或範圍 comment、要求修改,只有 sequence 與 proof 可信時才核准。
使用 /view-plan 可重新打開已保存 preview。適用時,plan 應暴露 affected files、data migration、compatibility risk、tests、observability 與 rollback。
- a:核准並開始建置。
- s:要求修改。
- c:對選取行或範圍註解。
- q:不執行並離開 Plan Mode。
/view-plan 理解閘門沒有擋住什麼
核准前,edit tools 只能編輯 session plan file;reads、bash 與 MCP 仍依 active permission mode 運作,而且 shell redirection 仍可能寫檔。因此 Plan Mode 不是 security sandbox。
Parent 的 Plan Mode 也不會 edit-gate subagent,雖然 child 會繼承 permission mode。敏感 repository 應結合窄權限、sandbox 與明確禁止 mutation 的 instruction。
- 規劃前後都檢查 git status。
- 不要因 edit 被限制就給 shell 廣泛權限。
- 核准後再次審查 diff。