Repository Public
1---2title: Prompting best practices3url: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices4description: Comprehensive guide to prompt engineering techniques for Claude's latest models, covering clarity, examples, XML structuring, thinking, and agentic systems.5---67This is the reference for prompt engineering with current Claude models, including Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, Claude Opus 5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, Claude Sonnet 5, Claude Sonnet 4.6, and Claude Haiku 4.5. The page is organized in three parts:89* **[Model-specific guidance](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#model-specific-guidance)** first: where a single model behaves differently and what to change in your prompt.10* **Techniques for all current models** after that: general principles, output and formatting, tool use, thinking, and agentic systems.11* **Migration considerations** last, for prompts moving from earlier generations.1213<Tip>14 For an overview of model capabilities, see the [models overview](https://platform.claude.com/docs/en/models/overview). For Claude Fable 5.1 capabilities and API changes, see [What's new in Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/whats-new-fable-5-1). For Claude Fable 5 capabilities and API changes, see [Introducing Claude Fable 5 and Claude Mythos 5](https://platform.claude.com/docs/en/models/fable-5/introducing-claude-fable-5-and-claude-mythos-5). For details on what's new in Claude Sonnet 5, see [What's new in Claude Sonnet 5](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5). For details on what's new in Claude Opus 5, see [What's new in Claude Opus 5](https://platform.claude.com/docs/en/models/opus-5/whats-new-opus-5). For migration guidance, see the [Migration guide](https://platform.claude.com/docs/en/about-claude/models/migration-guide).15</Tip>1617## Model-specific guidance1819Each of these models has its own prompting page. Read the one for your model first, then the techniques that follow.2021| Model | Guide | What's different |22| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |23| Claude Fable 5.1 and Claude Mythos 5.1 | [Prompting Claude Fable 5.1](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1) | Differences from Claude Fable 5: effort levels, finishing long tasks, user-facing progress updates, passing thinking blocks back unchanged, tool-call batching in agent loops, search triggering at low effort, formatting, and writing density. |24| Claude Fable 5 and Claude Mythos 5 | [Prompting Claude Fable 5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5) | Differences from Claude Opus 4.8: effort levels, instruction following, long-run progress claims, memory systems, and the `reasoning_extraction` refusal category. |25| Claude Sonnet 5 | [Prompting Claude Sonnet 5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5) | Differences from Claude Sonnet 4.6: response length, effort and thinking-depth calibration, tool use triggering, literal instruction following, and design and frontend defaults. |26| Claude Opus 5 | [Prompting Claude Opus 5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5) | Differences from prior Opus models: response length and verbosity, user-facing progress updates, written deliverable length, task scope and over-verification, subagent control, and self-correction. |27| Claude Opus 4.8 | [Prompting Claude Opus 4.8](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-4-8) | Response length, effort and thinking-depth calibration, tool use triggering, literal instruction following, subagent control, and design and frontend defaults. |2829## General principles3031The techniques in this section and the sections that follow apply to current Claude models, including Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, and Claude Mythos 5. Where a technique names a specific model, treat it as measured on that model and re-check it against your own evals before applying it to another.3233### Be clear and direct3435Claude responds well to clear, explicit instructions. Being specific about your desired output can help enhance results. If you want "above and beyond" behavior, explicitly request it rather than relying on the model to infer this from vague prompts.3637Think of Claude as a brilliant but new employee who lacks context on your norms and workflows. The more precisely you explain what you want, the better the result.3839**Golden rule:** Show your prompt to a colleague with minimal context on the task and ask them to follow it. If they'd be confused, Claude will be too.4041* Be specific about the desired output format and constraints.42* Provide instructions as sequential steps using numbered lists or bullet points when the order or completeness of steps matters.4344<Accordion title="Example: Creating an analytics dashboard" defaultOpen>45 **Less effective:**4647 ```text wrap48 Create an analytics dashboard49 ```5051 **More effective:**5253 ```text wrap54 Create an analytics dashboard. Include as many relevant features and interactions as possible. Go beyond the basics to create a fully-featured implementation.55 ```56</Accordion>5758### Add context to improve performance5960Providing context or motivation behind your instructions, such as explaining to Claude why such behavior is important, can help Claude better understand your goals and deliver more targeted responses.6162<Accordion title="Example: Formatting preferences" defaultOpen>63 **Less effective:**6465 ```text wrap66 NEVER use ellipses67 ```6869 **More effective:**7071 ```text wrap72 Your response will be read aloud by a text-to-speech engine, so never use ellipses since the text-to-speech engine will not know how to pronounce them.73 ```74</Accordion>7576Claude is smart enough to generalize from the explanation.7778### Use examples effectively7980Examples are one of the most reliable ways to steer Claude's output format, tone, and structure. A few well-crafted examples (known as few-shot or multishot prompting) improve accuracy and consistency.8182When adding examples, make them:8384* **Relevant:** Mirror your actual use case closely.85* **Diverse:** Cover edge cases and vary enough that Claude doesn't pick up unintended patterns.86* **Structured:** Wrap examples in `<example>` tags (multiple examples in `<examples>` tags) so Claude can distinguish them from instructions.8788<Tip>89 Include 3–5 examples for best results. You can also ask Claude to evaluate your examples for relevance and diversity, or to generate additional ones based on your initial set.90</Tip>9192### Structure prompts with XML tags9394XML tags help Claude parse complex prompts unambiguously, especially when your prompt mixes instructions, context, examples, and variable inputs. Wrapping each type of content in its own tag (for example, `<instructions>`, `<context>`, `<input>`) reduces misinterpretation.9596Best practices:9798* Use consistent, descriptive tag names across your prompts.99* Nest tags when content has a natural hierarchy (documents inside `<documents>`, each inside `<document index="n">`).100101### Give Claude a role102103Setting a role in the system prompt focuses Claude's behavior and tone for your use case. Even a single sentence makes a difference:104105<CodeGroup>106 ```bash cURL107 curl https://api.anthropic.com/v1/messages \108 -H "content-type: application/json" \109 -H "x-api-key: $ANTHROPIC_API_KEY" \110 -H "anthropic-version: 2023-06-01" \111 -d '{112 "model": "claude-opus-5",113 "max_tokens": 1024,114 "system": "You are a helpful coding assistant specializing in Python.",115 "messages": [116 {"role": "user", "content": "How do I sort a list of dictionaries by key?"}117 ]118 }'119 ```120121 ```bash CLI122 ant messages create \123 --model claude-opus-5 \124 --max-tokens 1024 \125 --system "You are a helpful coding assistant specializing in Python." \126 --message '{role: user, content: "How do I sort a list of dictionaries by key?"}'127 ```128129 ```python Python130 client = anthropic.Anthropic()131132 message = client.messages.create(133 model="claude-opus-5",134 max_tokens=1024,135 system="You are a helpful coding assistant specializing in Python.",136 messages=[137 {"role": "user", "content": "How do I sort a list of dictionaries by key?"}138 ],139 )140141 print(message.content)142 ```143144 ```typescript TypeScript145 const client = new Anthropic();146147 const message = await client.messages.create({148 model: "claude-opus-5",149 max_tokens: 1024,150 system: "You are a helpful coding assistant specializing in Python.",151 messages: [{ role: "user", content: "How do I sort a list of dictionaries by key?" }]152 });153154 console.log(message.content);155 ```156157 ```csharp C#158 AnthropicClient client = new();159160 var parameters = new MessageCreateParams161 {162 Model = Model.ClaudeOpus5,163 MaxTokens = 1024,164 System = "You are a helpful coding assistant specializing in Python.",165 Messages =166 [167 new() { Role = Role.User, Content = "How do I sort a list of dictionaries by key?" }168 ]169 };170171 var message = await client.Messages.Create(parameters);172 Console.WriteLine(message);173 ```174175 ```go Go176 client := anthropic.NewClient()177178 message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{179 Model: anthropic.ModelClaudeOpus5,180 MaxTokens: 1024,181 System: []anthropic.TextBlockParam{182 {Text: "You are a helpful coding assistant specializing in Python."},183 },184 Messages: []anthropic.MessageParam{185 anthropic.NewUserMessage(anthropic.NewTextBlock("How do I sort a list of dictionaries by key?")),186 },187 })188 if err != nil {189 log.Fatal(err)190 }191 fmt.Println(message.Content)192 ```193194 ```java Java195 AnthropicClient client = AnthropicOkHttpClient.fromEnv();196197 MessageCreateParams params = MessageCreateParams.builder()198 .model(Model.CLAUDE_OPUS_5)199 .maxTokens(1024)200 .system("You are a helpful coding assistant specializing in Python.")201 .addUserMessage("How do I sort a list of dictionaries by key?")202 .build();203204 Message message = client.messages().create(params);205 System.out.println(message.content());206 ```207208 ```php PHP209 $client = new Client();210211 $message = $client->messages->create(212 maxTokens: 1024,213 messages: [214 ['role' => 'user', 'content' => 'How do I sort a list of dictionaries by key?']215 ],216 model: 'claude-opus-5',217 system: 'You are a helpful coding assistant specializing in Python.',218 );219220 echo json_encode($message->content, JSON_PRETTY_PRINT), PHP_EOL;221 ```222223 ```ruby Ruby224 client = Anthropic::Client.new225226 message = client.messages.create(227 model: "claude-opus-5",228 max_tokens: 1024,229 system: "You are a helpful coding assistant specializing in Python.",230 messages: [231 { role: "user", content: "How do I sort a list of dictionaries by key?" }232 ]233 )234235 puts message.content236 ```237</CodeGroup>238239### Long context prompting240241When working with large documents or data-rich inputs (20k+ tokens), structure your prompt carefully to get the best results:242243* **Put longform data at the top:** Place your long documents and inputs near the top of your prompt, above your query, instructions, and examples. This improves performance across all models.244245 <Note>246 Queries at the end can improve response quality by up to 30 percent in tests, especially with complex, multidocument inputs.247 </Note>248249* **Structure document content and metadata with XML tags:** When using multiple documents, wrap each document in `<document>` tags with `<document_content>` and `<source>` (and other metadata) subtags for clarity.250251 <Accordion title="Example multidocument structure">252 ```xml253 <documents>254 <document index="1">255 <source>annual_report_2023.pdf</source>256 <document_content>257 {{ANNUAL_REPORT}}258 </document_content>259 </document>260 <document index="2">261 <source>competitor_analysis_q2.xlsx</source>262 <document_content>263 {{COMPETITOR_ANALYSIS}}264 </document_content>265 </document>266 </documents>267268 Analyze the annual report and competitor analysis. Identify strategic advantages and recommend Q3 focus areas.269 ```270 </Accordion>271272* **Ground responses in quotes:** For long document tasks, ask Claude to quote relevant parts of the documents first before carrying out its task. This helps Claude focus on the relevant content and ignore the rest of the document.273274 <Accordion title="Example quote extraction">275 ```xml276 You are an AI physician's assistant. Your task is to help doctors diagnose possible patient illnesses.277278 <documents>279 <document index="1">280 <source>patient_symptoms.txt</source>281 <document_content>282 {{PATIENT_SYMPTOMS}}283 </document_content>284 </document>285 <document index="2">286 <source>patient_records.txt</source>287 <document_content>288 {{PATIENT_RECORDS}}289 </document_content>290 </document>291 <document index="3">292 <source>patient01_appt_history.txt</source>293 <document_content>294 {{PATIENT01_APPOINTMENT_HISTORY}}295 </document_content>296 </document>297 </documents>298299 Find quotes from the patient records and appointment history that are relevant to diagnosing the patient's reported symptoms. Place these in <quotes> tags. Then, based on these quotes, list all information that would help the doctor diagnose the patient's symptoms. Place your diagnostic information in <info> tags.300 ```301 </Accordion>302303### Model self-knowledge304305If you would like Claude to identify itself correctly in your application or use specific API strings:306307```text Sample prompt for model identity wrap308The assistant is Claude, created by Anthropic. The current model is Claude Opus 5.309```310311For LLM-powered apps that need to specify model strings:312313```text Sample prompt for model string wrap314When an LLM is needed, please default to Claude Opus 5 unless the user requests315otherwise. The exact model string for Claude Opus 5 is claude-opus-5.316```317318## Output and formatting319320### Communication style and verbosity321322Claude's latest models have a more concise and natural communication style compared to previous models:323324* **More direct and grounded:** Provides fact-based progress reports rather than self-celebratory updates325* **More conversational:** Slightly more fluent and colloquial, less machine-like326* **Less verbose:** May skip detailed summaries for efficiency unless prompted otherwise327328This means Claude may skip verbal summaries after tool calls, jumping directly to the next action. If you prefer more visibility into its reasoning:329330```text Sample prompt wrap331After completing a task that involves tool use, provide a quick summary of the work you've done.332```333334Claude Opus 5 is an exception on verbosity: its default user-facing responses run longer than prior models', and raising or lowering [effort](https://platform.claude.com/docs/en/build-with-claude/effort) does not reliably change visible response length. Prompt explicitly for conciseness instead. See [Prompting Claude Opus 5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5#response-length-and-verbosity) for a sample instruction. Claude Fable 5.1 has the opposite tendency during agentic work: it writes fewer user-facing updates between tool calls. Ask for progress text explicitly, and remove any instruction telling it to keep that text brief. See [Ask for user-facing progress updates](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#ask-for-user-facing-progress-updates).335336### Control the format of responses337338There are a few particularly effective ways to steer output formatting:3393401. **Tell Claude what to do instead of what not to do**341342 * Instead of: "Do not use markdown in your response"343 * Try: "Your response should be composed of smoothly flowing prose paragraphs."3443452. **Use XML format indicators**346347 * Try: "Write the prose sections of your response in \<smoothly\_flowing\_prose\_paragraphs> tags."3483493. **Match your prompt style to the desired output**350351 The formatting style used in your prompt may influence Claude's response style. If you are still experiencing steerability issues with output formatting, try matching your prompt style to your desired output style as closely as possible. For example, removing markdown from your prompt can reduce the volume of markdown in the output.3523534. **Use detailed prompts for specific formatting preferences**354355 For more control over markdown and formatting usage, provide explicit guidance:356357````text Sample prompt to minimize markdown wrap358<avoid_excessive_markdown_and_bullet_points>359When writing reports, documents, technical explanations, analyses, or any long-form360content, write in clear, flowing prose using complete paragraphs and sentences. Use361standard paragraph breaks for organization and reserve markdown primarily for `inline362code`, code blocks (```...```), and simple headings (## and ###). Avoid using **bold**363and *italics*.364365DO NOT use ordered lists (1. ...) or unordered lists (*) unless: a) you're presenting366truly discrete items where a list format is the best option, or b) the user explicitly367requests a list or ranking368369Instead of listing items with bullets or numbers, incorporate them naturally into370sentences. This guidance applies especially to technical writing. Using prose instead of371excessive formatting will improve user satisfaction. NEVER output a series of overly372short bullet points.373374Your goal is readable, flowing text that guides the reader naturally through ideas375rather than fragmenting information into isolated points.376</avoid_excessive_markdown_and_bullet_points>377````378379Claude Fable 5.1 already formats less than earlier models, so on that model a block like this can suppress structure the content needs. Remove it, or replace it with the shorter rule in [Formatting in chat](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#formatting-in-chat).380381### LaTeX output382383Claude's latest models default to LaTeX for mathematical expressions, equations, and technical explanations. If you prefer plain text, add the following instructions to your prompt:384385```text Sample prompt wrap386Format your response in plain text only. Do not use LaTeX, MathJax, or any markup387notation such as \( \), $, or \frac{}{}. Write all math expressions using standard text388characters (e.g., "/" for division, "*" for multiplication, and "^" for exponents).389```390391### Document creation392393Claude's latest models create presentations, animations, and visual documents with strong instruction following, and usually produce usable output on the first try.394395For best results with document creation:396397```text Sample prompt wrap398Create a professional presentation on [topic]. Include thoughtful design elements,399visual hierarchy, and engaging animations where appropriate.400```401402### Migrating away from prefilled responses403404Starting with Claude 4.6 models and [Claude Mythos Preview](https://anthropic.com/glasswing), prefilled responses (providing a partial assistant message for Claude to continue from) on the last assistant turn are no longer supported. Requests with prefilled assistant messages to these models return a 400 error. Model intelligence and instruction following have advanced such that most use cases of prefill no longer require it. Earlier models continue to support prefills, and adding assistant messages elsewhere in the conversation is not affected.405406Here are common prefill scenarios and how to migrate away from them:407408<Accordion title="Controlling output formatting">409 Prefills have been used to force specific output formats like JSON/YAML, classification, and similar patterns where the prefill constrains Claude to a particular structure.410411 **Migration:** The [Structured Outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) feature is designed specifically to constrain Claude's responses to follow a given schema. Try asking the model to conform to your output structure first, as newer models can reliably match complex schemas when told to, especially if implemented with retries. For classification tasks, use either tools with an enum field containing your valid labels or structured outputs.412</Accordion>413414<Accordion title="Eliminating preambles">415 Prefills like `Here is the requested summary:\n` were used to skip introductory text.416417 **Migration:** Use direct instructions in the system prompt: "Respond directly without preamble. Do not start with phrases like 'Here is...', 'Based on...', etc." Alternatively, direct the model to output within XML tags, use structured outputs, or use tool calling. If the occasional preamble slips through, strip it in post-processing.418</Accordion>419420<Accordion title="Avoiding bad refusals">421 Prefills were used to steer around unnecessary refusals.422423 **Migration:** Claude is much better at appropriate refusals now. Clear prompting within the `user` message without prefill should be sufficient.424</Accordion>425426<Accordion title="Continuations">427 Prefills were used to continue partial completions, resume interrupted responses, or pick up where a previous generation left off.428429 **Migration:** Move the continuation to the user message, and include the final text from the interrupted response: "Your previous response was interrupted and ended with \`\[previous\_response]\`. Continue from where you left off." If this is part of error-handling or incomplete-response-handling and there is no UX penalty, retry the request.430</Accordion>431432<Accordion title="Context hydration and role consistency">433 Prefills were used to periodically ensure refreshed or injected context.434435 **Migration:** For very long conversations, inject what were previously prefilled-assistant reminders into the user turn. If context hydration is part of a more complex agentic system, consider hydrating through tools (expose or encourage use of tools containing context based on heuristics such as number of turns) or during [context compaction](https://platform.claude.com/docs/en/build-with-claude/compaction).436</Accordion>437438## Tool use439440### Tool usage441442Claude's latest models are trained for precise instruction following and benefit from explicit direction to use specific tools. If you say "can you suggest some changes," Claude will sometimes provide suggestions rather than implementing them, even if making changes might be what you intended. To learn how to define tools and troubleshoot tool triggering, see [Tool use with Claude](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview).443444For Claude to take action, be more explicit:445446<Accordion title="Example: Explicit instructions" defaultOpen>447 **Less effective (Claude will only suggest):**448449 ```text wrap450 Can you suggest some changes to improve this function?451 ```452453 **More effective (Claude will make the changes):**454455 ```text wrap456 Change this function to improve its performance.457 ```458459 Or:460461 ```text wrap462 Make these edits to the authentication flow.463 ```464</Accordion>465466To make Claude more proactive about taking action by default, you can add this to your system prompt:467468```text Sample prompt for proactive action wrap469<default_to_action>470By default, implement changes rather than only suggesting them. If the user's intent is471unclear, infer the most useful likely action and proceed, using tools to discover any472missing details instead of guessing. Try to infer the user's intent about whether a tool473call (e.g., file edit or read) is intended or not, and act accordingly.474</default_to_action>475```476477On the other hand, if you want the model to be more hesitant by default, less prone to jumping straight into implementations, and only take action if requested, you can steer this behavior with a prompt like the following:478479```text Sample prompt for conservative action wrap480<do_not_act_before_instructions>481Do not jump into implementation or change files unless clearly instructed to make482changes. When the user's intent is ambiguous, default to providing information, doing483research, and providing recommendations rather than taking action. Only proceed with484edits, modifications, or implementations when the user explicitly requests them.485</do_not_act_before_instructions>486```487488Claude Opus 4.5 and Claude Opus 4.6 are also more responsive to the system prompt than previous models. If your prompts were designed to reduce undertriggering on tools or skills, these models may now overtrigger. The fix is to dial back any aggressive language. Where you might have said "CRITICAL: You MUST use this tool when...", you can use more normal prompting like "Use this tool when...".489490### Optimize parallel tool calling491492Claude's latest models run independent tool calls in parallel. These models will:493494* Run multiple speculative searches during research495* Read several files at once to build context faster496* Run bash commands in parallel (which can even bottleneck system performance)497498This behavior is steerable. While the model has a high success rate in parallel tool calling without prompting, you can boost this to \~100% or adjust the aggression level:499500```text Sample prompt for maximum parallel efficiency wrap501<use_parallel_tool_calls>502If you intend to call multiple tools and there are no dependencies between the tool503calls, make all of the independent tool calls in parallel. Prioritize calling tools504simultaneously whenever the actions can be done in parallel rather than sequentially.505For example, when reading 3 files, run 3 tool calls in parallel to read all 3 files into506context at the same time. Maximize use of parallel tool calls where possible to increase507speed and efficiency. However, if some tool calls depend on previous calls to inform508dependent values like the parameters, do NOT call these tools in parallel and instead509call them sequentially. Never use placeholders or guess missing parameters in tool510calls.511</use_parallel_tool_calls>512```513514```text Sample prompt to reduce parallel execution wrap515Execute operations sequentially with brief pauses between each step to ensure stability.516```517518On Claude Fable 5.1 in long agent loops, send the parallel-calls instruction as a turn-scoped system message after each round of tool results. See [Batch independent tool calls in agent loops](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#batch-independent-tool-calls-in-agent-loops).519520## Thinking and reasoning521522### Overthinking and excessive thoroughness523524Claude Opus 4.6 does more upfront exploration than previous models, especially at higher [`effort`](https://platform.claude.com/docs/en/build-with-claude/effort) settings. This initial work often helps to optimize the final results, but the model may gather extensive context or pursue multiple threads of research without being prompted. If your prompts previously encouraged the model to be more thorough, you should tune that guidance for Claude Opus 4.6:525526* **Replace blanket defaults with more targeted instructions.** Instead of "Default to using \[tool]," add guidance like "Use \[tool] when it would enhance your understanding of the problem."527* **Remove over-prompting.** Tools that undertriggered in previous models are likely to trigger appropriately now. Instructions like "If in doubt, use \[tool]" will cause overtriggering.528* **Use effort as a fallback.** If Claude continues to be overly aggressive, use a lower setting for `effort`.529530In some cases, Claude Opus 4.6 may think extensively, which can inflate thinking tokens and slow down responses. If this behavior is undesirable, you can add explicit instructions to constrain its reasoning, or you can lower the `effort` setting to reduce overall thinking and token usage.531532```text Sample prompt wrap533When you're deciding how to approach a problem, choose an approach and commit to it.534Avoid revisiting decisions unless you encounter new information that directly535contradicts your reasoning. If you're weighing two approaches, pick one and see it536through. You can always course-correct later if the chosen approach fails.537```538539If you need a hard ceiling on thinking costs, extended thinking with a `budget_tokens` cap is still functional on Opus 4.6 and Sonnet 4.6 but is deprecated. On Claude 4.7 and later models, setting `budget_tokens` returns a 400 error. Prefer lowering the [effort](https://platform.claude.com/docs/en/build-with-claude/effort) setting or using `max_tokens` as a hard limit with [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking).540541### Leverage thinking & interleaved thinking capabilities542543Claude's latest models offer thinking capabilities that can be especially helpful for tasks involving reflection after tool use or complex multistep reasoning. You can guide its initial or interleaved thinking for better results.544545Claude 4.6 and later models and Claude Mythos Preview use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) (`thinking: {type: "adaptive"}`), where Claude dynamically decides when and how much to think. On Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, and Claude Mythos 5, thinking is always on and adaptive thinking is the only mode. Claude calibrates its thinking based on two factors: the `effort` parameter and query complexity. Higher effort elicits more thinking, and more complex queries do the same. On easier queries that don't require thinking, the model responds directly. In internal evaluations, adaptive thinking reliably drives better performance than extended thinking. Consider moving to adaptive thinking.546547Use adaptive thinking for workloads that require agentic behavior such as multistep tool use, complex coding tasks, and long-horizon agent loops. Older models use manual [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) with `budget_tokens`; see the [per-model configuration table](https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting#supported-models) for which configuration each model accepts.548549You can guide Claude's thinking behavior:550551```text Example prompt wrap552After receiving tool results, carefully reflect on their quality and determine optimal553next steps before proceeding. Use your thinking to plan and iterate based on this new554information, and then take the best next action.555```556557The triggering behavior for adaptive thinking is promptable. If you find the model thinking more often than you'd like, which can happen with large or complex system prompts, add guidance to steer it:558559```text Sample prompt wrap560Thinking adds latency and should only be used when it will meaningfully improve561answer quality - typically for problems that require multistep reasoning. When in562doubt, respond directly.563```564565If you are migrating from [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) with `budget_tokens`, replace your thinking configuration and move budget control to `effort`. The following examples show the same request before and after the migration (see [effort](https://platform.claude.com/docs/en/build-with-claude/effort) for the available levels and per-model availability):566567<CodeGroup>568 ```bash cURL569 # Before: extended thinking with a manual budget (older models)570 curl https://api.anthropic.com/v1/messages \571 -H "content-type: application/json" \572 -H "x-api-key: $ANTHROPIC_API_KEY" \573 -H "anthropic-version: 2023-06-01" \574 -d '{575 "model": "claude-sonnet-4-5-20250929",576 "max_tokens": 16000,577 "thinking": {"type": "enabled", "budget_tokens": 10000},578 "messages": [579 {"role": "user", "content": "..."}580 ]581 }'582583 # After: adaptive thinking with effort584 curl https://api.anthropic.com/v1/messages \585 -H "content-type: application/json" \586 -H "x-api-key: $ANTHROPIC_API_KEY" \587 -H "anthropic-version: 2023-06-01" \588 -d '{589 "model": "claude-opus-4-8",590 "max_tokens": 16000,591 "thinking": {"type": "adaptive"},592 "output_config": {"effort": "high"},593 "messages": [594 {"role": "user", "content": "..."}595 ]596 }'597 ```598599 ```bash CLI600 # Before: extended thinking with a manual budget (older models)601 ant messages create <<'YAML'602 model: claude-sonnet-4-5-20250929603 max_tokens: 16000604 thinking:605 type: enabled606 budget_tokens: 10000607 messages:608 - role: user609 content: "..."610 YAML611612 # After: adaptive thinking with effort613 ant messages create <<'YAML'614 model: claude-opus-4-8615 max_tokens: 16000616 thinking:617 type: adaptive618 output_config:619 effort: high620 messages:621 - role: user622 content: "..."623 YAML624 ```625626 ```python Python627 # Before: extended thinking with a manual budget (older models)628 client.messages.create(629 model="claude-sonnet-4-5-20250929",630 max_tokens=16000,631 thinking={"type": "enabled", "budget_tokens": 10000},632 messages=[{"role": "user", "content": "..."}],633 )634635 # After: adaptive thinking with effort636 client.messages.create(637 model="claude-opus-4-8",638 max_tokens=16000,639 thinking={"type": "adaptive"},640 output_config={"effort": "high"},641 messages=[{"role": "user", "content": "..."}],642 )643 ```644645 ```typescript TypeScript646 // Before: extended thinking with a manual budget (older models)647 await client.messages.create({648 model: "claude-sonnet-4-5-20250929",649 max_tokens: 16000,650 thinking: { type: "enabled", budget_tokens: 10000 },651 messages: [{ role: "user", content: "..." }]652 });653654 // After: adaptive thinking with effort655 await client.messages.create({656 model: "claude-opus-4-8",657 max_tokens: 16000,658 thinking: { type: "adaptive" },659 output_config: { effort: "high" },660 messages: [{ role: "user", content: "..." }]661 });662 ```663664 ```csharp C#665 // Before: extended thinking with a manual budget (older models)666 await client.Messages.Create(new MessageCreateParams667 {668 Model = "claude-sonnet-4-5-20250929",669 MaxTokens = 16000,670 Thinking = new ThinkingConfigEnabled(budgetTokens: 10000),671 Messages = [new() { Role = Role.User, Content = "..." }]672 });673674 // After: adaptive thinking with effort675 await client.Messages.Create(new MessageCreateParams676 {677 Model = Model.ClaudeOpus4_8,678 MaxTokens = 16000,679 Thinking = new ThinkingConfigAdaptive(),680 OutputConfig = new OutputConfig { Effort = Effort.High },681 Messages = [new() { Role = Role.User, Content = "..." }]682 });683 ```684685 ```go Go686 // Before: extended thinking with a manual budget (older models)687 client.Messages.New(ctx, anthropic.MessageNewParams{688 Model: "claude-sonnet-4-5-20250929",689 MaxTokens: 16000,690 Thinking: anthropic.ThinkingConfigParamUnion{691 OfEnabled: &anthropic.ThinkingConfigEnabledParam{BudgetTokens: 10000},692 },693 Messages: []anthropic.MessageParam{694 anthropic.NewUserMessage(anthropic.NewTextBlock("...")),695 },696 })697698 // After: adaptive thinking with effort699 client.Messages.New(ctx, anthropic.MessageNewParams{700 Model: anthropic.ModelClaudeOpus4_8,701 MaxTokens: 16000,702 Thinking: anthropic.ThinkingConfigParamUnion{703 OfAdaptive: &anthropic.ThinkingConfigAdaptiveParam{},704 },705 OutputConfig: anthropic.OutputConfigParam{706 Effort: anthropic.OutputConfigEffortHigh,707 },708 Messages: []anthropic.MessageParam{709 anthropic.NewUserMessage(anthropic.NewTextBlock("...")),710 },711 })712 ```713714 ```java Java715 // Before: extended thinking with a manual budget (older models)716 client.messages().create(MessageCreateParams.builder()717 .model("claude-sonnet-4-5-20250929")718 .maxTokens(16000L)719 .thinking(ThinkingConfigEnabled.builder().budgetTokens(10000L).build())720 .addUserMessage("...")721 .build());722723 // After: adaptive thinking with effort724 client.messages().create(MessageCreateParams.builder()725 .model(Model.CLAUDE_OPUS_4_8)726 .maxTokens(16000L)727 .thinking(ThinkingConfigAdaptive.builder().build())728 .outputConfig(OutputConfig.builder()729 .effort(OutputConfig.Effort.HIGH)730 .build())731 .addUserMessage("...")732 .build());733 ```734735 ```php PHP736 // Before: extended thinking with a manual budget (older models)737 $client->messages->create(738 model: 'claude-sonnet-4-5-20250929',739 maxTokens: 16000,740 thinking: ['type' => 'enabled', 'budget_tokens' => 10000],741 messages: [['role' => 'user', 'content' => '...']],742 );743744 // After: adaptive thinking with effort745 $client->messages->create(746 model: 'claude-opus-4-8',747 maxTokens: 16000,748 thinking: ['type' => 'adaptive'],749 outputConfig: ['effort' => 'high'],750 messages: [['role' => 'user', 'content' => '...']],751 );752 ```753754 ```ruby Ruby755 # Before: extended thinking with a manual budget (older models)756 client.messages.create(757 model: "claude-sonnet-4-5-20250929",758 max_tokens: 16000,759 thinking: { type: "enabled", budget_tokens: 10000 },760 messages: [{ role: "user", content: "..." }]761 )762763 # After: adaptive thinking with effort764 client.messages.create(765 model: "claude-opus-4-8",766 max_tokens: 16000,767 thinking: { type: "adaptive" },768 output_config: { effort: "high" },769 messages: [{ role: "user", content: "..." }]770 )771 ```772</CodeGroup>773774If you are not using extended thinking, no changes are required. On Claude Opus 4.6 through Claude Opus 4.8 and Claude Sonnet 4.6, thinking is off when you omit the `thinking` parameter. On Claude Opus 5 and Claude Sonnet 5, thinking is on by default when you omit the `thinking` parameter. On Claude Opus 5, you can disable it only at effort `high` or lower. On Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, and Claude Mythos 5, thinking is always on, regardless of whether you set the `thinking` parameter.775776* **Prefer general instructions over prescriptive steps.** A prompt like "think thoroughly" often produces better reasoning than a hand-written step-by-step plan. Claude's reasoning frequently exceeds what a human would prescribe.777* **Multishot examples work with thinking.** Use `<thinking>` tags inside your few-shot examples to show Claude the reasoning pattern. It will generalize that style to its own extended thinking blocks.778* **Manual chain-of-thought (CoT) prompting as a fallback.** When thinking is off, you can still encourage step-by-step reasoning by asking Claude to think through the problem. Use structured tags like `<thinking>` and `<answer>` to cleanly separate reasoning from the final output. On Claude Opus 5, prefer keeping thinking enabled at a lower effort level instead: with thinking disabled, the model can occasionally emit internal XML tags into its visible output, so see [Running with thinking disabled](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5#running-with-thinking-disabled) before applying this pattern there.779* **Ask Claude to self-check.** Append something like "Before you finish, verify your answer against \[test criteria]." This catches errors reliably, especially for coding and math. Claude Opus 5 is the exception: it verifies its own work well without explicit instruction, and verification instructions carried over from prompts tuned for earlier models can cause over-verification, adding tokens and latency. When migrating to Claude Opus 5, remove these instructions rather than rewriting them. See [Task scope and over-verification](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5#task-scope-and-over-verification).780781<Note>782 When extended thinking is disabled, Claude Opus 4.5 is particularly sensitive to the word "think" and its variants. Consider using alternatives like "consider," "evaluate," or "reason through" in those cases.783</Note>784785<Info>786 For more information on thinking capabilities, see [Thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) and [Steering thinking](https://platform.claude.com/docs/en/build-with-claude/thinking-steering-and-cost).787</Info>788789## Agentic systems790791### Long-horizon reasoning and state tracking792793Claude's latest models handle long-horizon reasoning tasks with strong state tracking. Claude maintains orientation across extended sessions by focusing on incremental progress, making steady advances on a few things at a time rather than attempting everything at once. This capability especially emerges over multiple context windows or task iterations, where Claude can work on a complex task, save the state, and continue with a fresh context window.794795#### Context awareness and multiwindow workflows796797Claude Sonnet 5, Claude Sonnet 4.6, Claude Sonnet 4.5, and Claude Haiku 4.5 feature [context awareness](https://platform.claude.com/docs/en/build-with-claude/context-windows#context-awareness), enabling the model to track its remaining context window (that is, its "token budget") throughout a conversation. This enables Claude to execute tasks and manage context more effectively by understanding how much space it has to work.798799**Managing context limits:**800801If you are using Claude in an agent harness that compacts context or allows saving context to external files (like in Claude Code), consider adding this information to your prompt so Claude can behave accordingly. Otherwise, Claude may sometimes naturally try to wrap up work as it approaches the context limit. The following is an example prompt:802803```text Sample prompt wrap804Your context window will be automatically compacted as it approaches its limit, allowing805you to continue working indefinitely from where you left off. Therefore, do not stop806tasks early due to token budget concerns. As you approach your token budget limit, save807your current progress and state to memory before the context window refreshes. Always be808as persistent and autonomous as possible and complete tasks fully, even if the end of809your budget is approaching. Never artificially stop any task early regardless of the810context remaining.811```812813The [memory tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool) pairs well with context awareness for managing context transitions.814815#### Workflows across multiple context windows816817For tasks spanning multiple context windows:8188191. **Use a different prompt for the very first context window:** Use the first context window to set up a framework (write tests, create setup scripts), then use future context windows to iterate on a todo-list.8208212. **Have the model write tests in a structured format:** Ask Claude to create tests before starting work and keep track of them in a structured format (for example, `tests.json`). This leads to better long-term ability to iterate. Remind Claude of the importance of tests: "It is unacceptable to remove or edit tests because this could lead to missing or buggy functionality."8228233. **Set up quality of life tools:** Encourage Claude to create setup scripts (for example, `init.sh`) to gracefully start servers, run test suites, and linters. This prevents repeated work when continuing from a fresh context window.8248254. **Starting fresh versus compacting:** When a context window is cleared, consider starting with a brand new context window rather than using compaction. Claude's latest models are extremely effective at discovering state from the local filesystem. In some cases, you may want to take advantage of this over compaction. Be prescriptive about how it should start:826827 * "Call pwd; you can only read and write files in this directory."828 * "Review progress.txt, tests.json, and the git logs."829 * "Manually run through a fundamental integration test before moving on to implementing new features."8308315. **Provide verification tools:** As the length of autonomous tasks grows, Claude needs to verify correctness without continuous human feedback. Tools that let Claude verify UI work are helpful, such as the [computer use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool), the [browser use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/browser-use-tool), or a browser automation MCP server.8328336. **Encourage complete usage of context:** Prompt Claude to efficiently complete components before moving on:834835```text Sample prompt wrap836This is a very long task, so it may be beneficial to plan out your work clearly. It's837encouraged to spend your entire output context working on the task - just make sure you838don't run out of context with significant uncommitted work. Continue working839systematically until you have completed this task.840```841842#### State management best practices843844* **Use structured formats for state data:** When tracking structured information (like test results or task status), use JSON or other structured formats to help Claude understand schema requirements.845* **Use unstructured text for progress notes:** Freeform progress notes work well for tracking general progress and context.846* **Use git for state tracking:** Git provides a log of what's been done and checkpoints that can be restored. Claude's latest models perform especially well in using git to track state across multiple sessions.847* **Emphasize incremental progress:** Explicitly ask Claude to keep track of its progress and focus on incremental work.848849<Accordion title="Example: State tracking">850 ```json tests.json851 {852 "tests": [853 { "id": 1, "name": "authentication_flow", "status": "passing" },854 { "id": 2, "name": "user_management", "status": "failing" },855 { "id": 3, "name": "api_endpoints", "status": "not_started" }856 ],857 "total": 200,858 "passing": 150,859 "failing": 25,860 "not_started": 25861 }862 ```863864 ```text wrap865 // Progress notes (progress.txt)866 Session 3 progress:867 - Fixed authentication token validation868 - Updated user model to handle edge cases869 - Next: investigate user_management test failures (test #2)870 - Note: Do not remove tests as this could lead to missing functionality871 ```872</Accordion>873874### Balancing autonomy and safety875876Without guidance, Claude Opus 4.6 may take actions that are difficult to reverse or affect shared systems, such as deleting files, force-pushing, or posting to external services. If you want Claude Opus 4.6 to confirm before taking potentially risky actions, add guidance to your prompt:877878```text Sample prompt wrap879Consider the reversibility and potential impact of your actions. You are encouraged to880take local, reversible actions like editing files or running tests, but for actions that881are hard to reverse, affect shared systems, or could be destructive, ask the user before882proceeding.883884Examples of actions that warrant confirmation:885- Destructive operations: deleting files or branches, dropping database tables, rm -rf886- Hard to reverse operations: git push --force, git reset --hard, amending published commits887- Operations visible to others: pushing code, commenting on PRs/issues, sending888messages, modifying shared infrastructure889890When encountering obstacles, do not use destructive actions as a shortcut. For example,891don't bypass safety checks (e.g. --no-verify) or discard unfamiliar files that may be892in-progress work.893```894895### Research and information gathering896897Claude's latest models can find and synthesize information from multiple sources effectively. For optimal research results:8988991. **Provide clear success criteria:** Define what constitutes a successful answer to your research question.9009012. **Encourage source verification:** Ask Claude to verify information across multiple sources.9029033. **For complex research tasks, use a structured approach:**904905```text Sample prompt for complex research wrap906Search for this information in a structured way. As you gather data, develop several907competing hypotheses. Track your confidence levels in your progress notes to improve908calibration. Regularly self-critique your approach and plan. Update a hypothesis tree or909research notes file to persist information and provide transparency. Break down this910complex research task systematically.911```912913This structured approach helps Claude work through large corpora methodically and iteratively critique its findings.914915### Subagent orchestration916917Claude's latest models orchestrate subagents natively. These models can recognize when tasks would benefit from delegating work to specialized subagents and do so proactively without requiring explicit instruction.918919To take advantage of this behavior:9209211. **Ensure well-defined subagent tools:** Have subagent tools available and described in tool definitions.9222. **Let Claude orchestrate naturally:** Claude will delegate appropriately without explicit instruction.9233. **Watch for overuse:** Claude Opus 4.6 has a strong predilection for subagents and may spawn them in situations where a simpler, direct approach would suffice. For example, the model may spawn subagents for code exploration when a direct grep call is faster and sufficient. Claude Opus 5 also delegates to subagents more readily than prior models; see [Controlling subagent spawning](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5#controlling-subagent-spawning) for guidance and a sample damping prompt.924925If you're seeing excessive subagent use, add explicit guidance about when subagents are and aren't warranted:926927```text Sample prompt for subagent usage wrap928Use subagents when tasks can run in parallel, require isolated context, or involve929independent workstreams that don't need to share state. For simple tasks, sequential930operations, single-file edits, or tasks where you need to maintain context across steps,931work directly rather than delegating.932```933934### Chain complex prompts935936With adaptive thinking and subagent orchestration, Claude handles most multistep reasoning internally. Explicit prompt chaining (breaking a task into sequential API calls) is still useful when you need to inspect intermediate outputs or enforce a specific pipeline structure.937938The most common chaining pattern is **self-correction:** generate a draft → have Claude review it against criteria → have Claude refine based on the review. Each step is a separate API call so you can log, evaluate, or branch at any point.939940### Reduce file creation in agentic coding941942Claude's latest models may sometimes create new files for testing and iteration purposes, particularly when working with code. This approach allows Claude to use files, especially Python scripts, as a 'temporary scratchpad' before saving its final output. Using temporary files can improve outcomes particularly for agentic coding use cases.943944If you'd prefer to minimize net new file creation, you can instruct Claude to clean up after itself:945946```text Sample prompt wrap947If you create any temporary new files, scripts, or helper files for iteration, clean up948these files by removing them at the end of the task.949```950951### Overeagerness952953Claude Opus 4.5 and Claude Opus 4.6 have a tendency to overengineer by creating extra files, adding unnecessary abstractions, or building in flexibility that wasn't requested. If you're seeing this undesired behavior, add specific guidance to keep solutions minimal.954955For example:956957```text Sample prompt to minimize overengineering wrap958Avoid over-engineering. Only make changes that are directly requested or clearly959necessary. Keep solutions simple and focused:960961- Scope: Don't add features, refactor code, or make "improvements" beyond what was962asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need963extra configurability.964965- Documentation: Don't add docstrings, comments, or type annotations to code you didn't966change. Only add comments where the logic isn't self-evident.967968- Defensive coding: Don't add error handling, fallbacks, or validation for scenarios969that can't happen. Trust internal code and framework guarantees. Only validate at system970boundaries (user input, external APIs).971972- Abstractions: Don't create helpers, utilities, or abstractions for one-time973operations. Don't design for hypothetical future requirements. The right amount of974complexity is the minimum needed for the current task.975```976977### Avoid focusing on passing tests and hardcoding978979Claude can sometimes focus too heavily on making tests pass at the expense of more general solutions, or may use workarounds like helper scripts for complex refactoring instead of using standard tools directly. To prevent this behavior and get solutions that generalize:980981```text Sample prompt wrap982Please write a high-quality, general-purpose solution using the standard tools983available. Do not create helper scripts or workarounds to accomplish the task more984efficiently. Implement a solution that works correctly for all valid inputs, not just985the test cases. Do not hard-code values or create solutions that only work for specific986test inputs. Instead, implement the actual logic that solves the problem generally.987988Focus on understanding the problem requirements and implementing the correct algorithm.989Tests are there to verify correctness, not to define the solution. Provide a principled990implementation that follows best practices and software design principles.991992If the task is unreasonable or infeasible, or if any of the tests are incorrect, please993inform me rather than working around them. The solution should be robust, maintainable,994and extendable.995```996997### Minimizing hallucinations in agentic coding998999Claude's latest models are less prone to hallucinations and give more accurate, grounded, intelligent answers based on the code. To encourage this behavior even more and minimize hallucinations:10001001```text Sample prompt wrap1002<investigate_before_answering>1003Never speculate about code you have not opened. If the user references a specific file,1004you MUST read the file before answering. Make sure to investigate and read relevant1005files BEFORE answering questions about the codebase. Never make any claims about code1006before investigating unless you are certain of the correct answer - give grounded and1007hallucination-free answers.1008</investigate_before_answering>1009```10101011## Capability-specific tips10121013### Improved vision capabilities10141015Claude Opus 4.5 and Claude Opus 4.6 have improved vision capabilities compared to previous Claude models. They perform better on image processing and data extraction tasks, particularly when there are multiple images present in context. These improvements carry over to computer use, where the models can more reliably interpret screenshots and UI elements. You can also use these models to analyze videos by breaking them up into frames.10161017One technique that has proven effective to further boost performance is to give Claude a crop tool or [agent skill](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview). Testing has shown consistent uplift on image evaluations when Claude is able to "zoom" in on relevant regions of an image. Anthropic has created a [recipe for the crop tool](https://platform.claude.com/cookbook/multimodal-crop-tool).10181019### Frontend design10201021Claude Opus 4.5 and Claude Opus 4.6 build complex, real-world web applications with strong frontend design. However, without guidance, models can default to generic patterns that create what users call the "AI slop" aesthetic. To create distinctive, creative frontends that surprise and delight:10221023<Tip>1024 For a detailed guide on improving frontend design, see the blog post on [improving frontend design through skills](https://www.claude.com/blog/improving-frontend-design-through-skills).1025</Tip>10261027For frontend design work outside the API, [Claude Design](https://support.claude.com/en/articles/14604416-get-started-with-claude-design) provides a canvas and design tools where Claude generates and iterates on designs interactively.10281029Here's a system prompt snippet you can use to encourage better frontend design:10301031```text Sample prompt for frontend aesthetics wrap1032<frontend_aesthetics>1033You tend to converge toward generic, "on distribution" outputs. In frontend design, this1034creates what users call the "AI slop" aesthetic. Avoid this: make creative, distinctive1035frontends that surprise and delight.10361037Focus on:1038- Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic1039fonts like Arial and Inter; opt instead for distinctive choices that elevate the1040frontend's aesthetics.1041- Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency.1042Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Draw1043from IDE themes and cultural aesthetics for inspiration.1044- Motion: Use animations for effects and micro-interactions. Prioritize CSS-only1045solutions for HTML. Use Motion library for React when available. Focus on high-impact1046moments: one well-orchestrated page load with staggered reveals (animation-delay)1047creates more delight than scattered micro-interactions.1048- Backgrounds: Create atmosphere and depth rather than defaulting to solid colors. Layer1049CSS gradients, use geometric patterns, or add contextual effects that match the overall1050aesthetic.10511052Avoid generic AI-generated aesthetics:1053- Overused font families (Inter, Roboto, Arial, system fonts)1054- Clichéd color schemes (particularly purple gradients on white backgrounds)1055- Predictable layouts and component patterns1056- Cookie-cutter design that lacks context-specific character10571058Interpret creatively and make unexpected choices that feel genuinely designed for the1059context. Vary between light and dark themes, different fonts, different aesthetics. You1060still tend to converge on common choices (Space Grotesk, for example) across1061generations. Avoid this: it is critical that you think outside the box!1062</frontend_aesthetics>1063```10641065You can also refer to the [full skill definition](https://github.com/anthropics/claude-code/blob/main/plugins/frontend-design/skills/frontend-design/SKILL.md).10661067## Migration considerations10681069When migrating to current Claude models from earlier generations:107010711. **Be specific about desired behavior:** Consider describing exactly what you'd like to see in the output.107210732. **Frame your instructions with modifiers:** Adding modifiers that encourage Claude to increase the quality and detail of its output can help better shape Claude's performance. For example, instead of "Create an analytics dashboard", use "Create an analytics dashboard. Include as many relevant features and interactions as possible. Go beyond the basics to create a fully-featured implementation."107410753. **Request specific features explicitly:** Animations and interactive elements should be requested explicitly when desired.107610774. **Update thinking configuration:** Claude 4.6 models use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) (`thinking: {type: "adaptive"}`) instead of manual thinking with `budget_tokens`. Use the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) to control thinking depth.107810795. **Migrate away from prefilled responses:** Prefilled responses on the last assistant turn are no longer supported starting with Claude 4.6 models and Claude Mythos Preview. See [Migrating away from prefilled responses](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#migrating-away-from-prefilled-responses) for detailed guidance on alternatives.108010816. **Tune anti-laziness prompting:** If your prompts previously encouraged the model to be more thorough or use tools more aggressively, dial back that guidance. Claude 4.6 models are more proactive and may overtrigger on instructions that were needed for previous models.108210837. **Pass thinking blocks back unchanged and keep history append-only:** Append each assistant turn exactly as the API returned it, thinking blocks included. On Claude Fable 5.1, [modifying the conversation before a thinking block](https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-in-conversation) results in an error, or in the block being dropped if you opt into that: editing earlier messages, rebuilding `system` or `tools`, or summarizing older turns in place between requests invalidates every later thinking block, so move those changes to mid-conversation system messages and server-side context management. See [Keep the conversation history append-only](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#keep-the-conversation-history-append-only).10841085For detailed migration steps, see the [Migration guide](https://platform.claude.com/docs/en/about-claude/models/migration-guide).10861087### Migrating to Claude Sonnet 5 from Claude Sonnet 4.5 or earlier10881089See [Migrating to Claude Sonnet 5 from Claude Sonnet 4.5 or earlier](https://platform.claude.com/docs/en/models/sonnet-5/migration-guide#migrating-from-sonnet-45) in the migration guide, which covers the effort default change and the removal of manual extended thinking (`budget_tokens`).10901091## Next steps10921093<CardGroup cols={2}>1094 <Card title="Prompting Claude Fable 5.1" icon="terminal" href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1">1095 Behavioral differences and prompting patterns for Claude Fable 5.1, covering effort, task completion, progress updates, thinking blocks, tool-call batching, and writing style.1096 </Card>10971098 <Card title="Prompting Claude Fable 5" icon="terminal" href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5">1099 Behavioral differences and prompting patterns for Claude Fable 5 and Claude Mythos 5, covering effort, instruction following, long runs, memory, and scaffolding changes.1100 </Card>11011102 <Card title="Prompting Claude Sonnet 5" icon="terminal" href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5">1103 Behavioral differences and prompting patterns for Claude Sonnet 5, covering effort, adaptive thinking defaults, tool use, and migration from Claude Sonnet 4.6.1104 </Card>11051106 <Card title="Prompting Claude Opus 5" icon="terminal" href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5">1107 Behavioral differences and prompting patterns for Claude Opus 5, covering response verbosity, agentic narration, task scoping, subagent delegation, and self-correction.1108 </Card>11091110 <Card title="Prompt engineering overview" icon="edit" href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview">1111 When to use prompt engineering and how to plan your approach before tuning prompts.1112 </Card>1113</CardGroup>1114