The Prompt Library
Most people do not struggle with Claude Code's features. They struggle with the blank prompt box. This chapter is a reference of 73 short, reusable sentences in 13 categories (audience, control, exploration, thinking, verification, roles, formats, debugging, refactoring, tests, docs, learning). Each one says when to use it, what to watch out for, and which other prompts it combines with. 29 of them come with a real answer: a prompt that was run through Claude Code on a real Spring Boot project, with the model, turns and cost recorded and an honest note on whether the answer was right.
Prompts Are Building Blocks
A prompt like "Explain this like I'm a novice developer" is not a trick. It sets who the answer is for. Other short sentences set what Claude may touch, what shape the answer takes, and how to prove it. Real requests combine four or five of them, one per line. That is the whole idea of this library: learn the pieces once, then combine them.
A tiny example. These three library prompts, joined with the task, give you a safe, plain-language exploration. This text is a combination for illustration; the real run of a similar combination appears in Chapter 16.
How to read an entry
- The prompt uses
{placeholders}in curly braces. Replace them with your own words. - Use when / Watch out say where it helps and where it misleads.
- Combine with links to prompts that pair well with it.
- Real sample (when present) shows the exact prompt sent, the answer, and metadata: model, turns, time, estimated cost, and the project commit it ran against. Costs are Claude Code's client-side estimates, not an invoice.
- Author's check says whether I verified the answer against the code. Green means checked, amber means partly correct, red means it contained errors. "Not fact-checked" means exactly that.
73 Prompts in 13 Categories
Filter by typing, or pick a category. Use the copy button on a prompt to paste it into Claude Code. Open "Real sample" to see what came back.
Audience and level 6
Tell Claude who the answer is for. The same facts come out very differently for a ten-year-old, a novice or a senior engineer.
Real sample: what Claude answered (Partly correct)
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Not fact-checked)
Control and safety 5
Decide what Claude may touch and when it must stop and ask. Put these first when the task could change files.
Real sample: what Claude answered (Not fact-checked)
Explore a codebase 5
Learn unfamiliar code quickly and safely. All of these work read-only.
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Checked)
Real sample: what Claude answered (Not fact-checked)
Thinking and decisions 5
Pull out assumptions, options and risks before you commit to an approach.
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Not fact-checked)
Verification 4
Make Claude prove its work with commands, tests and honest labels instead of confident summaries.
Meta prompts 5
Prompts about prompts and about the conversation itself: improve your wording, check what is missing, get plain English.
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Not fact-checked)
Roles and viewpoints 6
Ask Claude to look at your work through a specific pair of eyes: reviewer, mentor, sceptic, on-call engineer, newcomer.
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Not fact-checked)
Output format 7
Say what shape the answer should take: table, steps, checklist, diff, diagram, length limit.
Real sample: what Claude answered (Checked)
Real sample: what Claude answered (Not fact-checked)
Debugging 6
Turn an error into hypotheses and experiments instead of a guess-and-patch loop.
Real sample: what Claude answered (Partly correct)
Real sample: what Claude answered (Contains errors)
Refactoring 6
Change structure without changing behaviour, and prove it.
Real sample: what Claude answered (Not fact-checked)
Testing 6
Write, review and find gaps in tests, and make sure tests can actually fail.
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Checked)
Real sample: what Claude answered (Not fact-checked)
Documentation 6
Docs that stay true because every claim is checked against the code.
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Contains errors)
Learning with Claude 6
Use Claude as a tutor: quizzes, small exercises, concept maps, common mistakes.
Real sample: what Claude answered (Not fact-checked)
Real sample: what Claude answered (Not fact-checked)
Key Takeaways, Exercises and Sources
- Short sentences are building blocks. Audience, control, task, format and verification are separate decisions; make each one on purpose.
- Put control first when files could change: "Read only" and "tell me your plan and wait" cost nothing and prevent surprises.
- Ask for what was verified versus assumed. Fluent answers can be partly invented; one real sample here guessed a source file it never opened.
- Give real evidence (an error, a command, a file), not a description of it.
- Check citations. File and line references are checkable and were occasionally off by a line.
Exercise 1 Beginner
Pick any open-source project. Run the same question ("how does a request reach the database?") with AUD-01, AUD-02 and one audience prompt of your own. Compare what each leaves out.
Learning outcome: see how audience changes the answer without changing the facts.
Exercise 2 Intermediate
Choose one task you will really do this week. Write it as five lines using one prompt from each of audience, control, format and verification categories. Run it read-only first, then decide whether to allow edits.
Learning outcome: compose a prompt from blocks.
Exercise 3 Advanced
Run VER-03 after three different answers. For each, open every file Claude says it verified and check at least two claims. Keep a tally of claims that were wrong and add your own prompt to your personal library.
Learning outcome: measure how often fluent answers hold up on your own code.
- Anthropic, Best practices for Claude Code β specific prompts, giving checks, review prompts.
- Anthropic, Common workflows β exploring code,
@references, plan mode. - Anthropic, Run Claude Code programmatically β
claude -pflags used to capture the samples.
The 73 prompts are this guide's own wording; they are not quoted from Anthropic. All 29 samples were executed on 2026-10-31 by claude -p against the bookshelf project (read-only tools, local paths scrubbed). Prompts without a sample were not run. Everything is in the examples repository (prompts/library.json, prompts/samples/), and the capture script and its spend log are alongside it.