Claude Code Plan Mode의 계획을 코드와 대조하는 plan-check 스킬

Dmitriy Solodukha, Caprock 개발자 · 게시일

Claude Code와 Codex에서 테스트

Claude Code의 Plan Mode는 승인 전까지 수정을 막습니다. plan-check 스킬은 계획에 담을 내용을 추가하고, 먼저 모든 줄을 코드와 대조해 확인합니다.

Claude Code의 Plan Mode는 계획을 승인할 때까지 에이전트의 수정을 막습니다. plan-check 스킬은 계획에 담을 내용을 정하고 첫 수정 전에 코드와 대조해 검증합니다. 에이전트는 파일, 단계, 검증 방법, 위험, 하지 않을 일을 작성한 다음, 도구 호출로 각 줄을 확인하고 잘못된 내용을 고친 뒤에야 코드를 변경합니다. 계획 모드가 없는 에이전트에서는 스킬의 중단 또는 진행 판단 단계가 관문 역할을 합니다.

plan-check 스킬 설치

에이전트마다 명령어 하나로 설치합니다. 스킬은 SKILL.md 파일 하나이며, 설치 시 실행되는 것은 없습니다.

스킬 아홉 가지 전체를 플러그인으로 설치합니다. Claude Code 안에서 다음을 입력합니다:

이 스킬만 설치하려면 터미널에서 프로젝트 폴더로 이동한 뒤 다음을 실행합니다:

추가 옵션: -g 모든 프로젝트에 설치하려면 앞의 옵션을 추가합니다.

plan-check 스킬을 사용하는 프롬프트

요청이 스킬 설명과 일치하면 에이전트가 해당 스킬을 선택합니다. 이름을 명시하면 확실하게 선택할 수 있습니다. 프롬프트를 클릭하면 복사됩니다.

plan-check가 Claude Code Plan Mode에 추가하는 기능

Claude Code의 Plan Mode는 “아직 편집하지 않기”를 강제합니다. 에이전트는 읽고 탐색한 뒤 계획을 작성하고 승인을 기다립니다. 좋은 계획에 무엇이 들어가야 하는지 정하거나 검증하지는 않습니다. 이 스킬은 다음을 수행합니다.

  • 계획 전 읽기: 변경할 파일, 해당 파일의 호출부, 테스트와 프로젝트의 테스트 실행 방법, 프로젝트의 에이전트 지침, 이전 결정.
  • 다섯 부분으로 구성된 계획: 파일(실제 경로), 단계(각각 검증할 수 있을 만큼 작은 단계), 검증(이 프로젝트에 실제로 존재하는 명령), 위험 요소, 그리고 절대 비워 두지 않는 제외 사항.
  • 한 줄씩 검증: 각 파일의 존재 여부, 각 이름이 코드와 동일하게 표기되었는지, 모든 호출부가 포함되었는지, 검증 명령이 실행되는지, 프로젝트의 규칙과 결정 사항이 지켜지는지 확인합니다. 각 줄은 OK, FIXED, OPEN 중 하나로 마무리합니다.
  • 중단 또는 진행: OPEN 상태의 질문, 번복된 결정, 삭제된 데이터가 있으면 멈추고 사용자에게 질문합니다. 그 외에는 계획을 실행하고 보고합니다.

Plan Mode에서는 둘을 함께 사용합니다. 승인하기 전에 plan-check 형식으로 계획을 작성하고 검증해 달라고 요청합니다.

실행한 내용과 에이전트의 수행 결과

각 스킬은 2026년 11월 29일에 전용 임시 저장소에 프로젝트 스킬로 설치하여 실행했습니다. 작은 Python 저장소로, src/prices.py에 format_price가 있고 cart_total과 receipt_line에서 호출하며 make test로 테스트를 실행하는 구성입니다.

Claude Code (claude -p --model sonnet)

Plan first, then do it: format_price should take a currency code (USD default, EUR uses the euro sign after the number). Do not touch anything until the plan is checked.

두 차례 실행했습니다. 둘 다 plan-check를 호출하고 파일과 이를 호출하는 코드를 읽고 Caprock의 current_decisions를 호출한 뒤(한 실행에서는 권한이 거부됐으며 이를 밝혔습니다), 알 수 없는 코드를 위한 ValueError를 포함한 currency="USD"와 새로운 tests/test_prices.py를 추가했습니다. make test는 7개 중 7개가 통과했습니다. 최종 보고서는 변경하지 않은 사항을 나열했습니다. cart_total과 receipt_line은 여전히 달러를 출력하며, 음수 금액은 이미 잘못된 형식으로 표시되고 있었지만(-5의 결과가 $-1.95) 변경하지 않았습니다.

Codex (0.163.0, codex exec)

The same prompt.

.agents/skills/plan-check/SKILL.md를 읽고 스킬의 다섯 섹션에 맞춰 계획을 작성했습니다(current_decisions 호출은 실패했습니다). 코드와 대조해 확인한 뒤 수정했습니다(두 호출부 모두 기본값인 USD에 의존하며, make -n test로 검증 명령어를 확인했습니다). 보고 내용은 다음과 같습니다(빈 줄과 마지막 문장 생략):

Implemented after checking the plan.
- `format_price(150)` → `$1.50`
- `format_price(150, "EUR")` → `1.50€`
- Unsupported codes raise `ValueError`.
All 6 tests pass; `git diff --check` passes. No deviations from the plan.

테스트한 에이전트

  • Claude Code: .claude/skills/에 프로젝트 스킬로 설치한 상태에서 2026년 11월 29일에 claude -p --model sonnet으로 테스트했습니다.
  • Codex: 2026년 11월 29일에 Codex 0.163.0(codex exec)로 테스트했으며, 스킬은 .agents/skills/에 설치했습니다.
  • OpenCode와 Cursor: 테스트하지 않았습니다. 스킬은 공개 Agent Skills 형식의 일반 지침이지만, 어느 쪽에서도 실행하여 확인하지 않았습니다.

한도

  • 계획 모드가 없는 에이전트에는 “아직 수정하지 말 것”을 강제하는 장치가 없습니다. 스킬의 중단 또는 진행 판단 단계는 지시일 뿐, 제어 스위치가 아닙니다.
  • 검증의 정확도는 에이전트의 검색에 달려 있습니다. 리플렉션이나 문자열을 통해 연결된 호출자는 놓칠 수 있습니다.
  • 한 줄 수정이라면 계획이 필요 없다고 알리고 스킬을 건너뜁니다.

Caprock을 사용할 때와 사용하지 않을 때

Caprock MCP 서버가 연결되어 있으면 스킬은 current_decisions를 호출하여 변경 시 따라야 할 이전 결정을 찾습니다. 연결되지 않았으면 같은 파일에 관한 결정 기록과 최근 커밋 메시지를 찾습니다. Caprock은 컴퓨터의 모든 코딩 에이전트 세션을 기록하는 무료 오픈 소스 앱입니다. 스킬의 다른 기능에는 Caprock이 필요하지 않습니다.

Caprock 다운로드 →

SKILL.md 전문

dspv/skills의 리비전 dfce799에 있는 파일 그대로입니다. 수동으로 설치하려면 프로젝트 안에 Claude Code용은 .claude/skills/plan-check/SKILL.md, Codex용은 .agents/skills/plan-check/SKILL.md로 저장합니다.

skills/plan-check/SKILL.md
---
name: plan-check
description: >
  Write a short plan before changing code (files to touch, steps, how the change will be verified,
  risks, what will not be done), then check every line of that plan against the actual code before
  the first edit. Use when the user says "plan first", "make a plan before you code", "plan mode",
  "claude code plan mode", "think before editing", "don't touch anything yet", or asks for a change
  that spans several files, a refactor, a migration, or anything hard to undo. Works in any coding
  agent; in Claude Code, plan mode is the built-in equivalent.
license: Apache-2.0
---

# Plan, check, then change

A plan written from memory of the code is a guess. This skill makes the agent write the plan down,
check it against the files as they are, fix what the check finds, and only then edit.

## When to use it, and when not

Use it before any change that touches more than one file, changes a public interface, moves data,
or is hard to undo, and whenever the user asks for a plan first.

Skip it for a one-line fix the user has already located, a typo, or a question that needs no edit.
Say in one line that no plan is needed and why.

## Step 1: Read before you plan

Read the code the change will touch before writing a word of the plan:

- the files you expect to edit, and their callers (search for each function, type, route or
  config key you will change);
- the tests that cover them, and how the project runs its tests (README, Makefile,
  package.json scripts, CI config);
- the project's agent instructions (CLAUDE.md, AGENTS.md or similar) for rules the change must keep.

**Earlier decisions.** If the Caprock MCP tool `current_decisions` is available, call it (it takes an
optional `project`, the repository folder's name, and `limit`) and keep the decisions that touch this
change. Without it, look for decision records in the repository (ADRs, a `docs/` decisions file,
recent commit messages on the same files with `git log --oneline -- <path>`). A plan that reverses an
earlier decision says so in Risks and asks the user. Caprock (https://caprock.dev, free, open source,
runs locally) provides that tool; nothing else here needs it.

## Step 2: Write the plan

Keep it short: a reviewer should read it in under a minute. Use exactly these sections.

```markdown
## Plan: <one-line goal>

**Files**
- `path/to/file.ext`: what changes (new function, edited block, deleted)
- `path/to/new_file.ext` (new): what it holds

**Steps**
1. <smallest step that leaves the code working>
2. ...

**Verify**
- `<exact command>`: what passing looks like
- <manual check, if a command cannot show it>

**Risks**
- <what could break, who calls it, what data it touches>

**Not doing**
- <tempting work left out of scope: refactors, renames, upgrades, unrelated fixes>
```

Rules for the plan:

- Every file is a real path. Every function, flag or command is named exactly as it appears in code.
- Each step is small enough to verify on its own; order steps so the code builds after each.
- Verify names commands that exist in this project, not generic ones.
- Not doing is never empty: name at least one thing you will deliberately leave alone.

## Step 3: Check the plan against the code

Go through the plan line by line and confirm each claim with a tool call (read, search, run), not
from memory:

| Check           | How                                                                |
| --------------- | ------------------------------------------------------------------ |
| Files exist     | List or read each path; a "(new)" path must not exist yet          |
| Names are right | Search each function, type, key; note its exact signature          |
| Callers covered | Search every use of what changes; each caller is in Files or Risks |
| Verify runs     | The test or build command exists (script, target, binary)          |
| Rules kept      | Compare steps with the project's agent instructions                |
| Decisions kept  | Compare with the decisions found in Step 1                         |

Then add a short block under the plan:

```markdown
**Check**
- OK: <claim confirmed, with the file or command that showed it>
- FIXED: <claim that was wrong, and what the plan says now>
- OPEN: <question only the user can answer>
```

If a check fails, fix the plan and re-check that line. Do not start editing with a FIXED line you
have not re-checked.

## Step 4: Stop or go

- **Stop and ask** when there is an OPEN line, when the plan reverses an earlier decision, when it
  deletes data or files the user did not mention, or when the check found the task is much larger
  than the user described. Show the plan and the Check block, ask the open questions, and wait.
- **Go** when every line is OK or a re-checked FIXED, and the user asked you to do the work (not
  only to plan). If the user asked only for a plan, stop after the Check block.

## Step 5: Carry out the plan

- Follow the steps in order. Run the Verify commands at the end, and after any step that names its own
  check.
- If the code turns out different from the plan (a caller you missed, a test that does not exist),
  stop editing, update the plan and the Check block, and decide stop or go again. Do not drift.
- Touch nothing listed under Not doing.

## Step 6: Report

Always end with this report, in this shape, even when the change is small: it is how the user
sees whether the plan held.

```markdown
**Done**: <goal>
- Changed: `path` (what), ...
- Verify: `<command>`: <result, pasted or summarized>
- Differed from plan: <what and why, or "nothing">
- Left out: <the Not doing list, and anything found along the way>
```

## Plan mode in Claude Code

Claude Code has a built-in plan mode: Claude reads files and runs commands to explore, writes a plan,
and makes no edits until you approve it (Claude Code docs, permission modes page, read 2026-11-29).
Ways in:

- press `Shift+Tab` until the status bar shows plan mode on, or prefix a single prompt with `/plan`;
- start the session with `claude --permission-mode plan`;
- make it the project default with `"permissions": { "defaultMode": "plan" }` in `.claude/settings.json`.

At the approval prompt you can approve, keep planning, or press `Ctrl+G` to edit the plan in your
editor. Plan mode enforces "no edits yet"; this skill adds what to put in the plan and the check
against the code. Use both: in plan mode, write the plan in Step 2's format and run Step 3 before
asking for approval. In an agent without a plan mode, the skill's Stop or go step is the gate.

plan-check 스킬 관련 질문

Claude Code Plan Mode는 어떻게 켜나요?
상태 표시줄에 Plan Mode가 표시될 때까지 `Shift+Tab`을 누르거나, 프롬프트 하나의 앞에 `/plan`을 붙이거나, `claude --permission-mode plan`으로 시작합니다. 기본값으로 설정하려면 `.claude/settings.json`에서 `"permissions": { "defaultMode": "plan" }`을 설정합니다.
plan-check 스킬은 Plan Mode에 무엇을 추가하나요?
계획 내용과 검증을 모두 다룹니다. 다섯 개의 고정 섹션으로 계획을 작성한 뒤, 승인 전에 도구 호출로 모든 줄을 코드와 대조합니다. 잘못된 줄은 수정하고 미해결 사항은 질문합니다.
계획 검증 스킬이 Codex에서도 작동하나요?
네. 스킬의 중단 또는 진행 단계가 관문 역할을 합니다. Codex 0.163.0은 2026년 11월 29일 테스트에서 계획, 검증, 편집 순서로 이를 따랐습니다.
오타 수정에도 계획을 작성하나요?
아니요. 이미 위치를 찾은 한 줄 수정이나 오타 수정, 질문에는 계획이 필요 없다는 점과 그 이유를 한 줄로 설명합니다.

출처

앱 자체는 영어로 되어 있습니다.