Prompt engineering is the discipline of communicating with AI effectively. With Claude, mastering five concrete techniques transforms your results from mediocre to exceptional.
1. Explicit roles and context
Always start by saying who Claude is in this conversation and who it works for. "Review this text" vs "act as senior editor of a business magazine, evaluating text for C-level readers" — night and day.
2. XML tags for structure
Claude was trained with XML as internal format. Using tags dramatically improves precision:
<context>
We're a 20-person B2B startup.
CRM: HubSpot.
</context>
<task>
Design a 5-email nurturing flow.
</task>
<constraints>
- Each email max 100 words
- No corporate jargon
- Clear CTA on each
</constraints>
3. Chain of thought
Before giving the final answer, think step by step:
1. What the problem assumes
2. What constraints exist
3. What possible paths exist
4. Which is best and why
Only then, final answer.
4. Few-shot learning
One example is worth 200 words of instructions. Show a complete case for the format:
Convert product descriptions to ad copy.
Example:
Description: Electric toothbrush with 3 modes
Copy: Dentist-clean teeth without leaving home. 3 modes, 30-day battery.
Now convert:
[your description]
5. Prefills (directing response start)
In the API, make Claude "start" with text you define. This forces format:
Human: Generate JSON with name, age, email.
Assistant: {
"name": "
Complementary techniques
- Explicit negation: "DON'T do X" matters as much as "do Y".
- Quality criteria: describe how the answer will be evaluated.
- Planned iteration: "Give me an initial version and ask what to revise".
- Decomposition: break complex tasks into explicit subtasks.
Anti-patterns that ruin results
- Vague prompts.
- Excessive politeness burns tokens.
- Contradictions: "creative but conservative" without defining axis.
A 5-part framework for any prompt
- Role: who Claude is for this task.
- Context: relevant info about your situation.
- Task: what you want exactly.
- Format: how you want output.
- Constraints: what NOT to do.
Conclusion
Prompt engineering isn't magic, it's clear communication with structure. Practice these techniques in 5-10 prompts this week and you'll notice the difference.