Learning resourcesReviewed · Anthropic

Prompting best practices for Claude models

Anthropic's guide to writing prompts for its current Claude models, aimed at anyone who writes prompts and at developers who call Claude through the API, with the main catch that much of its advice depends on the model version and must be re-checked before reuse. It is one web page of guidance rather than software, covering general prompting principles, output formatting, tool use, adaptive thinking controlled by an effort setting, multi-session agent work, sample system-prompt blocks and a migration checklist from earlier models. Its code examples appear in cURL, the ant command-line tool, Python, TypeScript and five other languages, and its performance claims are the vendor's own.

Researched 12 Nov 2026

In short.

This is Anthropic's own prompt-writing guide for its current Claude models. It is useful to beginners who need clearer prompts and to developers who build on the API. Its main catch is that most of its advice depends on the model version and needs testing on your own tasks before you rely on it. In technical terms, the page sets out general principles such as explicit instructions, context, examples and XML tags. It then covers output formatting, tool-use triggering, adaptive thinking controlled by an effort setting, agent state management across context windows, sample system-prompt blocks, and a migration checklist from earlier models. The migration advice depends on the target model. The manual budget_tokens setting still works on Opus 4.6 and Sonnet 4.6 but is deprecated there, and it returns an error on Claude 4.7 and later. Prefilled final assistant turns are unsupported starting with Claude 4.6 models and Claude Mythos Preview, while earlier models still support them. The captured text gives no methods for the vendor's performance statements, and this analysis did not run any of the code or prompts.

Researched and written by an AI model and checked by a second AI model. How it works

The analysed scope is the single page 'Prompting best practices' at https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices.md, captured on 12 November 2026. Linked pages are excluded, including the per-model prompting guides, the models overview, the effort, thinking, tool-use, memory, compaction, web search and computer-use pages, the cookbook recipe, the blog post, the support article and the GitHub skill file. Other folders are excluded too. The captured text contains no licence, copyright or other notice, so reuse and redistribution rights are unknown and readers should consult the original page. Not tested: every code sample, prompt and system-prompt block, including the medication and payments blocks; the image-cropping and frontend-design suggestions; and every performance claim. Nothing was executed, and no behaviour described on the page was observed directly.

The overview

identity

This resource is a single page from Anthropic's Claude platform documentation, titled 'Prompting best practices'. Its own description calls it a comprehensive guide to prompt engineering techniques for Claude's latest models, covering clarity, examples, XML structuring, thinking and agentic systems. A prompt is the text you send to a model, and prompt engineering is the work of writing that text so that answers are more accurate and more useful. The resource is text to read, not software: nothing is installed, although the page shows code for calling the Claude API.

The page has three parts. The first is a table of model-specific guidance with nine rows, each pointing to a separate guide, for example for the Claude Fable 5.2 and Mythos 5.2 pair, Opus 5.5, Sonnet 5.5 and Haiku 5.5. The second covers techniques for current models: general principles, output formatting, tool use, thinking, agentic systems and capability-specific tips. The third covers migration from earlier generations. The opening names 16 models in all, including Claude Opus 4.7, Opus 4.6, Sonnet 4.6 and Haiku 4.5, which have no row of their own in the table.

assessment

The page is a dense, practical reference rather than a tutorial. Its most useful material is concrete: before-and-after prompt pairs, a rule to ask for an action rather than a suggestion, guidance on wrapping examples and documents in XML tags, and migration steps with code for moving from manual extended thinking to adaptive thinking with an effort setting. It also tells readers to check each technique against their own evaluations, which is the most important instruction on the page.

Its main weakness is that advice varies by model, and the page says so. It asks readers to treat a technique as measured on the model named and to re-check it on other models. Some guidance points in different directions. The page generally recommends asking Claude to self-check its answers, but for Claude Opus 5 it says to remove verification instructions carried over from earlier prompts, because they can cause over-verification. For a beginner using a chat interface, the general principles carry over well. The later sections assume API vocabulary such as effort, adaptive thinking, thinking blocks and subagents.

users

Beginners who write prompts in Claude will get most from the general-principles section: say what output you want, explain the purpose, give three to five varied examples, and separate instructions, context and input with XML tags. Developers building on the Claude API will use the thinking, tool-use, formatting and migration sections. Teams building agents will look at the sections on long-running work, state files, subagent orchestration, parallel tool calls and overeagerness.

Product teams may also use two kinds of sample block. The first is a set of model-specific medication blocks for applications that people might ask about medicine doses. The second is a payments block for agents that handle payments, account numbers or customer records. The page presents both as text to paste into system prompts, and both are discussed under limitations. The page does not describe any audience beyond people writing prompts for Claude, so its fit for other uses is not established.

capabilities

The page gives guidance rather than a tool, but much of it is ready-to-paste text. Examples include a system-prompt block that makes Claude implement changes rather than only suggest them, a conservative block that waits for explicit instructions, a parallel tool-call block, a block telling Claude to investigate files before answering questions about code, a frontend-design block, a payments block and model-specific medication blocks. It also explains how to ask for plain-text maths without LaTeX, how to get prose rather than bullet lists, and how to steer how often the model thinks.

For long tasks the page describes state handling. It suggests keeping structured status in files such as tests.json, keeping free-text progress notes, using git as a checkpoint log, and choosing between a fresh context window and compaction. It also describes a first context window that sets up tests and scripts, with later windows working through a to-do list, and it names computer-use and browser tools for verifying UI work. The page shows what to ask for. The captured text does not establish that any of it works on a given task.

Using it

requirements

Reading the page needs only a browser. The code samples come in three kinds, and each needs different things. The cURL samples need the curl command and a Claude API key, which they pass from an environment variable called ANTHROPIC_API_KEY. The command-line samples call a command named ant, and the page does not say how to install it or how it gets credentials. The language samples (Python, TypeScript, C#, Go, Java, PHP and Ruby) need a client library for that language. The page uses these libraries without naming the packages or explaining how to install them. The snippets also leave out import lines. Apart from the Java sample, which builds its client from the environment, they do not show how the key is supplied. Every kind also needs access to the model strings used, such as claude-opus-5-5.

The page gives no installation instructions and no complete list of environment requirements. It does not say which plans, regions or rate limits apply, so access requirements are unknown from the evidence.

Several techniques rely on tools the page only names: web search for the medication blocks, a memory tool, computer-use and browser tools, a crop tool for images, and context compaction. The page points to other documents for their setup, and this analysis did not verify them. The thinking migration needs a model that accepts adaptive thinking. The page links to a per-model table showing which thinking configuration each model accepts, but does not reproduce it.

mechanism

The page's core idea is that the model follows instructions closely, so the wording of a prompt changes what it does. Asking 'Can you suggest some changes?' can get suggestions only, while a direct instruction gets edits. Giving the reason for a rule helps the model apply it in new cases. Examples wrapped in example tags shape format and tone. Long documents should sit above the question: the page says a query placed at the end can improve response quality by up to 30 percent in its tests, especially with complex, multi-document inputs.

On thinking, the page describes adaptive thinking, in which the model decides when and how much to think. Depth is steered by the effort setting and by query complexity. On several listed models thinking is always on. On Claude Fable 5.2, the page says that an instruction to answer without deliberating did not stop thinking at medium effort and above in Anthropic's testing, so it advises lowering the effort level instead. For output structure, the page recommends asking for a schema or using structured outputs in place of assistant prefills. It does not explain the internal reasons for these behaviours. It reports observed behaviour and Anthropic's own testing.

setup

The page tells readers to start with the guide for their model, then read the general sections. For an API call, the samples show a model string, a max_tokens limit, an optional system prompt that sets a role and, on newer models, a thinking setting of adaptive type with an effort level such as high. On Claude Opus 5, Sonnet 5.5, Sonnet 5 and Haiku 5.5, thinking is on when the thinking parameter is omitted, so a response may begin with thinking blocks. The page advises selecting content blocks by type rather than by position, and leaving room in max_tokens for thinking.

The page gives these migration steps for moving older code to a newer model. Replace a manual budget_tokens setting with adaptive thinking and effort: budget_tokens still works on Opus 4.6 and Sonnet 4.6 but is deprecated, and it returns a 400 error on Claude 4.7 and later. Remove assistant prefills on the last turn, which return a 400 error starting with Claude 4.6 models and Claude Mythos Preview; earlier models still support them. Pass thinking blocks back unchanged and keep conversation history append-only. For agent work, the page advises creating test and progress files at the start. It names Claude Code only as an example of a harness that compacts context, and it gives no installation steps for any harness.

example

The simplest example contrasts 'Create an analytics dashboard' with a version that adds 'Include as many relevant features and interactions as possible' and 'Go beyond the basics to create a fully-featured implementation'. The page presents the longer version as more effective because it states the scope. A second pair shows that 'Can you suggest some changes to improve this function?' may get only suggestions, while 'Change this function to improve its performance' asks for an edit.

A developer example moves one call from an older model that uses thinking with a budget_tokens value of 10000 to a newer model that uses adaptive thinking with output_config effort set to high, with max_tokens of 16000 in both. The page shows the same request in nine variants, including cURL, Python, TypeScript, Go and Java. These examples are illustrative. This analysis did not run them, and the captured text does not show what output they produce.

Assessment & evidence

limitations

The performance statements are the vendor's own. The page says a query at the end of a long prompt can improve quality by up to 30 percent in its tests, that adaptive thinking reliably drives better performance than extended thinking in internal evaluations, and that some self-check instructions help with coding and maths. The captured text gives no test set, metrics, sample sizes or methods for any of these, so they are claims to verify rather than measured results.

Advice depends on the model. The model table has nine rows, and Claude Opus 4.7, Opus 4.6, Sonnet 4.6 and Haiku 4.5 have no dedicated row, so their guidance is spread through the general sections. Some items differ by model. Claude Opus 5 writes longer responses by default and needs explicit conciseness instructions, while Claude Fable 5.1 writes fewer progress updates and needs them requested. A prompt tuned for one model may need changes on another.

The safety-sensitive blocks need the most care. The page gives separate medication blocks for different models and says to add the one for the model your application calls, exactly as written. Each block deals with medicine for a child, and each tells Claude to defer to the prescription label when a doctor has prescribed the medicine. Three blocks follow the same approach: the one for Claude Fable 5.2, the one shared by Fable 5.1, Fable 5, Opus 5.5, Opus 5, Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 5.5 and Sonnet 5, and the one for Haiku 5.5. Each tells Claude to find the product label with web search where available. If web search is unavailable or the label can't be found, Claude should not give a number from memory, and should point the person to the label's dosing chart, a pharmacist or the child's doctor. These three blocks do not explicitly address a label that the person shares. The Sonnet 4.6 and Haiku 4.5 blocks take a child's dose only from the product label: either an official copy found with web search, or a label the person shares in the conversation. Under these blocks, Claude can report a dose from a label supplied in the conversation even without web search. Without a label in the conversation, Claude states no amount, dose, dosing table or typical range, and points the person to a pharmacist or the child's doctor. The Haiku 5.5 block adds that if someone mentions emotional distress and asks about a dose or limit, Claude should not give the information and should address the distress instead. The Haiku 4.5 block says adults asking about their own medicine get the standard dose as usual.

The payments block tells the agent not to send money itself. The page states that the block guides Claude but does not enforce anything, so a person should approve every call to a tool that can move money. The page also says to test the block on your own tasks, because it can change how Claude handles ordinary work. This analysis tested none of the blocks and does not assess whether they are safe or sufficient.

Many techniques depend on features documented elsewhere, including structured outputs, tool use, the memory tool, computer use, web search, context compaction and effort. The page names them without explaining setup, and several context-awareness prompts assume a harness that compacts context or saves files. Later sections use API terms such as effort, adaptive thinking, thinking blocks and subagents with little plain-language explanation, so beginners using a chat product will find much of the detail hard to apply directly.

reasoning

The page is worth reading because it is Anthropic's consolidated guidance for current Claude models, covering everyday prompt writing and the API features that change how Claude thinks and acts. Its general principles are specific enough to try at once: state the output you want, give the motivation, use examples, and separate parts of the prompt with XML tags. Its migration and agent sections cover problems that otherwise show up late, such as the 400 errors newer models return for a budget_tokens setting or a prefilled final assistant turn.

Overall, the page is a strong reference for people already building on Claude and a useful but incomplete learning source for beginners. Read it as vendor guidance to verify on your own tasks, which is what the page itself recommends. The performance figures it gives are not verified here, and nothing in this analysis shows that its techniques improve results on any given task.

alternatives

The page links to closely related material within Anthropic's documentation: a prompting guide for each model in the table, which the page asks readers to read first for their model; the prompt engineering overview; a migration guide; and pages on effort, thinking, tool use and the models overview. None of these was captured, so their content is not assessed here. For a single model, the dedicated guide is the page's own recommended starting point, though this analysis did not compare the two.

For readers who need only general prompting, the general-principles section can be used without the rest of the page. The evidence does not compare this page with guidance from other AI vendors or with independent prompting courses, so those alternatives are not assessed.

evidence

The evidence is the captured text of Anthropic's page 'Prompting best practices' from https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices.md. It contains the page text, the model table, code samples and sample prompt blocks. The page links to other material, including the per-model prompting guides, but none of it was captured, so it is not assessed here.

The statements in this analysis about the guidance come from that page. Statements about performance come only from the vendor's own claims within it. No independent test results, reviews or reproductions are available, and no code samples, prompts or blocks were run for this analysis.

Access & freshness

costs

The captured text gives no price for the guide and no prices for any Claude model. It links to a models overview that is not part of the capture, so model prices are unknown from this evidence.

The page does name cost and latency effects. Claude Opus 4.6 may think extensively, which can inflate thinking tokens and slow responses, and the controls it suggests are explicit instructions, a lower effort setting or a max_tokens limit. Web search used for medication questions adds latency and search costs. On Claude Opus 5, over-verification adds tokens and latency. Claude Opus 4.6 may spawn subagents where a direct call would do, which the page treats as overuse. Parallel shell commands can bottleneck a system. The captured text puts no money figure on any of these effects, so the real cost of any technique is unknown.

rights

The captured text carries no licence, copyright notice or terms of use. Rights to redistribute this page are therefore unknown, and the evidence does not say how it may be reused, quoted or redistributed. This report does not state a licence. Read the page at its original address: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices.md.

The page includes instruction blocks meant to be copied into system prompts. It says to copy the payments block word for word, and to add the medication block for your model exactly as written. Those directions cover using individual blocks in a prompt. They do not grant permission to copy or redistribute the whole page. The page also links to other material, such as a frontend-design skill file on GitHub and a cookbook recipe, and those are outside this analysis.

freshness

The page was captured on 12 November 2026, the same day as this analysis. The captured text shows no publication or last-updated date. It names models up to Claude Fable 5.2 and Claude Mythos 5.2, uses an API version header of 2026-10-21 in its examples, and marks Claude Sonnet 4.5 as deprecated. Nothing in the captured text says the page is superseded.

The page is a living reference and links to separate model guides, which may be revised independently. The date of the most recent revision and the update schedule are unknown, so readers should check the live page before relying on specific model names, settings or error behaviour.

actions

Beginners should read the general-principles section and try a few changes on a real task: state the output and scope, explain the purpose, add three to five varied examples inside example tags, and separate instructions from input with XML tags. They should not assume the model-specific advice applies to a chat product without checking.

Developers should open the guide for the exact model they call and confirm its model string. Which migration steps apply depends on that model. On Claude 4.7 and later, setting budget_tokens returns a 400 error, so move to adaptive thinking with an effort level. On Opus 4.6 and Sonnet 4.6, budget_tokens still works but is deprecated, and the page advises moving to adaptive thinking rather than requiring it. If the target is a Claude 4.6 model or later, or Claude Mythos Preview, requests with a prefilled final assistant turn return a 400 error. Replace those prefills with direct instructions, structured outputs or tools. Earlier models still accept prefills, and assistant messages elsewhere in the conversation are not affected. Test each sample block on your own tasks before use, and require a person to approve each call to any tool that can move money. If you are considering a medication block, use the one written for your model and check that it fits your product and conditions, since this analysis did not assess it.

Agent builders should create test and progress files early, follow the guidance on subagents and parallel tool calls, and check each instruction's effect on their own workload. Anyone relying on a performance claim from the page should verify it with their own evaluation first.

Evidence for this report

selected-page.txtselected · checked 2026-11-12