核验日期:2026-07-08
内容来源:Anthropic Engineering 官方技术博客。本文先作为 Claude Code 专区后台草稿入库,发布前应由内容人员复核标题、摘要、图片、来源链接与是否需要补充本站实践说明。
"think" 工具:让 Claude 在复杂工具使用场景中停下来思考
一种能提升 Claude 复杂问题解决表现的新工具
来源:https://www.anthropic.com/engineering/claude-think-tool
发布日期:2025-03-20
- Extended thinking 更新
2025 年 12 月 15 日:Extended thinking 能力自最初发布以来已经有所改进,因此我们建议在大多数情况下使用该功能,而不是专门的 think 工具。Extended thinking 提供类似收益,即为 Claude 留出空间来推理复杂问题,同时具备更好的集成度和性能。实现细节请参见我们的 extended thinking 文档。
随着我们持续增强 Claude 的复杂问题解决能力,我们发现了一种尤其有效的方法:一个 "think" 工具,在复杂任务中为结构化思考创建专门空间。
这种简单但强大的技术,与 Claude 新的 “extended thinking” 能力不同(下文会解释;extended thinking 实现细节见此),已经显著提升了 Claude 的智能体式工具使用能力。这包括遵循政策、做出一致决策,以及处理多步骤问题,而且实现开销很低。
在本文中,我们将探讨如何在不同应用中实现 “think” 工具,并基于经过验证的基准结果,为开发者分享实用指导。
什么是 "think" 工具?
通过 "think" 工具,我们让 Claude 能够在得出最终答案的过程中,加入一个额外的思考步骤,并拥有自己的指定空间。
虽然它听起来类似 extended thinking,但二者是不同概念。Extended thinking 关注的是 Claude 在开始生成响应之前做什么。使用 extended thinking 时,Claude 会在采取行动前深入考虑并迭代自己的计划。"think" 工具则用于 Claude 开始生成响应之后,让它加入一个步骤,停下来思考自己是否已经拥有继续前进所需的全部信息。当执行长链条工具调用,或与用户进行长时间、多步骤对话时,这一点尤其有帮助。
这使得 “think” 工具更适合以下情况:Claude 仅凭用户查询无法获得形成响应所需的全部信息,并且需要处理外部信息(例如工具调用结果中的信息)。Claude 通过 “think” 工具执行的推理,不如 extended thinking 所能得到的推理全面,它更聚焦于模型发现的新信息。
对于较简单的工具使用场景,例如非顺序工具调用或直接遵循指令,我们建议使用 extended thinking。当你不需要 Claude 调用工具时,extended thinking 也适用于编码、数学和物理等用例。而当 Claude 需要调用复杂工具、在长链条工具调用中仔细分析工具输出、在带有详细指南的重政策环境中导航,或进行每一步都建立在前一步之上且错误代价较高的顺序决策时,“think” 工具更合适。
下面是一个示例实现,使用来自 τ-Bench 的标准工具规格格式:
{
"name": "think",
"description": "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
"input_schema": {
"type": "object",
"properties": {
"thought": {
"type": "string",
"description": "A thought to think about."
}
},
"required": ["thought"]
}
}
复制
在 τ-Bench 上的表现
我们使用 τ-bench(tau-bench)评估了 "think" 工具。τ-bench 是一个综合基准,旨在测试模型在真实客服场景中使用工具的能力,其中 "think" 工具是该评估标准环境的一部分。
τ-bench 评估 Claude 的以下能力:
- 与模拟用户进行真实对话
- 持续遵循复杂的客服智能体政策指南
- 使用多种工具访问和操作环境数据库
τ-bench 使用的主要评估指标是 pass^k,它衡量在给定任务上,所有 k 次独立任务试验均成功的概率,并在所有任务上取平均。与其他 LLM 评估中常见的 pass@k 指标不同(后者衡量 k 次试验中是否至少有一次成功),pass^k 评估的是一致性和可靠性。这对客服应用至关重要,因为稳定遵守政策是核心要求。
性能分析
我们的评估比较了几种不同配置:
- 基线(无 "think" 工具,无 extended thinking 模式)
- 仅 extended thinking 模式
- 仅 "Think" 工具
- "Think" 工具搭配优化提示词(用于航空领域)
结果显示,当 Claude 3.7 在该基准的 “airline” 和 “retail” 两个客服领域中有效使用 "think" 工具时,表现有显著提升:
- 航空领域:"think" 工具搭配优化提示词在 pass^1 指标上达到 0.570,而基线仅为 0.370,相对提升 54%;
- 零售领域:"think" 工具单独达到 0.812,而基线为 0.783。

Claude 3.7 Sonnet 在 Tau-Bench eval 的 "airline" 领域、四种不同配置下的表现。
Claude 3.7 Sonnet 在 Tau-Bench eval 的 "Airline" 领域表现
| Configuration | k=1 | k=2 | k=3 | k=4 | k=5 |
|---|---|---|---|---|---|
| "Think" + Prompt | 0.584 | 0.444 | 0.384 | 0.356 | 0.340 |
| "Think" | 0.404 | 0.254 | 0.186 | 0.140 | 0.100 |
| Extended thinking | 0.412 | 0.290 | 0.232 | 0.192 | 0.160 |
| Baseline | 0.332 | 0.206 | 0.148 | 0.116 | 0.100 |
四种不同配置下的评估结果。分数为比例。
航空领域的最佳表现来自将 “think” 工具与优化提示词配对使用。该提示词会提供在分析客户请求时应采用的推理方法示例。下面是优化提示词的一个示例:
## Using the think tool
Before taking any action or responding to the user after receiving tool results, use the think tool as a scratchpad to:
- List the specific rules that apply to the current request
- Check if all required information is collected
- Verify that the planned action complies with all policies
- Iterate over tool results for correctness
Here are some examples of what to iterate over inside the think tool:
<think_tool_example_1>
User wants to cancel flight ABC123
- Need to verify: user ID, reservation ID, reason
- Check cancellation rules:
* Is it within 24h of booking?
* If not, check ticket class and insurance
- Verify no segments flown or are in the past
- Plan: collect missing info, verify rules, get confirmation
</think_tool_example_1>
<think_tool_example_2>
User wants to book 3 tickets to NYC with 2 checked bags each
- Need user ID to check:
* Membership tier for baggage allowance
* Which payments methods exist in profile
- Baggage calculation:
* Economy class × 3 passengers
* If regular member: 1 free bag each → 3 extra bags = $150
* If silver member: 2 free bags each → 0 extra bags = $0
* If gold member: 3 free bags each → 0 extra bags = $0
- Payment rules to verify:
* Max 1 travel certificate, 1 credit card, 3 gift cards
* All payment methods must be in profile
* Travel certificate remainder goes to waste
- Plan:
1. Get user ID
2. Verify membership level for bag fees
3. Check which payment methods in profile and if their combination is allowed
4. Calculate total: ticket price + any bag fees
5. Get explicit confirmation for booking
</think_tool_example_2>
复制
特别有意思的是不同方法之间的比较。使用带优化提示词的 “think” 工具,效果显著优于 extended thinking 模式(后者表现与未提示的 “think” 工具相近)。单独使用 "think" 工具(不加提示)相比基线有所提升,但仍不及优化后的方法。
"think" 工具与优化提示的组合明显取得了最强表现,这很可能是因为基准中航空政策部分复杂度很高,模型最能从「如何思考」的示例中受益。
在零售领域,我们也测试了多种配置,以理解每种方法的具体影响

Claude 3.7 Sonnet 在 Tau-Bench eval 的 "retail" 领域、三种不同配置下的表现。
Claude 3.7 Sonnet 在 Tau-Bench eval 的 "Retail" 领域表现
| Configuration | k=1 | k=2 | k=3 | k=4 | k=5 |
|---|---|---|---|---|---|
| "Think" + no prompt | 0.812 | 0.735 | 0.685 | 0.650 | 0.626 |
| Extended thinking | 0.770 | 0.681 | 0.623 | 0.581 | 0.548 |
| Baseline | 0.783 | 0.695 | 0.643 | 0.607 | 0.583 |
三种不同配置下的评估结果。分数为比例。
"think" 工具即使没有额外提示,也取得了最高的 pass^1 分数 0.812。与航空领域相比,零售政策明显更容易导航,Claude 只要拥有一个思考空间,就能够取得改进,而无需进一步指导。
τ-Bench 分析的关键洞察
我们的详细分析揭示了几个模式,可以帮助你有效实现 "think" 工具:
- 在困难领域中,提示词非常重要。仅让 "think" 工具可用可能会带来一些性能提升,但在困难领域中,将它与优化提示结合会产生显著更好的结果。不过,较简单的领域可能仅靠访问 “think” 就能受益。
- 跨试验一致性提升。使用 “think” 带来的改进在 pass^k 直到 k=5 时仍然保持,这表明该工具帮助 Claude 更有效地处理边界情况和异常场景。
在 SWE-Bench 上的表现
在评估 Claude 3.7 Sonnet 时,我们也在 SWE-bench 设置中加入了一个类似的 “think” 工具,这对达到 0.623 的最先进分数有所贡献。改编后的 “think” 工具定义如下:
{
"name": "think",
"description": "Use the tool to think about something. It will not obtain new information or make any changes to the repository, but just log the thought. Use it when complex reasoning or brainstorming is needed. For example, if you explore the repo and discover the source of a bug, call this tool to brainstorm several unique ways of fixing the bug, and assess which change(s) are likely to be simplest and most effective. Alternatively, if you receive some test results, call this tool to brainstorm ways to fix the failing tests.",
"input_schema": {
"type": "object",
"properties": {
"thought": {
"type": "string",
"description": "Your thoughts."
}
},
"required": ["thought"]
}
}
复制
我们的实验(使用 "think" 工具时 n=30 个样本,不使用时 n=144 个样本)显示,单独加入该工具平均提升了 1.6% 的表现(Welch t 检验:t(38.89) = 6.71,p < .001,d = 1.47)。
何时使用 "think" 工具
基于这些评估结果,我们识别出 Claude 最能从 "think" 工具中受益的具体场景:
- **工具输出分析。**当 Claude 需要在行动前仔细处理此前工具调用的输出,并且可能需要回溯调整方法时;
- 重政策环境。当 Claude 需要遵循详细指南并验证合规性时;以及
- 顺序决策。当每个行动都建立在前面行动之上,且错误代价较高时(这常见于多步骤领域)。
实现最佳实践
为了让 Claude 最大限度地发挥 "think" 工具的作用,我们基于 τ-bench 实验推荐以下实现实践。
1. 使用特定领域示例进行策略性提示
最有效的方法是提供清晰指令,说明何时以及如何使用 "think" 工具,例如 τ-bench 航空领域中使用的那种。提供适合你具体用例的示例,会显著提升模型使用 "think" 工具的有效性:
- 推理过程中期望的细节程度;
- 如何把复杂指令拆解为可执行步骤;
- 处理常见场景的决策树;以及
- 如何检查是否已经收集到全部必要信息。
2. 将复杂指导放入系统提示词
我们发现,当关于 "think" 工具的说明较长和/或较复杂时,将它们放在系统提示词中,比放在工具描述本身更有效。这种方法提供了更宽泛的上下文,并帮助模型更好地把思考过程整合进整体行为。
何时不要使用 "think" 工具
尽管 “think” 工具可以带来显著提升,但它并不适用于所有工具使用用例,并且会增加提示词长度和输出 token。具体来说,我们发现 “think” 工具在以下用例中不会带来改进:
- 非顺序工具调用。如果 Claude 只需要进行单个工具调用,或多个并行调用即可完成任务,那么加入 “think” 不太可能带来改进。
- 简单指令遵循。当 Claude 需要遵守的约束不多,且默认行为已经足够好时,额外的 “think”-ing 不太可能带来收益。
开始使用
"think" 工具可以直接加入你的 Claude 实现,并且只需几个步骤就可能带来有意义的改进:
- **用智能体式工具使用场景进行测试。**从具有挑战性的用例开始,也就是 Claude 目前在长工具调用链中的政策合规或复杂推理方面表现吃力的场景。
- 添加工具定义。实现一个针对你所在领域定制的 "think" 工具。它只需要很少代码,却能支持更结构化的推理。也可以考虑在系统提示词中加入关于何时以及如何使用该工具的说明,并提供与你领域相关的示例。
- 监控并改进。观察 Claude 在实践中如何使用该工具,并调整你的提示词,以鼓励更有效的思考模式。
最好的一点是,加入这个工具在性能结果方面几乎没有坏处。除非 Claude 决定使用它,否则它不会改变外部行为,也不会干扰你现有的工具或工作流。
结论
我们的研究表明,在需要遵守政策并在长链条工具调用中进行推理的复杂任务上,"think" 工具可以显著提升 Claude 3.7 Sonnet 的表现1。“Think” 不是万能方案,但在正确的用例中,它能以极低实现复杂度带来可观收益。
我们期待看到你如何使用 "think" 工具,借助 Claude 构建更有能力、更可靠、更透明的 AI 系统。
- 虽然我们的 τ-Bench 结果聚焦于 Claude 3.7 Sonnet 使用 “think” 工具后的改进,但实验显示,Claude 3.5 Sonnet (New) 在与 3.7 Sonnet 相同的配置下也能获得性能提升,这表明该改进也可以泛化到其他 Claude 模型。