One-page cheatsheet of Claude Code prompt patterns: role + constraints + output shape + budget. Plus 10 fill-in-the-bracket templates you can use immediately.
This is the cheatsheet — a one-page reference for writing Claude Code prompts that consistently produce usable output. Print it, paste it into CLAUDE.md, or bookmark this page.
| Element | Why it matters | Example phrasing |
|---|---|---|
| Role / stance | Sets the lens Claude applies | "as a skeptical senior engineer", "as if you'll be paged at 3am" |
| Constraints | Prevents scope creep and unwanted changes | "do not refactor", "no new dependencies", "max 30 lines changed" |
| Output shape | Makes the response actionable | "markdown table with columns X, Y, Z", "unified diff", "JSON matching this schema" |
| Budget | Forces selection over padding | "max 5 findings", "under 250 lines", "smallest possible diff" |
| Escape clause | Lets Claude stop instead of inventing work | "if there are no issues, say so in one sentence and stop" |
Review [FILE/DIFF] as a skeptical senior engineer. Output a table:
| file:line | severity 1-5 | category | one-line fix |
Max 12 issues. If none, say so and stop.
Before writing code for [TASK], list:
- 3 hardest sub-problems
- riskiest assumption
- which existing function to extend vs write fresh
Wait for go-ahead.
Propose 3 approaches for [FEATURE]:
1. Obvious
2. Different trade-off
3. Non-obvious (something I'd miss)
For each: 3-sentence description, files touched, biggest risk.
Fix [BUG] with smallest possible diff. No refactors, no renames,
no formatting, no "while I'm here" cleanup.
Show unified patch.
Trace execution for this error: [TRACE]
Per frame: file:line + variable value that caused next frame.
End: root cause in 1 sentence, minimal patch.
For [FILE], list every branch and whether it has a test.
Output: | branch | tested? | suggested test | priority |
Priority by reachability from user input.
Rename [OLD] to [NEW] everywhere — definitions, imports, comments,
tests, README. Touch no other code. Do not reformat.
Run tests. Confirm green.
Find dead code in [DIR]: functions never called, imports unused,
exports with zero importers. Per finding: file:line, evidence,
confidence (high/med/low). Don't delete yet — table only.
Read this diff. Produce 5-line summary:
WHY (motivation) · WHAT (user change) · HOW (approach) · RISK (what breaks)
No marketing. No "this PR aims to".
Sample this repo's structure. Output:
- Dominant pattern in 2 sentences
- 3 places it's violated (file:line)
- Whether violations are pragmatic or accidental
- One refactor with fastest payback
| Don't say | Say instead |
|---|---|
| "Review this code" | "Review as skeptical engineer. Output table. Max 12 findings." |
| "Refactor this" | "Reduce cyclomatic complexity of [FN] to under 10. No other changes." |
| "Write tests" | "Write 8 tests: 2 happy-path, 2 boundary, 2 invalid, 1 invariant, 1 regression." |
| "Make this better" | "Make [SPECIFIC METRIC] better with smallest diff." |
| "Find bugs" | "Find subtle bugs unit tests would miss in [FILE]. Cap at 7." |
| "Document this" | "Write a hook-first README. Working code in first 30 lines. Max 250 lines." |
Pick your 5–10 most-used prompts and paste them into CLAUDE.md at your project root, grouped by heading:
# House prompts
## Code review
[full prompt here]
## Refactoring
[full prompt here]
## Test generation
[full prompt here]
Then in any session you can say "use the Code Review prompt on the current diff" and Claude will pull from CLAUDE.md. You never re-paste the prompt.
This cheatsheet shows 10 templates. The Claude Code Power Prompts PDF has 30 — one for every common workflow — grouped into six categories with TIP boxes. 8 pages, instant Stripe download, £3 launch tonight (first 10 buyers), £5 standard. Best £5 you'll spend on a productivity tool this year.