The Prompts That Actually Work with Claude Code

Not tips — actual prompt text I use daily. Copy these and adjust for your context.

Prompt advice usually stays at the level of principles. Here's something more useful: the actual text I use. These are real prompts, not made-up examples.

Starting a new feature

I need to build [feature]. 

Context:
- This is called from [what calls it]
- The relevant existing code is in [files]
- We use [patterns/frameworks] throughout the codebase
- Constraints: [performance, backward compat, etc.]

Before writing code: what are the main approaches and what are the tradeoffs? 
I'll pick one, then we'll implement it.

Writing tests for existing code

Write tests for [function/module].
The real callers are [X and Y].
The edge cases I actually care about: [list them].
Each test name should describe the expected behavior, not the function name.
Use [Jest/Vitest/whatever] with [any specific patterns].

Debugging

I'm seeing [exact error or behavior].
Expected: [what should happen]
Actual: [what's happening]
Already tried: [what hasn't worked]

What are the three most likely causes? 
Don't suggest fixes yet — I want to understand the cause first.

Refactoring

Refactor [function/module] to [specific goal].
Do NOT change the public interface.
Do NOT change any behavior — structure only.
All existing tests must still pass.
If you're unsure whether a change alters behavior, ask before making it.

Code review

Review this code. Flag:
1. Anything that could fail in production
2. Error cases that aren't handled
3. Security issues (input validation, exposed data, auth gaps)
4. Performance problems at scale
5. Anything that would confuse someone reading this in 6 months

Be specific — reference lines. Skip generic advice.

Documentation

Write documentation for [function/module].
Include: what it does, what each parameter is, what it returns, 
what it throws, and one usage example.
Audience: a developer who hasn't read the implementation.

These six cover 80% of my daily Claude Code usage. The key pattern in all of them: explicit scope, explicit constraints, explicit what-not-to-do. Claude follows constraints when they're stated.

If you want 40 more organized by task type — with notes on what context matters for each — they're in the Agent Prompt Playbook.