Get better AI results with prompt engineering techniques from the team behind Claude.
Source: Claude Blog
Date: November 10, 2025
Reading time: 5 min
Context engineering has emerged as an increasingly important part of working with LLMs, with prompt engineering as its essential building block.
Prompt engineering is the craft of structuring instructions to get better outputs from AI models. It's how you phrase queries, specify style, provide context, and guide the model's behavior to achieve your goals.
At its most basic level, prompt engineering is just modifying the query you pass your LLM. Often it's simply adding information to the query before you make your actual requestbut knowing which information is the right information to share is the secret to engineering a great and effective prompt.
Modern AI models respond exceptionally well to clear, explicit instructions. Don't assume the model will infer what you wantstate it directly.
Example: Creating an analytics dashboard
- Vague: "Create an analytics dashboard"
- Explicit: "Create an analytics dashboard. Include as many relevant features and interactions as possible. Go beyond the basics to create a fully-featured implementation."
Best practices:
- Lead with direct action verbs: "Write," "Analyze," "Generate," "Create"
- Skip preambles and get straight to the request
- State what you want the output to include, not just what to work on
- Be specific about quality and depth expectations
Explaining why something matters helps AI models better understand your goals and deliver more targeted responses.
Example: Formatting preferences
- Less effective: "NEVER use bullet points"
- More effective: "I prefer responses in natural paragraph form rather than bullet points because I find flowing prose easier to read and more conversational."
Specificity in prompt engineering means structuring your instructions with explicit guidelines and requirements.
Include:
- Clear constraints (word count, format, timeline)
- Relevant context (who's the audience, what's the goal)
- Desired output structure (table, list, paragraph)
- Any requirements or restrictions
Examples shine when explaining concepts or demonstrating specific formats. Also known as one-shot or few-shot prompting.
Pro tip: Start with one example (one-shot). Only add more examples (few-shot) if the output still doesn't match your needs.
Give the AI explicit permission to express uncertainty rather than guessing. This reduces hallucinations and increases reliability.
Example: "Analyze this financial data and identify trends. If the data is insufficient to draw conclusions, say so rather than speculating."
Prefilling lets you start the AI's response for it, guiding format, tone, or structure.
Chain of thought (CoT) prompting involves requesting step-by-step reasoning before answering.
Modern approach: Claude offers an extended thinking feature that automates structured reasoning.
Three implementations:
- Basic: Simply add "Think step-by-step" to your instructions
- Guided: Structure your prompt to provide specific reasoning stages
- Structured: Use tags to separate reasoning from the final answer
- Tell the AI what TO do instead of what NOT to do
- Match your prompt style to the desired output
- Be explicit about formatting preferences
Chaining breaks down complex tasks into smaller sequential steps with separate prompts. Each prompt handles one stage, and the output feeds into the next instruction.
While modern models are better at understanding structure without XML tags, they can still be useful in specific situations.
Role prompting defines expert personas and perspectives. Modern alternative: Being explicit about what perspective you want is often more effective.
| Problem | Solution |
|---|---|
| Response is too generic | Add specificity, examples, or explicit requests for comprehensive output |
| Response is off-topic | Be more explicit about your actual goal. Provide context |
| Response format is inconsistent | Add examples (few-shot) or use prefilling |
| Task is too complex | Break into multiple prompts (chaining) |
| AI includes unnecessary preambles | Use prefilling or explicitly request to skip |
| AI makes up information | Give permission to say "I don't know" when uncertain |
- Don't over-engineer: Longer, more complex prompts are NOT always better
- Don't ignore the basics: Advanced techniques won't help if your core prompt is unclear
- Don't assume the AI reads minds: Be specific about what you want
- Don't use every technique at once: Select techniques that address your specific challenge
- Don't forget to iterate: The first prompt rarely works perfectly
- Don't rely on outdated techniques: XML tags and heavy role prompting are less necessary with modern models
To really hone your prompt engineering skills, you'll need to objectively measure the effectiveness of your prompts. Check out the prompt engineering course.