使用扩展思考
假设你正在处理复杂的架构决策、具有挑战性的 bug,或需要深度推理的多步骤实现规划。
⚠️
扩展思考在 Claude Code 中默认是禁用的。你可以使用 Tab
键切换思考开关来按需启用它,或使用”think”或”think hard”等提示词。你也可以通过在设置中设置 MAX_THINKING_TOKENS
环境变量来永久启用它。
提供上下文并让 Claude 思考
> I need to implement a new authentication system using OAuth2 for our API. Think deeply about the best approach for implementing this in our codebase.
Claude 将从你的代码库中收集相关信息并使用扩展思考,这将在界面中可见。
通过后续提示细化思考
> think about potential security vulnerabilities in this approach
> think hard about edge cases we should handle
💡
Claude 将在响应上方以斜体灰色文本显示其思考过程。