Anthropic Prompting Best Practices
by Anthropic
Add to your library first to use in Claude Code
About
Comprehensive guide to prompting best practices for Claude models (Opus 4.6, Sonnet 4.6, Haiku 4.5), covering universal techniques, model-specific optimizations, extended thinking modes, and agentic patterns.
Preview
Chapter 1: Introduction & Model Overview
Overview of the Claude Model Family
Claude is a family of state-of-the-art large language models developed by Anthropic. All current Claude models support text and image input, text output, multilingual capabilities, and vision. Models are available via the Claude API, AWS Bedrock, and Google Vertex AI.
The current generation consists of four models, each optimized for different use cases:
Claude Opus 4.7
The most capable model, with particular strengths in long-horizon agentic work, knowledge work, vision, and memory. Opus 4.7 builds on the strengths of previous Opus models with improved reasoning depth and state tracking across extended sessions. It supports effort levels up to max and introduces the new xhigh effort level.
- API ID:
claude-opus-4-7 - Context Window: 200K tokens
- Max Output: 128K tokens
- Latency: Moderate
Claude Opus 4.6
A highly intelligent model for building agents and coding. Opus 4.6 excels at long-horizon reasoning, complex multi-step tasks, and agentic workflows. It features adaptive thinking, 128K max output tokens, and supports effort levels up to max.
- API ID:
claude-opus-4-6 - Context Window: 200K tokens (1M tokens in beta)
- Max Output: 128K tokens
- Pricing: $5/input MTok, $25/output MTok
- Latency: Moderate
- Knowledge Cutoff: May 2025 (reliable), Aug 2025 (training data)
Claude Sonnet 4.6
The best combination of speed and intelligence. Sonnet 4.6 is ideal for everyday coding, analysis, content tasks, and agentic workflows where fast turnaround matters.
- API ID:
claude-sonnet-4-6 - Context Window: 200K tokens (1M tokens in beta)
- Max Output: 64K tokens
- Pricing: $3/input MTok, $15/output MTok
- Latency: Fast
- Knowledge Cutoff: Aug 2025 (reliable), Jan 2026 (training data)
Claude Haiku 4.5
The fastest model with near-frontier intelligence. Best for high-volume, latency-sensitive workloads.
- API ID:
claude-haiku-4-5-20251001(alias:claude-haiku-4-5) - Context Window: 200K tokens
- Max Output: 64K tokens
- Pricing: $1/input MTok, $5/output MTok
- Latency: Fastest
- Knowledge Cutoff: Feb 2025 (reliable), Jul 2025 (training data)
Model Comparison Table
| Feature | Opus 4.7 | Opus 4.6 | Sonnet 4.6 | Haiku 4.5 |
|---|---|---|---|---|
| API ID | claude-opus-4-7 | claude-opus-4-6 | claude-sonnet-4-6 | claude-haiku-4-5-20251001 |
| Pricing (input/output) | TBD | $5/$25 per MTok | $3/$15 per MTok | $1/$5 per MTok |
| Extended Thinking | Yes | Yes | Yes | Yes |
| Adaptive Thinking | Yes | Yes | Yes | No |
| Context Window | 200K | 200K (1M beta) | 200K (1M beta) | 200K |
| Max Output | 128K tokens | 128K tokens | 64K tokens | 64K tokens |
| Latency | Moderate | Moderate | Fast | Fastest |
| Effort: max | Yes | Yes | No | No |
| Effort: xhigh | Yes | No | No | No |
Platform Availability
All models are available on:
- Claude API (direct)
- AWS Bedrock (IDs:
anthropic.claude-opus-4-6-v1,anthropic.claude-sonnet-4-6,anthropic.claude-haiku-4-5-20251001-v1:0) - GCP Vertex AI (IDs:
claude-opus-4-6,claude-sonnet-4-6,claude-haiku-4-5@20251001)
Starting with Claude Sonnet 4.5 and later, AWS Bedrock and Google Vertex AI offer global endpoints (dynamic routing for maximum availability) and regional endpoints (guaranteed data routing through specific geographic regions).
How to Choose the Right Model
Choose Opus 4.7 when:
- You need the absolute most capable model available
- Long-horizon agentic work requiring deep memory and state tracking
- Complex knowledge work, research, and analysis
- Vision-heavy tasks requiring strong image understanding
- You need the
xhighormaxeffort levels for maximum capability - Note: effort is more important for Opus 4.7 than any prior model
Choose Opus 4.6 when:
- You need very high intelligence for complex reasoning tasks
- Building autonomous agents that run for extended periods
- Working on large-scale code migrations or deep research
- You need long-horizon reasoning across multiple context windows
- You need the
maxeffort level for absolute maximum capability - Cost is less important than quality
Choose Sonnet 4.6 when:
- You need a balance of speed and intelligence
- Building agentic coding workflows with fast turnaround
- Working on everyday coding, analysis, and content tasks
- Cost efficiency matters alongside strong performance
- You need adaptive thinking with faster response times
Choose Haiku 4.5 when:
- Speed is the top priority
- Running high-volume, latency-sensitive workloads
- Simple classification, routing, or subagent tasks
- Cost optimization is critical
- Tasks don't require deep reasoning
Decision Framework
- Start with the task complexity: If it requires deep multi-step reasoning or long-horizon agentic work, start with Opus 4.7
- Consider latency requirements: If you need fast responses, use Sonnet 4.6 or Haiku 4.5
- Factor in volume: High-volume tasks favor Haiku 4.5 for cost efficiency
- Evaluate with the effort parameter: You can often get Opus-level quality from Sonnet at lower cost by adjusting effort levels
- Test and iterate: The best model for your use case depends on your specific requirements - prototype with Opus, then see if Sonnet or Haiku can meet your quality bar