Claude Code Prompt Cheatsheet

One-page cheatsheet of Claude Code prompt patterns: role + constraints + output shape + budget. Plus 10 fill-in-the-bracket templates you can use immediately.

💥 50p impulse-buy: Power Prompts PDF (first 10 buyers) 30 battle-tested Claude Code prompts · 8-page PDF · paste into CLAUDE.md and never re-type a prompt again · 50p impulse-buy, no commitment

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.

The pattern: Role + Constraints + Output shape + Budget

ElementWhy it mattersExample phrasing
Role / stanceSets the lens Claude applies"as a skeptical senior engineer", "as if you'll be paged at 3am"
ConstraintsPrevents scope creep and unwanted changes"do not refactor", "no new dependencies", "max 30 lines changed"
Output shapeMakes the response actionable"markdown table with columns X, Y, Z", "unified diff", "JSON matching this schema"
BudgetForces selection over padding"max 5 findings", "under 250 lines", "smallest possible diff"
Escape clauseLets Claude stop instead of inventing work"if there are no issues, say so in one sentence and stop"

10 fill-in-the-bracket templates

1. Review

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.

2. Plan-before-code

Before writing code for [TASK], list:
- 3 hardest sub-problems
- riskiest assumption
- which existing function to extend vs write fresh
Wait for go-ahead.

3. Three approaches

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.

4. Minimal diff

Fix [BUG] with smallest possible diff. No refactors, no renames,
no formatting, no "while I'm here" cleanup.
Show unified patch.

5. Stack-trace autopsy

Trace execution for this error: [TRACE]
Per frame: file:line + variable value that caused next frame.
End: root cause in 1 sentence, minimal patch.

6. Coverage gap

For [FILE], list every branch and whether it has a test.
Output: | branch | tested? | suggested test | priority |
Priority by reachability from user input.

7. Rename only

Rename [OLD] to [NEW] everywhere — definitions, imports, comments,
tests, README. Touch no other code. Do not reformat.
Run tests. Confirm green.

8. Dead code finder

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.

9. PR summary

Read this diff. Produce 5-line summary:
WHY (motivation) · WHAT (user change) · HOW (approach) · RISK (what breaks)
No marketing. No "this PR aims to".

10. Architecture sniff

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

Anti-patterns at a glance

Don't saySay 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."

The CLAUDE.md trick

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.

Output-shape cheat list

Want the full 30-prompt pack?

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.

Grab the 30-prompt PDF →

Frequently asked questions

What's the single most important prompt pattern in Claude Code?
Output shape. Telling Claude exactly how to format the response — markdown table, unified diff, JSON object, 5-bullet list — collapses ambiguity and makes the response actionable. 'Review this code' produces prose. 'Review this code, output a table with file:line, severity, fix' produces a list you can work through.
Where should I keep prompts I use often?
In CLAUDE.md at your project root. Claude Code loads it every session automatically. Group by workflow (## Code Review, ## Refactoring, ## Tests). Name each prompt so you can invoke it by reference: 'use the Code Review prompt on the current diff'.
How long should a Claude Code prompt be?
As long as it needs to be to specify role, constraints, output shape, and budget — typically 8–20 lines. Shorter often produces vague output. Longer than 30 lines usually means the prompt is doing too many things and should be split.

Free tools

Cost Calculator → API Cookbook → Diff Summarizer → Skills Browser →

More examples

Claude API Python QuickstartClaude API Node.js / TypeScript QuickstartClaude API Streaming in PythonClaude API Streaming in Node.js / TypeScriptClaude API Tool Use in PythonClaude API Tool Use in Node.js / TypeScript