这是使用 Claude 最新模型进行提示工程的参考文档,包括 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 和 Claude Haiku 4.5。本页面分为三个部分:
有关模型能力的概述,请参阅模型概述。有关 Claude Fable 5 的能力和 API 变更,请参阅 Claude Fable 5 和 Claude Mythos 5 介绍。有关 Claude Sonnet 5 新功能的详细信息,请参阅 Claude Sonnet 5 新功能。有关 Claude Opus 5 新功能的详细信息,请参阅 Claude Opus 5 新功能。有关迁移指南,请参阅迁移指南。
Claude Fable 5 和 Claude Mythos 5 的提示指南有其专属页面:为 Claude Fable 5 编写提示。该页面涵盖了与 Claude Opus 4.8 的行为差异以及值得进行的提示和脚手架更改,包括努力程度、指令遵循、长时间运行的进度声明、记忆系统以及 reasoning_extraction 拒绝类别。
Claude Sonnet 5 的提示指南有其专属页面:为 Claude Sonnet 5 编写提示。该页面涵盖了与 Claude Sonnet 4.6 的行为差异以及值得进行的提示更改,包括响应长度、努力程度和思考深度校准、工具使用触发、字面指令遵循以及设计和前端默认行为。
Claude Opus 5 的提示指南有其专属页面:为 Claude Opus 5 编写提示。该页面涵盖了与先前 Opus 模型的行为差异以及值得进行的提示更改,包括响应长度和冗长程度、面向用户的进度更新、书面交付物长度、任务范围和过度验证、子智能体控制以及自我纠正。
Claude Opus 4.8 的提示指南有其专属页面:为 Claude Opus 4.8 编写提示。该页面涵盖了响应长度、努力程度和思考深度校准、工具使用触发、字面指令遵循、子智能体控制以及设计和前端默认行为。
本节及后续各节中的技术适用于所有当前的 Claude 模型,包括 Claude Fable 5 和 Claude Mythos 5。
Claude 对清晰、明确的指令响应良好。明确说明您期望的输出有助于提升结果。如果您希望获得"超出预期"的行为,请明确提出要求,而不是依赖模型从模糊的提示中推断。
把 Claude 想象成一位才华横溢但刚入职的新员工,他对您的规范和工作流程缺乏了解。您解释得越精确,结果就越好。
**黄金法则:**把您的提示展示给一位对任务了解甚少的同事,让他们按照提示操作。如果他们会感到困惑,Claude 也会。
提供指令背后的上下文或动机,例如向 Claude 解释为什么这种行为很重要,可以帮助 Claude 更好地理解您的目标并提供更有针对性的响应。
Claude 足够聪明,能够从解释中进行泛化。
示例是引导 Claude 输出格式、语气和结构最可靠的方法之一。几个精心设计的示例(称为 few-shot 或 multishot 提示)可以提高准确性和一致性。
添加示例时,请确保它们:
<example> 标签中(多个示例放在 <examples> 标签中),以便 Claude 将它们与指令区分开来。XML 标签帮助 Claude 无歧义地解析复杂提示,尤其是当您的提示混合了指令、上下文、示例和变量输入时。将每种类型的内容包裹在各自的标签中(例如 <instructions>、<context>、<input>)可以减少误解。
最佳实践:
<documents> 内,每个文档放在 <document index="n"> 内)。在系统提示中设定角色可以使 Claude 的行为和语气聚焦于您的用例。即使只有一句话也能产生差异:
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-opus-5",
max_tokens=1024,
system="You are a helpful coding assistant specializing in Python.",
messages=[
{"role": "user", "content": "How do I sort a list of dictionaries by key?"}
],
)
print(message.content)在处理大型文档或数据密集型输入(20k+ 令牌)时,请仔细构建您的提示结构以获得最佳结果:
**将长篇数据放在顶部:**将您的长文档和输入放在提示的顶部附近,位于您的查询、指令和示例之上。这可以提升所有模型的性能。
**使用 XML 标签构建文档内容和元数据:**使用多个文档时,将每个文档包裹在 <document> 标签中,并使用 <document_content> 和 <source>(以及其他元数据)子标签以保持清晰。
**让响应基于引用:**对于长文档任务,让 Claude 在执行任务之前先引用文档中的相关部分。这有助于 Claude 专注于相关内容并忽略文档的其余部分。
如果您希望 Claude 在您的应用程序中正确标识自己或使用特定的 API 字符串:
The assistant is Claude, created by Anthropic. The current model is Claude Opus 5.对于需要指定模型字符串的 LLM 驱动的应用:
When an LLM is needed, please default to Claude Opus 5 unless the user requests
otherwise. The exact model string for Claude Opus 5 is claude-opus-5.与之前的模型相比,Claude 的最新模型具有更简洁、更自然的沟通风格:
这意味着 Claude 可能会在工具调用后跳过口头总结,直接进入下一个操作。如果您希望更清楚地了解其推理过程:
After completing a task that involves tool use, provide a quick summary of the work you've done.Claude Opus 5 在冗长程度方面是个例外:其默认的面向用户的响应比先前模型更长,并且提高或降低 effort 并不能可靠地改变可见响应的长度。请改为明确提示要求简洁。有关示例指令,请参阅为 Claude Opus 5 编写提示。
有几种特别有效的方法可以引导输出格式:
告诉 Claude 该做什么,而不是不该做什么
使用 XML 格式指示符
使您的提示风格与期望的输出相匹配
您提示中使用的格式风格可能会影响 Claude 的响应风格。如果您在输出格式的可引导性方面仍然遇到问题,请尝试使您的提示风格尽可能接近您期望的输出风格。例如,从提示中移除 markdown 可以减少输出中 markdown 的数量。
对特定格式偏好使用详细提示
要更好地控制 markdown 和格式的使用,请提供明确的指导:
<avoid_excessive_markdown_and_bullet_points>
When writing reports, documents, technical explanations, analyses, or any long-form
content, write in clear, flowing prose using complete paragraphs and sentences. Use
standard paragraph breaks for organization and reserve markdown primarily for `inline
code`, code blocks (```...```), and simple headings (## and ###). Avoid using **bold**
and *italics*.
DO NOT use ordered lists (1. ...) or unordered lists (*) unless: a) you're presenting
truly discrete items where a list format is the best option, or b) the user explicitly
requests a list or ranking
Instead of listing items with bullets or numbers, incorporate them naturally into
sentences. This guidance applies especially to technical writing. Using prose instead of
excessive formatting will improve user satisfaction. NEVER output a series of overly
short bullet points.
Your goal is readable, flowing text that guides the reader naturally through ideas
rather than fragmenting information into isolated points.
</avoid_excessive_markdown_and_bullet_points>Claude 的最新模型默认使用 LaTeX 来表示数学表达式、方程式和技术解释。如果您更喜欢纯文本,请在提示中添加以下指令:
Format your response in plain text only. Do not use LaTeX, MathJax, or any markup
notation such as \( \), $, or \frac{}{}. Write all math expressions using standard text
characters (e.g., "/" for division, "*" for multiplication, and "^" for exponents).Claude 的最新模型在创建演示文稿、动画和可视化文档时具有很强的指令遵循能力,通常在第一次尝试时就能产生可用的输出。
要在文档创建中获得最佳结果:
Create a professional presentation on [topic]. Include thoughtful design elements,
visual hierarchy, and engaging animations where appropriate.从 Claude 4.6 模型和 Claude Mythos Preview 开始,不再支持在最后一个助手轮次上使用预填充响应(提供部分助手消息供 Claude 继续)。向这些模型发送带有预填充助手消息的请求会返回 400 错误。模型的智能和指令遵循能力已经进步到大多数预填充用例不再需要它的程度。早期模型继续支持预填充,并且在对话的其他位置添加助手消息不受影响。
以下是常见的预填充场景以及如何从中迁移:
Claude 的最新模型经过训练可以精确遵循指令,并且受益于使用特定工具的明确指示。如果您说"你能建议一些更改吗",Claude 有时会提供建议而不是实施它们,即使进行更改可能是您的本意。有关如何定义工具和排查工具触发问题,请参阅使用 Claude 进行工具使用。
要让 Claude 采取行动,请更加明确:
要让 Claude 默认更主动地采取行动,您可以将以下内容添加到系统提示中:
<default_to_action>
By default, implement changes rather than only suggesting them. If the user's intent is
unclear, infer the most useful likely action and proceed, using tools to discover any
missing details instead of guessing. Try to infer the user's intent about whether a tool
call (e.g., file edit or read) is intended or not, and act accordingly.
</default_to_action>另一方面,如果您希望模型默认更加谨慎,不那么倾向于直接开始实施,并且只在被要求时才采取行动,您可以使用如下提示来引导这种行为:
<do_not_act_before_instructions>
Do not jump into implementation or change files unless clearly instructed to make
changes. When the user's intent is ambiguous, default to providing information, doing
research, and providing recommendations rather than taking action. Only proceed with
edits, modifications, or implementations when the user explicitly requests them.
</do_not_act_before_instructions>Claude Opus 4.5 和 Claude Opus 4.6 对系统提示的响应也比以前的模型更敏感。如果您的提示是为了减少工具或技能的触发不足而设计的,这些模型现在可能会过度触发。解决方法是减弱任何激进的措辞。以前您可能会说"CRITICAL: You MUST use this tool when...",现在可以使用更平常的提示,如"Use this tool when..."。
Claude 的最新模型会并行运行独立的工具调用。这些模型会:
这种行为是可引导的。虽然模型在没有提示的情况下并行工具调用的成功率很高,但您可以将其提升到约 100% 或调整激进程度:
<use_parallel_tool_calls>
If you intend to call multiple tools and there are no dependencies between the tool
calls, make all of the independent tool calls in parallel. Prioritize calling tools
simultaneously whenever the actions can be done in parallel rather than sequentially.
For example, when reading 3 files, run 3 tool calls in parallel to read all 3 files into
context at the same time. Maximize use of parallel tool calls where possible to increase
speed and efficiency. However, if some tool calls depend on previous calls to inform
dependent values like the parameters, do NOT call these tools in parallel and instead
call them sequentially. Never use placeholders or guess missing parameters in tool
calls.
</use_parallel_tool_calls>Execute operations sequentially with brief pauses between each step to ensure stability.Claude Opus 4.6 比以前的模型进行更多的前期探索,尤其是在较高的 effort 设置下。这种初始工作通常有助于优化最终结果,但模型可能会在没有提示的情况下收集大量上下文或追踪多条研究线索。如果您的提示以前鼓励模型更加彻底,您应该为 Claude Opus 4.6 调整该指导:
effort 使用较低的设置。在某些情况下,Claude Opus 4.6 可能会进行大量思考,这会增加思考令牌并减慢响应速度。如果不希望出现这种行为,您可以添加明确的指令来约束其推理,或者降低 effort 设置以减少整体思考和令牌使用量。
When you're deciding how to approach a problem, choose an approach and commit to it.
Avoid revisiting decisions unless you encounter new information that directly
contradicts your reasoning. If you're weighing two approaches, pick one and see it
through. You can always course-correct later if the chosen approach fails.如果您需要对思考成本设置硬性上限,带有 budget_tokens 上限的扩展思考在 Opus 4.6 和 Sonnet 4.6 上仍然可用,但已被弃用。在 Claude 4.7 及更高版本的模型上,设置 budget_tokens 会返回 400 错误。建议降低 effort 设置,或在使用自适应思考时将 max_tokens 作为硬性限制。
Claude 的最新模型提供的思考能力对于涉及工具使用后反思或复杂多步推理的任务特别有帮助。您可以引导其初始思考或交错思考以获得更好的结果。
Claude 4.6 及更高版本的模型和 Claude Mythos Preview 使用自适应思考(thinking: {type: "adaptive"}),Claude 会动态决定何时思考以及思考多少。在 Claude Fable 5 和 Claude Mythos 5 上,思考始终开启,自适应思考是唯一的模式。Claude 根据两个因素校准其思考:effort 参数和查询复杂度。更高的 effort 会引发更多思考,更复杂的查询也是如此。对于不需要思考的简单查询,模型会直接响应。在内部评估中,自适应思考可靠地带来比扩展思考更好的性能。请考虑迁移到自适应思考以获得最智能的响应。
对于需要智能体行为的工作负载(如多步工具使用、复杂编码任务和长时程智能体循环),请使用自适应思考。较旧的模型使用带有 budget_tokens 的手动扩展思考;请参阅各模型配置表了解每个模型接受哪种配置。
您可以引导 Claude 的思考行为:
After receiving tool results, carefully reflect on their quality and determine optimal
next steps before proceeding. Use your thinking to plan and iterate based on this new
information, and then take the best next action.自适应思考的触发行为是可以通过提示控制的。如果您发现模型思考的频率比您希望的更高(这在使用大型或复杂的系统提示时可能发生),请添加指导来引导它:
Thinking adds latency and should only be used when it will meaningfully improve
answer quality - typically for problems that require multistep reasoning. When in
doubt, respond directly.如果您正在从带有 budget_tokens 的扩展思考迁移,请替换您的思考配置并将预算控制移至 effort。以下示例展示了迁移前后的同一请求(有关可用级别和各模型的可用性,请参阅 effort):
# 之前:使用手动预算的扩展思考(较旧的模型)
client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=16000,
thinking={"type": "enabled", "budget_tokens": 10000},
messages=[{"role": "user", "content": "..."}],
)
# 之后:使用 effort 的自适应思考
client.messages.create(
model="claude-opus-4-8",
max_tokens=16000,
thinking={"type": "adaptive"},
output_config={"effort": "high"},
messages=[{"role": "user", "content": "..."}],
)如果您没有使用扩展思考,则无需进行任何更改。在 Claude Opus 4.6 到 Claude Opus 4.8 以及 Claude Sonnet 4.6 上,省略 thinking 参数时思考是关闭的。在 Claude Opus 5 和 Claude Sonnet 5 上,省略 thinking 参数时思考默认开启;在 Claude Opus 5 上,只有在 effort 为 high 或更低时才能禁用它。在 Claude Fable 5 和 Claude Mythos 5 上,无论您是否设置 thinking 参数,思考始终开启。
<thinking> 标签向 Claude 展示推理模式。它会将这种风格泛化到自己的扩展思考块中。<thinking> 和 <answer> 这样的结构化标签来清晰地将推理与最终输出分开。在 Claude Opus 5 上,建议改为在较低的 effort 级别下保持思考启用:禁用思考后,模型偶尔会将内部 XML 标签输出到其可见输出中,因此在那里应用此模式之前,请参阅在禁用思考的情况下运行。Claude 的最新模型能够以强大的状态跟踪能力处理长时程推理任务。Claude 通过专注于增量进展,在扩展会话中保持方向感,每次稳步推进少数几件事,而不是试图一次完成所有事情。这种能力在跨越多个上下文窗口或任务迭代时尤为突出,Claude 可以处理复杂任务、保存状态,然后使用新的上下文窗口继续。
Claude Sonnet 5、Claude Sonnet 4.6、Claude Sonnet 4.5 和 Claude Haiku 4.5 具有上下文感知功能,使模型能够在整个对话中跟踪其剩余的上下文窗口(即其"令牌预算")。这使 Claude 能够通过了解自己有多少工作空间来更有效地执行任务和管理上下文。
管理上下文限制:
如果您在一个会压缩上下文或允许将上下文保存到外部文件的智能体框架中使用 Claude(如在 Claude Code 中),请考虑将此信息添加到您的提示中,以便 Claude 能够相应地行动。否则,Claude 有时可能会在接近上下文限制时自然地尝试收尾工作。以下是一个示例提示:
Your context window will be automatically compacted as it approaches its limit, allowing
you to continue working indefinitely from where you left off. Therefore, do not stop
tasks early due to token budget concerns. As you approach your token budget limit, save
your current progress and state to memory before the context window refreshes. Always be
as persistent and autonomous as possible and complete tasks fully, even if the end of
your budget is approaching. Never artificially stop any task early regardless of the
context remaining.记忆工具与上下文感知配合使用,可以很好地管理上下文转换。
对于跨越多个上下文窗口的任务:
**为第一个上下文窗口使用不同的提示:**使用第一个上下文窗口来建立框架(编写测试、创建设置脚本),然后使用后续的上下文窗口来迭代待办事项列表。
**让模型以结构化格式编写测试:**要求 Claude 在开始工作之前创建测试,并以结构化格式(例如 tests.json)跟踪它们。这会带来更好的长期迭代能力。提醒 Claude 测试的重要性:"移除或编辑测试是不可接受的,因为这可能导致功能缺失或有缺陷。"
**设置便利工具:**鼓励 Claude 创建设置脚本(例如 init.sh)来优雅地启动服务器、运行测试套件和代码检查工具。这可以防止在从新的上下文窗口继续时重复工作。
**重新开始与压缩:**当上下文窗口被清除时,请考虑使用全新的上下文窗口而不是使用压缩。Claude 的最新模型在从本地文件系统发现状态方面极其有效。在某些情况下,您可能希望利用这一点而不是压缩。请明确规定它应该如何开始:
**提供验证工具:**随着自主任务长度的增长,Claude 需要在没有持续人工反馈的情况下验证正确性。像 Playwright MCP 服务器或用于测试 UI 的计算机使用能力等工具会很有帮助。
**鼓励充分利用上下文:**提示 Claude 在继续之前高效地完成各个组件:
This is a very long task, so it may be beneficial to plan out your work clearly. It's
encouraged to spend your entire output context working on the task - just make sure you
don't run out of context with significant uncommitted work. Continue working
systematically until you have completed this task.在没有指导的情况下,Claude Opus 4.6 可能会采取难以撤销或影响共享系统的操作,例如删除文件、强制推送或向外部服务发布内容。如果您希望 Claude Opus 4.6 在采取潜在风险操作之前进行确认,请在提示中添加指导:
Consider the reversibility and potential impact of your actions. You are encouraged to
take local, reversible actions like editing files or running tests, but for actions that
are hard to reverse, affect shared systems, or could be destructive, ask the user before
proceeding.
Examples of actions that warrant confirmation:
- Destructive operations: deleting files or branches, dropping database tables, rm -rf
- Hard to reverse operations: git push --force, git reset --hard, amending published commits
- Operations visible to others: pushing code, commenting on PRs/issues, sending
messages, modifying shared infrastructure
When encountering obstacles, do not use destructive actions as a shortcut. For example,
don't bypass safety checks (e.g. --no-verify) or discard unfamiliar files that may be
in-progress work.Claude 的最新模型可以有效地从多个来源查找和综合信息。为了获得最佳研究结果:
**提供明确的成功标准:**定义什么构成对您研究问题的成功回答。
**鼓励来源验证:**要求 Claude 跨多个来源验证信息。
对于复杂的研究任务,使用结构化方法:
Search for this information in a structured way. As you gather data, develop several
competing hypotheses. Track your confidence levels in your progress notes to improve
calibration. Regularly self-critique your approach and plan. Update a hypothesis tree or
research notes file to persist information and provide transparency. Break down this
complex research task systematically.这种结构化方法有助于 Claude 有条不紊地处理大型语料库,并迭代地审视其发现。
Claude 的最新模型原生支持编排子智能体。这些模型能够识别哪些任务会从将工作委派给专门的子智能体中受益,并主动这样做,无需明确指令。
要利用这种行为:
如果您发现子智能体使用过度,请添加关于何时需要和不需要子智能体的明确指导:
Use subagents when tasks can run in parallel, require isolated context, or involve
independent workstreams that don't need to share state. For simple tasks, sequential
operations, single-file edits, or tasks where you need to maintain context across steps,
work directly rather than delegating.借助自适应思考和子智能体编排,Claude 可以在内部处理大多数多步推理。当您需要检查中间输出或强制执行特定的管道结构时,显式提示链(将任务分解为顺序的 API 调用)仍然有用。
最常见的链接模式是**自我纠正:**生成草稿 → 让 Claude 根据标准审查它 → 让 Claude 根据审查进行改进。每个步骤都是一个单独的 API 调用,因此您可以在任何时候记录、评估或分支。
Claude 的最新模型有时可能会为了测试和迭代目的创建新文件,尤其是在处理代码时。这种方法允许 Claude 在保存最终输出之前将文件(尤其是 Python 脚本)用作"临时草稿本"。使用临时文件可以改善结果,特别是对于智能体编码用例。
如果您希望尽量减少净新增文件的创建,可以指示 Claude 自行清理:
If you create any temporary new files, scripts, or helper files for iteration, clean up
these files by removing them at the end of the task.Claude Opus 4.5 和 Claude Opus 4.6 有过度工程化的倾向,会创建额外的文件、添加不必要的抽象,或构建未被要求的灵活性。如果您看到这种不希望的行为,请添加具体的指导以保持解决方案最小化。
例如:
Avoid over-engineering. Only make changes that are directly requested or clearly
necessary. Keep solutions simple and focused:
- Scope: Don't add features, refactor code, or make "improvements" beyond what was
asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need
extra configurability.
- Documentation: Don't add docstrings, comments, or type annotations to code you didn't
change. Only add comments where the logic isn't self-evident.
- Defensive coding: Don't add error handling, fallbacks, or validation for scenarios
that can't happen. Trust internal code and framework guarantees. Only validate at system
boundaries (user input, external APIs).
- Abstractions: Don't create helpers, utilities, or abstractions for one-time
operations. Don't design for hypothetical future requirements. The right amount of
complexity is the minimum needed for the current task.Claude 有时可能过于专注于让测试通过,而牺牲了更通用的解决方案,或者可能使用变通方法(如用于复杂重构的辅助脚本)而不是直接使用标准工具。为了防止这种行为并获得可泛化的解决方案:
Please write a high-quality, general-purpose solution using the standard tools
available. Do not create helper scripts or workarounds to accomplish the task more
efficiently. Implement a solution that works correctly for all valid inputs, not just
the test cases. Do not hard-code values or create solutions that only work for specific
test inputs. Instead, implement the actual logic that solves the problem generally.
Focus on understanding the problem requirements and implementing the correct algorithm.
Tests are there to verify correctness, not to define the solution. Provide a principled
implementation that follows best practices and software design principles.
If the task is unreasonable or infeasible, or if any of the tests are incorrect, please
inform me rather than working around them. The solution should be robust, maintainable,
and extendable.Claude 的最新模型不太容易产生幻觉,并能基于代码给出更准确、更有依据、更智能的答案。要进一步鼓励这种行为并最小化幻觉:
<investigate_before_answering>
Never speculate about code you have not opened. If the user references a specific file,
you MUST read the file before answering. Make sure to investigate and read relevant
files BEFORE answering questions about the codebase. Never make any claims about code
before investigating unless you are certain of the correct answer - give grounded and
hallucination-free answers.
</investigate_before_answering>与以前的 Claude 模型相比,Claude Opus 4.5 和 Claude Opus 4.6 具有改进的视觉能力。它们在图像处理和数据提取任务上表现更好,尤其是当上下文中存在多张图像时。这些改进也延伸到计算机使用方面,模型可以更可靠地解释屏幕截图和 UI 元素。您还可以通过将视频分解为帧来使用这些模型分析视频。
一种已被证明能进一步提升性能的有效技术是为 Claude 提供裁剪工具或智能体技能。测试表明,当 Claude 能够"放大"图像的相关区域时,图像评估的表现会持续提升。Anthropic 创建了一个裁剪工具的配方。
Claude Opus 4.5 和 Claude Opus 4.6 能够构建具有出色前端设计的复杂、真实的 Web 应用程序。然而,在没有指导的情况下,模型可能会默认使用通用模式,从而产生用户所说的"AI 垃圾"美学。要创建令人惊喜和愉悦的独特、有创意的前端:
有关改进前端设计的详细指南,请参阅关于通过技能改进前端设计的博客文章。
对于 API 之外的前端设计工作,Claude Design 提供了画布和设计工具,Claude 可以在其中交互式地生成和迭代设计。
以下是一个可用于鼓励更好前端设计的系统提示片段:
<frontend_aesthetics>
You tend to converge toward generic, "on distribution" outputs. In frontend design, this
creates what users call the "AI slop" aesthetic. Avoid this: make creative, distinctive
frontends that surprise and delight.
Focus on:
- Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic
fonts like Arial and Inter; opt instead for distinctive choices that elevate the
frontend's aesthetics.
- Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency.
Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Draw
from IDE themes and cultural aesthetics for inspiration.
- Motion: Use animations for effects and micro-interactions. Prioritize CSS-only
solutions for HTML. Use Motion library for React when available. Focus on high-impact
moments: one well-orchestrated page load with staggered reveals (animation-delay)
creates more delight than scattered micro-interactions.
- Backgrounds: Create atmosphere and depth rather than defaulting to solid colors. Layer
CSS gradients, use geometric patterns, or add contextual effects that match the overall
aesthetic.
Avoid generic AI-generated aesthetics:
- Overused font families (Inter, Roboto, Arial, system fonts)
- Clichéd color schemes (particularly purple gradients on white backgrounds)
- Predictable layouts and component patterns
- Cookie-cutter design that lacks context-specific character
Interpret creatively and make unexpected choices that feel genuinely designed for the
context. Vary between light and dark themes, different fonts, different aesthetics. You
still tend to converge on common choices (Space Grotesk, for example) across
generations. Avoid this: it is critical that you think outside the box!
</frontend_aesthetics>您还可以参考完整的技能定义。
从早期版本迁移到当前 Claude 模型时:
明确说明期望的行为: 考虑准确描述您希望在输出中看到的内容。
使用修饰语来构建您的指令: 添加鼓励 Claude 提高输出质量和细节的修饰语,可以帮助更好地塑造 Claude 的表现。例如,不要使用"创建一个分析仪表板",而是使用"创建一个分析仪表板。包含尽可能多的相关功能和交互。超越基础,创建一个功能齐全的实现。"
明确请求特定功能: 当需要动画和交互元素时,应明确提出请求。
更新思考配置: Claude 4.6 模型使用自适应思考(thinking: {type: "adaptive"}),而不是使用 budget_tokens 的手动思考。使用 effort 参数来控制思考深度。
迁移弃用预填充响应: 从 Claude 4.6 模型和 Claude Mythos Preview 开始,不再支持在最后一个 assistant 轮次中使用预填充响应。请参阅迁移弃用预填充响应以获取有关替代方案的详细指导。
调整反懒惰提示: 如果您的提示之前鼓励模型更加彻底或更积极地使用工具,请减弱这些指导。Claude 4.6 模型更加主动,可能会对先前模型所需的指令过度触发。
有关详细的迁移步骤,请参阅迁移指南。
请参阅迁移指南中的从 Claude Sonnet 4.5 或更早版本迁移到 Claude Sonnet 5,其中涵盖了 effort 默认值的变更以及手动扩展思考(budget_tokens)的移除。
Claude Fable 5 和 Claude Mythos 5 的行为差异和提示模式,涵盖 effort、指令遵循、长时间运行、记忆和脚手架变更。
Claude Sonnet 5 的行为差异和提示模式,涵盖 effort、自适应思考默认值、工具使用以及从 Claude Sonnet 4.6 的迁移。
Claude Opus 5 的行为差异和提示模式,涵盖响应详细程度、代理叙述、任务范围界定、子代理委派和自我纠正。
何时使用提示工程以及如何在调整提示之前规划您的方法。
Was this page helpful?