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 5, Opus 4.7, Opus 4.6, Sonnet 4.6, Haiku 4.5), covering universal techniques, model-specific optimizations, extended thinking modes, and agentic patterns. Includes the full Opus 5 chapter: verbosity and narration control, written-deliverable length, task scope and over-verification, subagent spawning, self-correction, and thinking-disabled artifacts.
Bring this into your next coding session
Install CandleKeep and your AI coding agent — Claude Code, Cursor, Codex, and more — can read Anthropic Prompting Best Practices directly. Cited, always current. Just ask, and the librarian pulls in the right book.
curl -fsSL https://getcandlekeep.com/install.sh | shPreview
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 five models, each optimized for different use cases:
Claude Opus 5
The most capable model, built for complex agentic coding and enterprise work, with particular strengths in long-horizon agentic tasks. Opus 5 completes full tasks rather than leaving stubs or placeholders, and it performs best when given the complete task specification up front and left to run. Thinking is on by default, and it ships with a 1M token context window as both the default and the maximum.
- API ID:
claude-opus-5 - Context Window: 1M tokens (default and maximum)
- Max Output: TBD
- Pricing: TBD
- Latency: Moderate
- Thinking: On by default; can be disabled only at effort
highor below - Default Effort:
high
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 5 | Opus 4.7 | Opus 4.6 | Sonnet 4.6 | Haiku 4.5 |
|---|---|---|---|---|---|
| API ID | claude-opus-5 | claude-opus-4-7 | claude-opus-4-6 | claude-sonnet-4-6 | claude-haiku-4-5-20251001 |
| Pricing (input/output) | TBD | TBD | $5/$25 per MTok | $3/$15 per MTok | $1/$5 per MTok |
| Extended Thinking | Yes (on by default) | Yes | Yes | Yes | Yes |
| Adaptive Thinking | Yes | Yes | Yes | Yes | No |
| Context Window | 1M (default and max) | 200K | 200K (1M beta) | 200K (1M beta) | 200K |
| Max Output | TBD | 128K tokens | 128K tokens | 64K tokens | 64K tokens |
| Latency | Moderate | Moderate | Moderate | Fast | Fastest |
| Default Effort | high | — | — | — | — |
| Effort: xhigh | Yes | Yes | No | No | No |
| Thinking can be disabled | Only at effort high or below | Yes | Yes | Yes | Yes |
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 5 when:
- You need the absolute most capable model available
- Difficult agentic coding: multi-file features, larger refactors, end-to-end feature work
- Code review and bug-finding, where you want high precision and recall in a single pass
- Long-context work — instruction following, tool calling, and reasoning stay consistent across the full 1M token window
- Multi-agent workloads that coordinate teams of subagents
- Vision-heavy work: charts, documents, diagrams, and UI/frontend visual replication
- Office and document tasks: multi-sheet spreadsheets with non-trivial formulas, structured slide decks
- You want strong quality at low token cost —
lowandmediumeffort hold up well on Opus 5
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 5
- 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