Most Claude Code prompt advice is vague. "Be specific." "Give context." Not useful.
Here are the actual prompts I use daily. Copy these and adjust for your context.
New feature
I need to add [feature]. Before writing any code:
1. What files will this touch?
2. What could break?
3. What's the simplest implementation?
Then implement it.
Why it works: forces Claude to think before coding, which catches the obvious mistakes upfront.
Writing tests
Write tests for [function/component]. Cover:
- The happy path
- Edge cases: empty input, null, max values
- Error conditions
Use the existing test patterns in this codebase.
Always reference existing test patterns. Claude will copy your conventions instead of inventing new ones.
Debugging
This is broken: [error or description]
Expected: [what should happen]
Actual: [what's happening]
Don't fix it yet. Tell me what you think the root cause is and what you'd check first.
The "don't fix it yet" part is critical. Otherwise Claude jumps to a plausible fix that may be wrong.
Refactoring
Refactor [function/file] for readability. Rules:
- No behavior changes
- Keep the same public API
- Flag anything that looks like a bug (don't fix it)
Explicit constraints prevent Claude from "improving" things you didn't ask it to touch.
Code review
Review this code. Look for:
- Logic errors
- Missing error handling
- Security issues
- Performance problems
Be direct. Don't pad the response with positives.
The last line matters. Without it you get "Great code! Just a few small suggestions..." before every comment.
Documentation
Write a docstring for this function. Include:
- What it does (one sentence)
- Parameters and types
- Return value
- One example
No filler. Don't restate the function name.
The pattern behind all of these
Every prompt above does the same three things:
- States the task clearly
- Gives constraints (what not to do, what to follow)
- Asks for thinking before action when the task is complex
That's it. The specific words matter less than having those three components.
If you want a full set of these organized by use case, I put together the Agent Prompt Playbook — 50 prompts across 10 categories with explanations for why each works.
But these six will cover 80% of daily Claude Code work.
Top comments (0)