Prompt Recipes
A single prompt is a sentence. A recipe is a few of them in an order that works for one common job: understanding a new repository, planning a change safely, debugging from evidence, reviewing a diff, or learning a stack from one you know. Each recipe below was run through Claude Code on a real project, and the result is shown with an honest check. At the end is a builder that lets you assemble your own prompt from the library.
Why Order Matters
The blocks from Chapter 15 can go in any order, but a reliable pattern has emerged in the recipes below. This is the author's pattern, not an Anthropic rule. Anthropic's pages recommend the same ingredients (specific scope, a way to verify, plan before code) without prescribing an order (Source 1).
- Limits first, because they are the instructions you least want Claude to miss.
- The check last, so it is the freshest thing in the prompt when Claude writes its answer.
- Same blocks, different jobs. Recipe 1 and Recipe 4 are both read-only; what changes is the task block and the format block.
claude -p), where there is nobody to reply, so the run simply ended after the plan. In an interactive session you would read the plan and answer. The result is the same safe state: nothing changed.The Recipes
Understand an unfamiliar repository R-01
Situation: First day on a codebase you did not write.
| Block | What it contributes |
|---|---|
| EXP-01 | Codebase overview |
| AUD-01 | Like a novice developer |
| EXP-04 | Riskiest parts |
| VER-03 | Verified vs assumed |
Why this order: EXP-01 gives the map, AUD-01 turns it into plain words, EXP-04 shows where the danger is, VER-03 separates what Claude checked from what it assumed. Read-only is already built into EXP-01 and EXP-04.
Real sample: what Claude answered (Checked)
Plan a safe change R-02
Situation: You want to add something and you want to approve the plan before any file changes.
| Block | What it contributes |
|---|---|
| your words | Your own line: “I want to add a DELETE /api/books/{id} endpoint to this project.” |
| THK-01 | List assumptions |
| CTL-04 | Stay in scope |
| CTL-02 | Plan, then wait |
| VER-01 | Show the evidence |
Why this order: A context line says what you want; THK-01 surfaces assumptions; CTL-04 keeps the diff small; CTL-02 makes Claude stop and wait; VER-01 says how the result must be proven.
Real sample: what Claude answered (Checked)
Debug from a stack trace R-03
Situation: You have an error and no idea where to start.
| Block | What it contributes |
|---|---|
| DBG-01 | Hypotheses, not fixes |
| your words | Your own line: “Check each hypothesis against the project files before you rank it.” |
| DBG-06 | Cause, not symptom |
Why this order: DBG-01 forces hypotheses before fixes, a context line tells Claude to check them against the real files, and DBG-06 pushes past the symptom to the cause.
Real sample: what Claude answered (Checked)
Review a change R-04
Situation: Before merging a feature you or an agent wrote.
| Block | What it contributes |
|---|---|
| ROL-01 | Strict reviewer |
| FMT-01 | As a table |
| VER-03 | Verified vs assumed |
Why this order: ROL-01 sets the reviewer stance (and tells it to skip style), FMT-01 makes the findings comparable in a table, VER-03 exposes what the review did not check.
Real sample: what Claude answered (Partly correct)
Learn a new framework from what you know R-05
Situation: You are fluent in one stack and new to another.
| Block | What it contributes |
|---|---|
| AUD-03 | Map to what I know |
| LRN-02 | Three steps with exercises |
Why this order: AUD-03 bridges from the stack you know and makes Claude say where the analogy breaks; LRN-02 turns the answer into a short guided lesson.
Real sample: what Claude answered (Checked)
The Prompt Builder
Pick a recipe to start from, or add blocks one by one. Edit any line, reorder, and fill the {placeholders}. The text at the bottom is your prompt. Everything runs in your browser; nothing is sent anywhere.
Key Takeaways, Exercises and Sources
- A recipe is blocks in an order: limits, context, task, format, check.
- Stale evidence gets an honest answer if you ask for hypotheses. In Recipe 3 the pasted stack trace no longer matched the code; Claude said so instead of inventing a cause.
- Plan-first prompts are cheap insurance. Recipe 2 changed nothing and listed an assumption it had not verified.
- Read-only reviews read the source, they do not run the app. Reproduce a finding before you act on it.
- Write down recipes that work for your own repository, with the blocks and fills you used.
Exercise 1 Beginner
Load Recipe 1 in the builder, replace the first line with your own project's description, and run it read-only on a repository you did not write. Note one thing in the answer you did not know.
Learning outcome: use a recipe on unfamiliar code.
Exercise 2 Intermediate
Build a recipe for a job you do every week (for example "summarise a pull request for a non-technical reader"). Run it three times. Which block changed the answer most? Remove it and compare.
Learning outcome: learn what each block is worth.
Exercise 3 Advanced
Take Recipe 3 and feed it a stack trace that does match your current code. Then feed it one that is slightly wrong on purpose (a different line number). Record whether Claude notices, and how it says so.
Learning outcome: test how a recipe behaves with bad evidence.
- Anthropic, Best practices for Claude Code — give Claude a way to verify, explore and plan before coding, be specific.
- Anthropic, Permission modes — plan mode and non-interactive behaviour.
- Anthropic, Run Claude Code programmatically —
claude -pand its limits flags.
Recipes R-01 to R-05 were executed on 2026-10-31 (tools/capture.sh, results in prompts/samples/). The stack trace in R-03 was deliberately an old, no-longer-valid report. The ordering advice is the author's own pattern.