Chapter 22

Claude Code: Run the Explore, Plan, Implement, Commit Loop

The official Claude Code guide recommends giving a verification signal and separating research, planning, and implementation. Plan mode is especially useful for multi-file changes and unfamiliar code, but excessive for an obvious triviality.

The starting commands set the mode right away.

Bash
# Interactive session in the current repository
claude

# Start directly in plan permission mode
claude --permission-mode plan

The four phases of the official workflow go in order: explore (Claude reads files and answers without changing), plan (names files, flow, and the sequence; the plan can be opened in the editor), implement (exits plan mode, writes code, and checks it), and commit (commit or PR as a separate explicit request after review).

Anthropic puts the key rule first: give a test, build, linter, fixture diff, or screenshot the agent can read. Without such a signal Claude stops when the work looks done; with it, it can read the failure and fix the result. A practical prompt puts that into shape.

Read src/discount.js and tests/discount.test.js.
First reproduce the percentage bug. Do not edit until you can explain the unit mismatch.
Create a short plan limited to src/discount.js.
Then implement the smallest patch, run the focused test and npm run check.
Report changed files, commands, exit codes, and any remaining risk.
The context window is a resource. The official documentation warns that performance degrades as context fills. Long research, huge logs, and repeated file copying reduce the room for the solution. Use focused searches, summaries, and a new context for the independent review.

The loop is clear. Now let's configure Claude Code's persistent surfaces: CLAUDE.md, path-scoped rules, and skills.

Links