Engineers effective prompts using systematic methodology. Use when designing prompts for Claude, optimizing existing prompts, or balancing simplicity, cost, and effectiveness...
Foundation First (Always Apply):
Then Assess:
Key insight: The best prompt achieves goals with minimum necessary structure.
Output Problems โ Solutions:
| Problem | Solution |
|---|---|
| Too generic | Add specificity + examples |
| Off-topic | Add context explaining goals |
| Wrong format | Examples or structured outputs |
| Unreliable on complex tasks | Prompt chaining |
| Unnecessary preambles | "Start directly with..." or structured outputs |
| Hallucinations | "If unsure, acknowledge uncertainty" |
| Shallow reasoning | Raise effort |
Process Problems โ Fixes:
| Mistake | Fix |
|---|---|
| Over-engineering | Start minimal, add only what helps |
| Negative framing | Say what TO do instead |
| No motivation | Explain the WHY |
| No iteration | Test, measure, refine |
| Technique | What It Does | Cost |
|---|---|---|
| 1. Clarity | Explicit instructions, success criteria | Minimal |
| 2. Context & Motivation | Explain WHY you want something | Minimal |
| 3. Positive Framing | Say what TO do, not what NOT to do | Minimal |
| 4. XML Structure | Separate sections in complex prompts | ~50-100 tokens |
Note: XML is less essential with Claude 4.x - use when genuinely needed.
| Technique | When to Use | Cost |
|---|---|---|
| 5. Effort / Thinking | Hard analysis, math, debugging | Higher effort = more tokens |
| 6. Prompt Chaining | Multi-step, complex tasks | Multiple calls |
| 7. Multishot Examples | Pattern learning, format | 200-1K each |
| 8. System Role | Domain expertise needed | Minimal |
| 9. Structured Outputs | Strict format requirements | Minimal |
| 10. Long Context | 20K+ token inputs | Better accuracy |
| 11. Context Budget | Repeated use, conversations | 90% savings |
| 12. Tool Docs | Function calling, agents | 100-500/tool |
Before Writing:
Complexity Assessment:
Cost Optimization:
Deliverable:
When to use MCP tools during prompt engineering:
Need latest practices?
โโ WebSearch โ Parallel Search
Need library docs?
โโ mcp__plugin_essentials_mcp (context7)
Prompt Caching:
Long Context Tips:
<document>, <source>Reducing Token Usage:
โ Ignoring caching - Not leveraging repeated content (90% savings lost) โ Over-requesting effort - High effort for simple tasks (tokens wasted) โ Redundant examples - 5 examples when 2 suffice โ No batching - Real-time calls for non-urgent work (50% savings lost)
See LEVEL 2: Diagnostics for general fixes.
Detailed Technique Catalog:
reference/technique-catalog.md - Each technique explained with examples, token costs, combination strategiesReal-World Examples:
reference/examples.md - Before/after pairs for coding, analysis, extraction, agent tasksResearch Papers:
reference/research.md - Latest Anthropic research, benchmarks, best practices evolution