Skip to content
←INDEX / Prompt library
TUTORIAL/Claude Code/Beginner

Claude Code Plan-First: Force a Reviewable Plan Before Touching Any Code

Applies the spirit of Plan Mode so Claude Code hands over a structured plan (files affected, steps, risks, acceptance criteria) before touching any file—you review, correct, and approve it before execution begins. Prevents the AI from charging ahead and writing a pile of things you didn't want.

SakuyaPromptCraft editor · Updated 2026-06-08
TutorialClaude CodeBeginner
01PROMPT
You are operating in PLAN-FIRST mode. Do NOT edit, create, or delete any files, and do NOT run any state-changing commands until I explicitly reply with the word `APPROVE`. Read-only exploration (searching, reading files, running read-only commands) is allowed and encouraged.

TASK:
{{TASK_DESCRIPTION}}

CONSTRAINTS / CONTEXT:
{{CONSTRAINTS}}

Follow this procedure exactly.

STEP 1 — Explore (read-only):
- Inspect the relevant parts of the codebase before proposing anything. Identify the existing patterns, conventions, and the files most likely involved.
- If a CLAUDE.md / AGENTS.md or similar project guide exists, respect it.
- If anything about the task is ambiguous, list your open questions at the TOP of your response. Make your best assumption for each, label it clearly as an ASSUMPTION, and continue — do not stall waiting for me.

STEP 2 — Produce the PLAN. Output these sections, in order:
1. **Goal restated** — one or two sentences, in your own words, describing what 'done' means.
2. **Files to touch** — a bullet list. For each file: the exact path, and whether it is CREATE / MODIFY / DELETE, plus a one-line reason. If you are unsure a file exists, say so.
3. **Implementation steps** — an ordered list of small, individually reviewable steps. Each step should be something I could verify on its own.
4. **Risks & blast radius** — what could break, what existing behavior this might affect, any migration/data/security/backward-compat concern. Be honest; if you are not sure, say 'uncertain'.
5. **Out of scope** — explicitly list things you will NOT do, so we agree on boundaries.
6. **Acceptance criteria** — a concrete checklist (commands to run, expected outputs, behaviors to observe) that proves the change works. Prefer criteria I can verify mechanically (a test passing, a command exiting 0, a specific UI state).

STEP 3 — Stop and wait.
End your response with: 'Reply APPROVE to execute, or tell me what to change in the plan.'

Rules:
- Keep the plan tight. No filler, no 'as an AI' preamble.
- Do not start implementing in the same message as the plan.
- If after my feedback the plan changes materially, re-print the full updated plan and wait for APPROVE again.
- When I finally reply APPROVE, execute the plan step by step, and after each major step state which acceptance criterion it satisfies.

Swap the variables inside the [ ] brackets for your own content, then paste into Claude Code.

◆ Open in toolClaude (paste it)
RUNTRY IT
▶ TRY IT ON-SITE

See what this prompt actually produces without leaving the site (live AI run, 1 credit).

SKILLINSTALL AS SKILL
INSTALL AS SKILLClaude Code Agent Skill

Don't just copy-paste — download and drop it at ~/.claude/skills/plan-first-spec-gate/SKILL.md and every future session can use it automatically.

macOS / Linux
mkdir -p ~/.claude/skills/plan-first-spec-gate && mv ~/Downloads/SKILL.md ~/.claude/skills/plan-first-spec-gate/SKILL.md
Windows PowerShell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.claude\skills\plan-first-spec-gate" | Out-Null; Move-Item "$env:USERPROFILE\Downloads\SKILL.md" "$env:USERPROFILE\.claude\skills\plan-first-spec-gate\SKILL.md"
02CONTEXT / Why it works

When to use: Any task that 'touches 3+ files, changes a schema, involves security/payments, or where you don't fully trust the AI's direction yet.' Don't use it for a small single-file edit or a pure lookup—that's just wasted time. Why it works: This maps directly onto Claude Code's real Plan Mode (enter with Shift+Tab twice, or type /plan; added January 2026), whose core principle is 'Claude writes a plan document before touching any file, and you review it before execution.' Both the official team and the community point to this as the workflow that 'blocks 90% of AI coding mistakes,' because reviewing a block of text is far cheaper than reviewing a pile of already-written diffs. Tips: (1) Name the files you expect to be changed directly inside {{TASK_DESCRIPTION}} (e.g., 'edit Hero.tsx, add WaitlistForm.tsx')—plan quality improves noticeably. (2) Even if you're not using this exact prompt, it's still worth pairing it with actually pressing Shift+Tab twice to enter Plan Mode. (3) The 'Out of scope' section is the key defense against the AI gold-plating on its own initiative—don't delete it. (4) Before approving, actually read the 'Risks & blast radius' and 'Files to touch' sections—these two are where wrong direction shows up most often.

03SAMPLE / Expected result

Open questions: - Q: 新表單送出後要寫進現有的 /api/waitlist 還是新端點? ASSUMPTION: 沿用現有 /api/waitlist。 **Goal restated:** 在首頁 Hero 下方加一個 email 候補表單,送出後寫入既有 waitlist API。 **Files to touch:** - `app/page.tsx` — MODIFY — 在 Hero 後掛入 <WaitlistForm/> - `components/WaitlistForm.tsx` — CREATE — 表單 UI + 送出邏輯 **Implementation steps:** 1. 建 WaitlistForm 元件(含 loading/error/success 三態) 2. 接 /api/waitlist,沿用既有回傳格式 3. 掛進 page.tsx Hero 下方 **Risks & blast radius:** 低。只新增元件 + 一處掛載,不動既有 API。若 /api/waitlist 預期欄位不同會 400(uncertain,需確認)。 **Out of scope:** 不做 email 驗證信、不改資料庫 schema。 **Acceptance criteria:** - [ ] `npm run build` exit 0 - [ ] 輸入 email 送出 → 顯示成功態 - [ ] 空白送出 → 顯示 inline 錯誤 Reply APPROVE to execute, or tell me what to change in the plan.

A description of the intended result. Check this entry's testing notes and try the prompt with your own inputs.

04VARIABLES
01[TASK_DESCRIPTION]

你要做的事,越具體越好;建議直接點名你預期會改到的檔案路徑

02[CONSTRAINTS]

限制與背景:技術棧、不可破壞的東西、相依服務、風格慣例、效能/安全要求等

05RESOLVER · 變數代入器0 / 2

填下面的欄位,上方 prompt 會即時替換 [方括號] 內容。填好後按「複製組好的 prompt」直接丟進工具。

修飾
Assembled · 填剩餘變數…
You are operating in PLAN-FIRST mode. Do NOT edit, create, or delete any files, and do NOT run any state-changing commands until I explicitly reply with the word `APPROVE`. Read-only exploration (searching, reading files, running read-only commands) is allowed and encouraged.

TASK:
{{TASK_DESCRIPTION}}

CONSTRAINTS / CONTEXT:
{{CONSTRAINTS}}

Follow this procedure exactly.

STEP 1 — Explore (read-only):
- Inspect the relevant parts of the codebase before proposing anything. Identify the existing patterns, conventions, and the files most likely involved.
- If a CLAUDE.md / AGENTS.md or similar project guide exists, respect it.
- If anything about the task is ambiguous, list your open questions at the TOP of your response. Make your best assumption for each, label it clearly as an ASSUMPTION, and continue — do not stall waiting for me.

STEP 2 — Produce the PLAN. Output these sections, in order:
1. **Goal restated** — one or two sentences, in your own words, describing what 'done' means.
2. **Files to touch** — a bullet list. For each file: the exact path, and whether it is CREATE / MODIFY / DELETE, plus a one-line reason. If you are unsure a file exists, say so.
3. **Implementation steps** — an ordered list of small, individually reviewable steps. Each step should be something I could verify on its own.
4. **Risks & blast radius** — what could break, what existing behavior this might affect, any migration/data/security/backward-compat concern. Be honest; if you are not sure, say 'uncertain'.
5. **Out of scope** — explicitly list things you will NOT do, so we agree on boundaries.
6. **Acceptance criteria** — a concrete checklist (commands to run, expected outputs, behaviors to observe) that proves the change works. Prefer criteria I can verify mechanically (a test passing, a command exiting 0, a specific UI state).

STEP 3 — Stop and wait.
End your response with: 'Reply APPROVE to execute, or tell me what to change in the plan.'

Rules:
- Keep the plan tight. No filler, no 'as an AI' preamble.
- Do not start implementing in the same message as the plan.
- If after my feedback the plan changes materially, re-print the full updated plan and wait for APPROVE again.
- When I finally reply APPROVE, execute the plan step by step, and after each major step state which acceptance criterion it satisfies.
RELATED
PRO01
TUTORIALSuno v5.5FEATURED
r/SunoAI (anonymous studio engineer)2026-06-12

Suno Engineer's Mindset: 4 Steps to a Song That Doesn't Sound Like AI

5.0(1)

A studio engineer's breakdown of Suno's fatal weaknesses (fried vocals, high-frequency artifacts), plus a 4-step DAW workflow and a Suno Studio cleanup prompt.

Advanced
Read

Free02
TUTORIALClaude 4.5 SonnetFEATURED
r/ClaudeAI2026-05-14

5 Claude Weekly Workflows That Stuck After 6 Months

Proposal generator / meeting processor / content repurposer / Friday review / shutdown reset — out of 40 I tried, only these 5 survived, each saving 30+ minutes per run.

Intermediate
Read

PRO03
TUTORIALClaude 4.5 SonnetFEATURED
r/PromptEngineering2026-05-14

7 Cross-Model A/B-Tested Prompt Techniques (Not Vibes)

Written after six months of A/B testing 200+ prompts on Claude, GPT-4, and Gemini with human raters. Covers persona + constraint stacking, anti-examples, role-reversal QA, cognitive scaffolds, emotional priming, uncertainty CoT, and steelman-first.

Advanced
Read

Free04
TUTORIALChatGPTFEATURED
r/ChatGPTPromptGenius2026-05-14

5 trust-checking one-liner prompts (no role-play)

After a year of role-play system prompts and 14-step frameworks, here's the takeaway: the thing that actually moved the needle on quality was 5 one-line prompts. No roles, no markdown, no "you are an expert."

Beginner
Read

COMMENTS · 討論區0 則
登入 後可留言。還沒帳號?註冊
目前沒有留言。第一個說說你的經驗。