10 Tips for Writing Better Prompts for Claude
A practical guide featuring 10 techniques to improve your prompts for Claude, with examples of what to do and what to avoid. Based on Anthropic’s official documentation and the model’s actual processing behavior.
Using a language model like Claude day-to-day is, in large part, a communication exercise. The clearer and more structured your request, the better the result tends to be. But there's an extra layer here: each model has its own characteristics in how it processes instructions, and understanding those makes a real difference in response quality.
This guide brings together 10 practical tips to get more out of Claude specifically, based on Anthropic's official documentation, established prompt engineering best practices, and what the model itself performs best at. No abstract theory: each tip comes with concrete examples of what to do and what to avoid.
1. Be Specific About the Output Format
Claude will try to infer the most appropriate format if you don't say anything, but that doesn't always align with what you want. If you need JSON, a list, a table, or plain prose, say so explicitly.
Weak:
List the main Python frameworks for machine learning.
Better:
List the 5 main Python frameworks for machine learning as a table
with the columns: Name, Primary use, When to prefer it.The golden rule: if you have a format expectation, write it out. Don't let the model guess.
2. Provide Enough Context, but No Noise
Claude processes everything in the prompt. Relevant context helps, but excessive or contradictory context can dilute the model's attention and degrade the response.
A solid prompt structure has four parts, in this order:
- Role/context: who is responding and for what purpose
- Input data: the material the model will use
- Detailed task: exactly what you want
- Output format: how you want to receive the response
Example:
You are a technical reviewer for API documentation.
Document:
[paste text here]
Review the document above and identify:
- Technical inconsistencies
- Missing information a developer would need
- Ambiguous sections
Return as a numbered list, grouped by category.3. Use XML Tags to Structure Complex Inputs
Claude was trained on many structured documents and responds very well to XML tags for delimiting sections of a prompt. This is especially useful when you have multiple blocks of information, such as context, examples, and the main instruction.
<context>
I'm building a RAG pipeline with LangChain and Azure AI Search.
The index has 1536-dimension embeddings with hybrid search enabled.
</context>
<task>
Suggest strategies to improve result relevance when the user's query
is very short (fewer than 5 words).
</task>
<format>
List the strategies with a brief technical explanation for each.
</format>The tags don't need to follow any specific schema. What matters is clear semantic separation between parts.
4. Ask the Model to Think Before Responding
For tasks involving reasoning, analysis, or multiple steps, asking Claude to "think step by step" before giving a final answer consistently improves quality. Anthropic confirms this in their documentation: giving room for intermediate reasoning reduces errors, especially in logic and code tasks.
Without explicit reasoning:
Will this Python code work correctly for empty lists?
[code]With explicit reasoning:
Analyze this Python code for empty lists. First, trace the execution flow
step by step for the empty list case. Then, say whether it will work and why.
[code]For Claude versions with extended thinking support, you can enable reasoning mode directly via the API, which exposes the thought process before the final answer.
5. Use Examples (Few-Shot) When the Pattern Matters
If you want Claude to follow a very specific format, tone, or style, the most efficient path is to show one or two examples of what you expect. Verbal description of a format is almost never as precise as a concrete example.
Transform the sentences below into article headlines in journalistic style.
Input: "The number of AI startups grew 40% in Brazil in 2024."
Output: "AI Sector in Brazil Grows 40%, Consolidating a New Startup Cycle"
Input: "Researchers at USP published a new method for fraud detection."
Output: [your output here]Start with one example (one-shot). If the result still isn't right, add one or two more, especially for the edge cases that matter to you.
6. Give Explicit Permission to Express Uncertainty
Claude, by default, tends to try to answer even when it isn't sure. A simple instruction changes this behavior: ask it to say when it doesn't know or when data is insufficient for a confident conclusion.
Analyze the performance data below and identify trends.
If the data is insufficient for a conclusion, state that explicitly
rather than speculating.
[data]This isn't just aesthetic: it reduces hallucinations and increases output reliability in automated workflows.
7. Assign a Role When Expertise Matters
Defining a role for Claude via system prompt or at the start of a conversation aligns the tone, depth, and vocabulary of the response to the domain you need. Anthropic points to this as one of the most effective techniques for specialized tasks.
You are a senior data engineer with experience in Azure ingestion pipelines.
Respond technically and directly, without unnecessary simplifications.The role works as calibration: the model will adjust the level of detail and the type of assumptions it makes about your knowledge level. For technical users, this avoids unnecessary didactic responses.
8. Break Complex Tasks Into Smaller Steps (Prompt Chaining)
For multi-part problems, a single long prompt almost always performs worse than a chain of smaller, focused prompts. Each response becomes the input for the next step.
Example chain for generating a technical report:
- Prompt 1: "Summarize the key points of this technical document."
- Prompt 2: "Based on that summary, identify the three main technical risks."
- Prompt 3: "For each identified risk, suggest a mitigation with an estimated implementation effort."
This improves precision at each step and makes the process easier to debug when something goes wrong.
9. Avoid Vague Negations, Prefer Affirmative Instructions
Claude handles what you want better than what you don't want. Instructions like "don't be vague" or "don't use bullet points" work, but they're less precise than stating the exact expected behavior.
Less effective:
Don't give me a vague answer. Don't use technical terms without explaining them.More effective:
Answer specifically with concrete examples.
When using technical terms, include a one-sentence definition.This doesn't mean negations never work, but affirmative instructions tend to produce more consistent results.
10. Iterate: The First Prompt Is Rarely the Best
Prompt engineering is an iterative process. Anthropic is explicit about this: the first prompt is rarely the ideal one. Treat the prompt like code: test, observe where the output deviates from what you expected, and refine surgically.
A practical cycle:
- Write the simplest possible prompt for the task
- Observe where the response falls short
- Add a specific instruction to fix that problem
- Repeat
Avoid the mistake of adding complexity to seem more precise. A shorter, clearer prompt almost always beats a long prompt packed with stacked constraints.
Conclusion
Most frustrations with language models come from vague, context-free, or poorly structured prompts. These 10 tips cover the highest-impact points: clear structure, relevant context, concrete examples, permission for uncertainty, and disciplined iteration.
You don't need to apply all of them at once. Start with output format specificity and well-bounded context. The other tools come in as the task demands.
Claude is a model that responds very well to direct, structured communication. Treat the prompt like a brief for a competent collaborator: the clearer the request, the better the result.
References: Anthropic Prompt Engineering · Prompt Engineering Guide · Anthropic Docs