Plan Mode in Claude Code, am Code geprüft: der plan-check-Skill

Dmitriy Solodukha, Caprock-Entwickler · Veröffentlicht am

Am mit Claude Code und Codex getestet

Der Plan Mode in Claude Code verhindert Änderungen bis zu deiner Freigabe. Der plan-check-Skill legt den Planinhalt fest und prüft zuerst jede Zeile am Code.

Der Plan Mode in Claude Code verhindert Änderungen durch den Agenten, bis du einen Plan freigibst; der plan-check-Skill legt dessen Inhalt fest und prüft ihn vor der ersten Änderung am Code. Der Agent schreibt Dateien, Schritte, Prüfverfahren, Risiken und was er nicht tun wird auf, bestätigt dann jede Zeile mit einem Tool-Aufruf, korrigiert Fehler und ändert erst danach Code. Bei einem Agenten ohne Plan Mode ist der Stop-or-Go-Schritt des Skills die Freigabeschranke.

Installiere den plan-check-Skill

Ein Befehl pro Agent. Der Skill ist eine einzelne SKILL.md; bei der Installation wird nichts ausgeführt.

Alle neun Skills als Plugin. Gib dies in Claude Code ein:

Oder nur diesen Skill, im Projektordner in einem Terminal:

Füge -g hinzu, um ihn für jedes Projekt zu installieren.

Prompts für den plan-check-Skill

Der Agent wählt den Skill, wenn deine Worte zu dessen Beschreibung passen; mit dem Namen stellst du es sicher. Klicke auf einen Prompt, um ihn zu kopieren.

Was plan-check zum Plan Mode in Claude Code ergänzt

Plan Mode in Claude Code erzwingt „noch keine Änderungen“: Der Agent liest und erkundet, schreibt einen Plan und wartet auf deine Freigabe. Er legt weder den Inhalt eines guten Plans fest noch prüft er ihn. Das übernimmt der Skill:

  • Vor dem Planen lesen: die zu ändernden Dateien, ihre Aufrufer, die Tests und deren Ausführung im Projekt, die Agentenanweisungen des Projekts und frühere Entscheidungen.
  • Ein Plan in fünf Abschnitten: Files (echte Pfade), Steps (jeweils klein genug zum Prüfen), Verify (in diesem Projekt vorhandene Befehle), Risks und Not doing, das niemals leer bleibt.
  • Eine Prüfung, Zeile für Zeile: Jede Datei existiert, jeder Name ist wie im Code geschrieben, jeder Aufrufer ist berücksichtigt, der Prüfbefehl läuft, die Regeln und Entscheidungen des Projekts gelten weiterhin. Jede Zeile endet mit OK, FIXED oder OPEN.
  • Stoppen oder fortfahren: Eine OPEN-Frage, eine umgekehrte Entscheidung oder gelöschte Daten stoppen ihn, und er fragt dich. Andernfalls führt er den Plan aus und berichtet.

Nutze im Plan Mode beides: Verlange den Plan im Format von plan-check samt Prüfung, bevor du ihn freigibst.

Was wir ausgeführt haben und was die Agenten taten

Jeder Skill wurde am 29. November 2026 in einem eigens dafür angelegten Wegwerf-Repository ausgeführt und als Projekt-Skill installiert. Ein kleines Python-Repository: format_price in src/prices.py, aufgerufen von cart_total und receipt_line, mit Tests über 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.

Zwei Läufe. Beide riefen plan-check auf, lasen die Dateien und ihre Aufrufer, riefen Caprocks current_decisions auf (einem Lauf wurde die Berechtigung verweigert, was er angab) und ergänzten dann currency="USD" mit einem ValueError für unbekannte Codes und einer neuen tests/test_prices.py. make test bestand, 7 von 7. Der Abschlussbericht listete auf, was unangetastet blieb: cart_total und receipt_line geben weiterhin Dollar aus, und negative Beträge waren bereits falsch formatiert (-5 ergab $-1.95) und wurden nicht geändert.

Codex (0.163.0, codex exec)

The same prompt.

Las .agents/skills/plan-check/SKILL.md, schrieb den Plan in den fünf Abschnitten des Skills (sein current_decisions-Aufruf scheiterte), prüfte ihn am Code (beide Aufrufer verlassen sich auf den USD-Standard; make -n test bestätigte den Prüfbefehl) und bearbeitete dann. Sein Bericht (Leerzeilen und letzter Satz ausgelassen):

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.

Agenten, mit denen er getestet wurde

  • Claude Code: am 29. November 2026 mit claude -p --model sonnet getestet, der Skill als Projekt-Skill in .claude/skills/ installiert.
  • Codex: am 29. November 2026 mit Codex 0.163.0 (codex exec) getestet, der Skill in .agents/skills/.
  • OpenCode und Cursor: nicht getestet. Der Skill besteht aus reinen Anweisungen im offenen Agent-Skills-Format, wurde aber mit keinem der beiden erprobt.

Grenzen

  • Bei einem Agenten ohne Plan Mode erzwingt nichts „noch keine Änderungen“: Der Stop-or-Go-Schritt des Skills ist eine Anweisung, kein Schalter.
  • Die Prüfung ist so gut wie die Suche des Agenten: Ein Aufrufer, der über Reflection oder einen String erreicht wird, kann übersehen werden.
  • Bei einer einzeiligen Korrektur erklärt er, dass kein Plan nötig ist, und überspringt sich selbst.

Mit und ohne Caprock

Wenn der Caprock-MCP-Server verbunden ist, ruft der Skill current_decisions auf, um frühere Entscheidungen zu finden, die bei der Änderung zu beachten sind. Ohne ihn sucht er Entscheidungsprotokolle und aktuelle Commit-Nachrichten zu denselben Dateien. Caprock ist die kostenlose Open-Source-App, die jede Coding-Agent-Session auf deinem Computer aufzeichnet; sonst braucht nichts im Skill die App.

Caprock holen →

Die vollständige SKILL.md

Die Datei aus dspv/skills in Revision dfce799. Zur manuellen Installation speicherst du sie in deinem Projekt als .claude/skills/plan-check/SKILL.md für Claude Code oder .agents/skills/plan-check/SKILL.md für Codex.

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.

Fragen zum plan-check-Skill

Wie aktiviere ich den Plan Mode in Claude Code?
Drücke `Shift+Tab`, bis die Statusleiste Plan Mode zeigt, stelle einem Prompt `/plan` voran oder starte mit `claude --permission-mode plan`. Für die Standardeinstellung setze `"permissions": { "defaultMode": "plan" }` in `.claude/settings.json`.
Was ergänzt der plan-check-Skill zum Plan Mode?
Inhalt und Prüfung: ein Plan in fünf festen Abschnitten, dann jede Zeile vor deiner Freigabe mit einem Tool-Aufruf am Code bestätigt, falsche Zeilen korrigiert und offene Fragen gestellt.
Funktioniert ein plan-check-Skill in Codex?
Ja. Der Stop-or-Go-Schritt des Skills ist die Freigabeschranke. Codex 0.163.0 befolgte ihn im Test vom 29. November 2026: planen, prüfen, dann bearbeiten.
Plant er die Korrektur eines Tippfehlers?
Nein. Bei einer bereits lokalisierten einzeiligen Korrektur, einem Tippfehler oder einer Frage sagt er in einer Zeile, dass kein Plan nötig ist und warum.

Quellen

Die App selbst ist auf Englisch.