← All reports

Changes on 2026-05-13

26 total changes in 4 runs

22:40 EST

🤖 AI Batch Analysis

```markdown # 更新分析:Claude Code v2.1.141 ### 1. Overall Summary (总体概要) 这是一个以**稳定性修复**和**Agent 工作流增强**为核心的版本。除了新增对插件输出和后台任务管理的控制外,该版本主要修复了超过 30 个影响开发体验的缺陷,特别是围绕 MCP 协议集成、跨平台认证(AWS/Windows)以及权限提示逻辑的问题。 ### 2. Key Themes (核心主题) * **Agent 与后台任务增强**: 引入了 `claude agents --cwd` 以支持按目录管理会话,优化了后台 Agent 的状态流转(完成后自动归类),并改进了“回退”菜单(新增“总结到此处”功能)。 * **MCP 与生态系统修复**: 大幅修复了 MCP 服务器的连接与配置问题(如环境变量解析错误、HTTP 403 处理),并新增 `CLAUDE_CODE_PLUGIN_PREFER_HTTPS` 以支持无 SSH 环境下的插件安装。 * **用户体验打磨**: 增强了长时间思考时的视觉反馈(琥珀色提示),改进了插件菜单导航(支持 Tab/箭头键),并修复了 Markdown 表格渲染和权限提示的交互逻辑。 * **平台与集成稳定性**: 针对 Windows (`daemon status`), VSCode (语音模式), 以及 AWS Bedrock/Vertex (凭证导出) 的特定问题进行了修复。 ### 3. Impact Level (影响程度) **High** * **理由**: 尽管没有破坏性变更,但修复列表非常庞大且针对性强。它解决了许多导致开发流程中断的“痛点”(如权限卡死、Agent 状态异常、MCP 连接失败),显著提升了工具在生产环境中的可靠性。 ### 4. Action Items for Developers (开发者行动项) * **尝试新的 Agent 管理功能**: 使用 `claude agents --cwd <path>` 来更清晰地组织特定项目的会话。 * **检查环境变量配置**: 如果你的环境没有配置 GitHub SSH 密钥,请设置 `CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`;如果使用 Workload Identity Federation,请配置 `ANTHROPIC_WORKSPACE_ID`。 * **利用上下文压缩**: 在长对话中尝试使用“回退”菜单中的“Summarize up to here”来保留近期上下文并压缩历史 Token。 * **升级以修复关键 Bug**: 如果你遇到 Windows 管道报错、Bedrock 跨账号认证失败或 MCP 服务器配置丢失的问题,此版本包含关键修复。 * **关注 Hooks 变更**: 更新你的 Hook 脚本以支持新的 `terminalSequence` 字段,从而实现更好的终端通知控制。 ```
💭 Model Reasoning
1. **Analyze the Request:** * **Role:** World-class programmer, expert in dev tools and documentation. * **Task:** Analyze a single batch of documentation changes (specifically a `CHANGELOG.md` update). * **Format:** Markdown, concise, insightful. * **Language:** Chinese (as requested in the system prompt "请用中文回复"). * **Input:** A diff of `CHANGELOG.md.md` for version `2.1.141` (additions only). 2. **Analyze the Content (CHANGELOG.md diff for v2.1.141):** * **Total Changes:** 62 lines added. * **Nature:** It's a standard changelog for a CLI tool/IDE extension called "Claude Code" (inferred from context like `claude agents`, VSCode mentions, hooks, etc.). * **Key Additions:** * *New Features:* `terminalSequence` for hooks, env vars (`CLAUDE_CODE_PLUGIN_PREFER_HTTPS`, `ANTHROPIC_WORKSPACE_ID`), `--cwd` for agents, "Summarize up to here" in rewind menu, feedback includes recent sessions. * *UX Improvements:* Spinner feedback (amber color), plugin menu navigation, auto-mode permission dialog explanation, background agent state handling. * *Fixes:* A massive list of fixes (around 30+ items). Topics include: * Model selection (fallbacks for Haiku/Bedrock/Vertex). * CLI behavior (`daemon status`, `/doctor`, `/model`, `/tui`, `/mcp`). * Permission handling (modes, prompts, auto-dismissal). * UI/Terminal issues (markdown tables, statuslines, themes, spinner). * Platform specifics (Windows, VSCode, Linux SDK). * MCP (Model Context Protocol) servers (configs, auth, HTTP/SSE). * Voice mode. * Authentication (Remote Control, AWS credentials). 3. **Drafting the Analysis (Iterative refinement):** * *Overall Summary:* This is a feature-rich and bug-fix-heavy release (v2.1.141). It focuses on stabilizing the "agents" workflow, improving MCP (Model Context Protocol) integration, and fixing a wide array of CLI/UI edge cases, particularly around permissions and cross-platform support. * *Key Themes:* * **Agents & Background Tasks:** Enhancements to `claude agents` (dashboard, state management, `--cwd`) and background shells. * **MCP & Ecosystem:** Fixes for plugin MCP servers, environment variable expansions, and auth flows. New env var for HTTPS preference. * **UX & Polish:** Better spinner feedback, "Summarize" feature, clearer permission dialogs. * **Bug Bash:** Extensive fixes covering Windows, VSCode, AWS Bedrock, voice mode, and CLI input handling. * *Impact Level:* **High**. * *Reasoning:* While not a "breaking change" release, the sheer volume of fixes (over 30) targeting critical stability areas (permissions, agents, MCP, cross-platform auth) significantly improves the developer experience. The new agent features change workflows. * *Action Items:* * Review new environment variables (`CLAUDE_CODE_PLUGIN_PREFER_HTTPS`, `ANTHROPIC_WORKSPACE_ID`) if relevant to your CI/SSH setup. * Check the updated `claude agents --cwd` syntax if managing multiple project directories. * Be aware of the "Summarize up to here" rewind feature for better context management. * Update if you rely on Windows, VSCode voice features, or Bedrock/Vertex integration due to specific fixes. 4. **Translating to Chinese (as requested):** * *Summary:* 2.1.141 版本是一个侧重于稳定性与工作流增强的重要更新。它引入了 Agent 管理的新功能,修复了大量关于 MCP、权限控制及跨平台支持的缺陷。 * *Themes:* * Agent 与后台任务增强(`claude agents` 仪表盘、状态管理)。 * MCP 与生态系统(插件服务器、认证流程修复、新增 HTTPS 环境变量)。 * 用户体验(回退菜单的“总结”功能、权限对话框优化、加载状态反馈)。 * 大规模缺陷修复(涉及 Windows、VSCode、Bedrock、Voice Mode 等)。 * *Impact:* **High** (影响程度高)。大量的修复直接解决了权限、Agent 和跨平台认证中的稳定性痛点。 * *Action Items:* * 检查新增的环境变量,特别是涉及 GitHub HTTPS 克隆和 Workspace ID 的配置。 * 尝试新的 `claude agents --cwd` 命令以更好地管理多目录会话。 * 如果使用 Windows 或 VSCode 语音功能,建议升级以获得修复。 * 熟悉“回退菜单”中的“总结到此处”功能以优化 Token 使用。 5. **Final Review against constraints:** * Markdown format? Yes. * Concise? Yes. * Insightful? Yes. * Focus on what matters to devs? Yes. * Chinese? Yes. 6. **Final Polish (Self-Correction):** * Make sure the "Impact" explanation justifies "High" without being alarmist. It's high because of the stability improvements, not because of breakages. * Ensure the distinction between "Added" and "Fixed" is clear in the themes. *(Self-Correction during drafting Chinese output)*: "TerminalSequence" might be niche, but "Agents" and "MCP" are central themes for power users. I will emphasize those. 7. **Generate Output.**

📚 Claude Code GitHub

19:01 EST

🤖 AI Batch Analysis

### 文档变更分析摘要 #### 1. Overall Summary 本次更新全面清理了文档中对旧版模型(主要是 Claude 3.7 和 Haiku 3.5 系列)的引用,明确区分了 Anthropic 自有平台与合作伙伴平台(AWS Bedrock, Vertex AI)不同的模型生命周期和退役日期,同时修正了关于设置优先级、插件覆盖及 Hook 禁用逻辑的说明。 #### 2. Key Themes * **模型生命周期清理与平台差异**:大规模移除了对 `Claude Sonnet 3.7` 和 `Claude Haiku 3.5` 的单独引用,将它们归类为“已弃用”或“已退役(除特定合作伙伴平台外)”。新增了关于 Bedrock 和 Vertex AI 拥有独立退役时间表的明确警告。 * **配置优先级与合并规则**:细化了 Settings 的作用域逻辑,明确指出标量值是“覆盖”,而数组值(如权限规则、文件路径)是“合并并去重”。 * **托管设置的强制力**:明确修正了插件和 Hook 的覆盖逻辑,强调 Managed Settings(托管设置)具有最高优先级,`--plugin-dir` 或本地设置无法覆盖由托管设置强制启用/禁用的插件或 Hook。 * **行为描述通用化**:移除了针对 Claude Sonnet 3.7 的特定行为描述(如扩展思考、上下文窗口溢出处理),转而描述当前 4.x 模型的标准行为。 #### 3. Impact Level **Medium** **理由**:虽然大部分变更属于模型列表的清理,但关于**平台特定的退役日期**和**设置合并规则**的澄清对开发者的迁移规划和配置调试有实质性影响。特别是依赖 Bedrock/Vertex AI 的用户需要注意不同的时间表。 #### 4. Action Items for Developers * **关注平台特定退役时间**:如果您使用 AWS Bedrock 或 Vertex AI,请务必查阅文档中的特定表格,这些平台的模型退役日期(如 Haiku 3.5, Sonnet 3.7)与 Anthropic 官方 API 不一致。 * **审查权限配置逻辑**:利用文档中关于“数组设置合并”的新说明,检查您的 `permissions.allow` 或文件系统设置是否按预期在多层级(User/Project/Managed)间生效。 * **检查插件与 Hook 覆盖**:如果尝试使用 `--plugin-dir` 本地覆盖插件,或通过 `disableAllHooks` 禁用 Hook,请确认这些配置未被 Managed Settings 强制锁定。 * **移除旧版模型硬编码**:检查代码中是否仍有对 `claude-3-7-sonnet` 等旧版 ID 的硬编码引用,并准备迁移至 4.x 系列。 * **更新上下文窗口处理逻辑**:注意文档更新了关于 `max_tokens` 超过上下文窗口时的行为描述(Claude 4.5+ 会停止并返回特定原因,而非直接报错),请据此调整错误处理代码。
💭 Model Reasoning
1. **Analyze the Request:** * **Role:** World-class programmer analyzing documentation changes. * **Input:** 18 pages of diffs (Markdown). * **Output Format:** Concise, insightful analysis in Markdown, focusing on developer impact, in Chinese. 2. **Analyze the Diffs (Page by Page):** * *hooks-guide.md*: Clarifies that `disableAllHooks` in managed settings might need to be set separately if hooks are defined there. * *plugins.md*: Clarifies that `--plugin-dir` cannot override plugins that managed settings force-enable or force-disable. * *settings.md*: Refines how settings scopes interact. Clarifies that scalar values are overridden by higher priority, but arrays (like permissions) are merged/concatenated. * *about-claude/pricing.md*: Removes older models (Claude 3, Haiku 3, Sonnet 3.7) from main tables or marks them as "Deprecated" or "Retired, except on Bedrock/Vertex". Updates pricing tables to be cleaner. * *about-claude/model-deprecations.md*: Adds a note about lifecycle status/dates differing between Anthropic-operated platforms and Partner platforms (Bedrock, Vertex). * *api/rate-limits.md*: Updates model lists (removing Sonnet 3.7, etc.), updates "Retired" labels for Haiku 3.5 to be specific to Bedrock/Vertex. * *build-with-claude/extended-thinking.md*: Removes specific references to Claude Sonnet 3.7. Updates context window behavior explanation (now strict limit, but 4.5+ handles overflow differently). Generalizes thinking behavior descriptions. * *build-with-claude/prompt-caching.md*: Updates pricing tables, removes specific old model references or labels them correctly (e.g., Haiku 3.5 retired except Bedrock/Vertex). * *build-with-claude/batch-processing.md*: Updates pricing tables, similar to prompt caching. * *build-with-claude/context-windows.md*: Removes specific 3.7 references. Clarifies context window overflow behavior (4.5+ stops gracefully vs earlier models erroring). * *build-with-claude/search-results.md*: Updates model availability list. Notes Haiku 3.5 is retired except on Bedrock/Vertex. Removes Sonnet 3.7. * *build-with-claude/files.md*: Minor rewording about file support. * *build-with-claude/claude-on-amazon-bedrock.md*: Updates lifecycle dates and status in the table (e.g., Sonnet 3.7 "Retired April 28, 2026"). Adds a disclaimer that dates are platform-specific. * *build-with-claude/claude-on-vertex-ai.md*: Similar to Bedrock, updates dates (Sonnet 3.7 "Retired May 11, 2026"). Adds disclaimer. * *agents-and-tools/tool-use/overview.md*: Updates tool pricing tables, removes old models. * *agents-and-tools/tool-use/text-editor-tool.md*: Removes reference to an older text editor version specific to Sonnet 3.7. * *agents-and-tools/tool-use/computer-use-tool.md*: Removes beta header references to Sonnet 3.7. Removes code examples specific to 3.7 thinking budgets. Removes specific notes about 3.7 improvements, generalizing to "current models". * *agents-and-tools/tool-use/code-execution-tool.md*: Removes references to Sonnet 3.7 and Haiku 3.5 from the tool version table. 3. **Synthesize Themes:** * **Model Lifecycle Cleanup:** There is a massive cleanup across almost all pricing, rate limit, and tool-related pages. Older models (Claude 3.x, Sonnet 3.7, Haiku 3.5) are being removed from main lists, marked as deprecated/retired, or explicitly noted as "only available on Bedrock/Vertex". * **Platform-Specific Deprecation:** A crucial new distinction is being made: "Anthropic-operated" vs "Partner-operated" (Bedrock/Vertex) platforms have different model lifecycle schedules. This is explicitly added to deprecation pages. * **Settings/Hooks Logic Refinement:** Documentation is tightening up the rules for settings precedence (merge vs override) and plugin/hook override capabilities (managed settings are king). * **Behavior Generalization:** Specific references to "Claude Sonnet 3.7" behavior (especially in extended thinking and computer use) are being removed, suggesting the docs are focusing on the current 4.x generation behavior as the standard. 4. **Determine Impact:** * **Impact Level:** Medium. While mostly documentation cleanup, the specific clarification on *platform-specific deprecation schedules* and *settings merge behavior* has real-world implications for developers planning migrations or configuring complex permissions/hooks. 5. **Draft Action Items:** * Check if your code relies on the specific "merge" behavior of settings (now explicitly documented). * Note the differing deprecation dates for Bedrock/Vertex vs Anthropic API. * Update any hardcoded logic relying on specific 3.7 model IDs. * Verify plugin override logic if using managed settings. 6. **Translate and Format (Chinese):** * *Summary:* 本次更新主要清理了旧版模型(如 Claude 3.7, 3.5 系列)的文档引用,明确区分了 Anthropic 自有平台与合作伙伴平台(AWS Bedrock, GCP Vertex)的模型生命周期差异,并完善了设置合并/覆盖逻辑的说明。 * *Themes:* * 模型生命周期清理与平台差异. * 配置优先级与合并规则. * 行为描述通用化. * *Impact:* Medium. (Reason: 主要是文档清理,但关于平台特定的退役日期和设置合并规则的澄清对长期规划和配置调试很重要). * *Action Items:* * 检查代码中是否硬编码了旧版模型 ID(如 Sonnet 3.7)。 * 若使用 AWS Bedrock 或 Vertex AI,请查阅文档中特定于这些平台的模型退役日期,它们与 Anthropic API 的日期不同。 * 审查权限和插件设置,理解数组类设置(如权限)是“合并”而非“覆盖”。 * 更新有关插件和 Hook 的配置逻辑,明确“托管设置”拥有最高优先级。 7. **Final Review against Constraints:** * Single batch analysis? Yes. * Markdown format? Yes. * Chinese response? Yes. * Concise? Yes. 8. **Construct Final Output.** (Proceeding to generate the Markdown response).

📚 Claude Code

15:47 EST

🤖 AI Batch Analysis

# 文档变更分析 ## Overall Summary 本次更新主要明确了 Agent SDK 在 2026 年的计费变更计划,修正了 CLAUDE.md 配置文件的加载优先级说明,大幅优化了自定义输出样式的文档结构,并提升了 API 第一层级的速率限制。 ## Key Themes * **未来政策预告**:在 `headless.md`、`iam.md` 和 `legal-and-compliance.md` 中广泛添加了关于 2026 年 6 月 15 日的变更通知,届时订阅计划中的 Agent SDK 和 `claude -p` 使用将从新的月度额度中扣除,与交互式使用限制分离。 * **配置优先级修正**:`memory.md` 中的配置层级表进行了重新排序,将“用户指令”置于“项目指令”之上,并明确说明加载顺序为从最广泛范围到最特定范围,消除了对配置覆盖关系的潜在混淆。 * **文档体验优化**:`output-styles.md` 删除了部分底层实现细节(如具体的 token 消耗机制),改用 `<Steps>` 组件指导如何创建自定义样式,并新增了 `keep-coding-instructions` 配置的具体说明,降低了理解门槛。 * **资源限额提升**:`api/rate-limits.md` 显示 Tier 1 用户的支出限制已从 $100 提升至 $500。 ## Impact Level **Medium** **Reasoning**: 1. **API 限额提升**是即时生效的利好,直接影响开发者的调用容量。 2. **配置优先级说明的修正**虽然逻辑上更通顺,但若开发者此前误以为项目配置优先于用户配置,可能需要调整预期。 3. 2026 年的计费变更虽然重要,但时间线较长,短期内仅为信息同步,不涉及立即行动。 ## Action items for developers 1. **检查配置优先级**:回顾您项目中 `CLAUDE.md`(项目级)和 `~/.claude/CLAUDE.md`(用户级)的内容,确保它们的行为符合“范围越广,加载越早”的逻辑。 2. **利用新额度**:确认您的 API Tier 1 限额已提升至 $500,如有必要可相应调整自动化脚本或 CI/CD 的调用频率。 3. **关注未来计费**:了解 2026 年 Agent SDK 将采用独立额度计费的政策,以便为长期的自动化工具使用做预算规划。 4. **更新自定义样式**:参考重构后的输出样式文档,尝试使用 `keep-coding-instructions` 来更精细地控制自定义角色的行为。
💭 Model Reasoning
1. **Analyze the Request:** * **Role:** World-class programmer analyzing documentation changes. * **Format:** Markdown, concise, insightful, Chinese language. * **Input:** 6 documentation pages with diffs (`headless.md`, `iam.md`, `legal-and-compliance.md`, `memory.md`, `output-styles.md`, `api/rate-limits.md`). * **Focus:** What matters to developers. * **Output Structure:** Overall Summary, Key Themes, Impact Level + Reasoning, Action Items (max 5). 2. **Analyze the Changes (Page by Page):** * **Page 1: `headless.md`** * *Change:* Removed a note about the CLI being previously called "headless mode." Added a note about a new "Agent SDK credit" coming June 15, 2026. Changed phrasing from "run Claude Code programmatically" to "run Claude Code in non-interactive mode." * *Developer Impact:* Terminology update (programmatic -> non-interactive). Important heads-up about future billing/separation of credits (though it's 2026, so far off, but relevant for long-term planning). * **Page 2: `iam.md`** * *Change:* Added the same Note about the June 15, 2026 Agent SDK credit change. * *Developer Impact:* Reiteration of the billing/limit change. * **Page 3: `legal-and-compliance.md`** * *Change:* Added the same Note about the June 15, 2026 Agent SDK credit change. * *Developer Impact:* Reiteration of the billing/limit change. * **Page 4: `memory.md`** * *Change:* Reordered the table of CLAUDE.md file locations. Swapped "User instructions" and "Project instructions" rows. Updated text to clarify load order (broadest to specific). * *Developer Impact:* Clarifies precedence order of configuration files. "Project instructions" now appear before "User instructions" in the list (visually) and the text clarifies the load order explicitly. * **Page 5: `output-styles.md`** * *Change:* Major cleanup and restructuring. * Simplified explanation of how output styles work (removed detailed technical implementation details about token usage/caching unless necessary). * Restructured "Create a custom output style" into `<Steps>` format. * Clarified `keep-coding-instructions`. * Removed the generic "How output styles work" section which explained system prompt modification details, focusing more on *usage*. * *Developer Impact:* Better UX documentation. Easier to create custom styles. Removes some internal implementation details (token usage details) to focus on configuration. * **Page 6: `api/rate-limits.md`** * *Change:* Updated Tier 1 spending limits from $100 to $500 (in two columns). * *Developer Impact:* Increased limits for Tier 1 users. Positive change. 3. **Synthesize and Structure the Output (Drafting in Chinese):** * **Overall Summary:** Updates involve a future pricing model change for Agent SDK, a restructuring of configuration precedence documentation, an increase in API rate limits, and improvements to custom output style documentation. * *Chinese:* 本次更新主要涉及未来定价模式的预告、配置文件加载顺序的明确、API 速率限制的提升,以及对自定义输出样式文档的结构优化。 * **Key Themes:** * Future Policy Change: The 2026 Agent SDK credit separation (major change coming). * Configuration & Precedence: Clarifying CLAUDE.md load order. * Documentation UX: Simplifying output styles guide. * Capacity: Increasing limits. * *Chinese:* * **政策预告**:多页面添加了关于 2026 年 6 月 Agent SDK 积分与交互式使用分离的说明。 * **配置优先级**:明确了 CLAUDE.md 文件在不同层级(用户、项目、托管)的加载顺序。 * **文档体验**:大幅重构了输出样式的创建指南,使其更易于操作。 * **限额提升**:API 第一层级的支出限制从 $100 提升至 $500。 * **Impact Level:** * The rate limit increase is immediate and beneficial. * The config order clarification is important for correctness. * The 2026 change is informational for now. * The output styles change is just doc improvement. * *Level:* Medium (due to config precedence clarification and rate limit increase). The 2026 thing is "High" impact but far future. * *Reasoning:* Config file loading order affects behavior directly. Rate limits affect usage immediately. Future billing is just a heads-up. * **Action Items:** * Review CLAUDE.md placement if you rely on overlapping configs. * Check your tier limits. * Be aware of future billing changes. * *Chinese:* * 检查并确认项目中 `CLAUDE.md` 和 `~/.claude/CLAUDE.md` 的配置是否符合新的优先级规则。 * 利用提升后的 API 速率限制(Tier 1 上限至 $500)评估是否需要调整调用策略。 * 查阅更新后的自定义输出样式文档,优化您的 Claude Code 使用体验。 4. **Refine and Polish (Self-Correction):** * *Headless/Agent SDK note:* The user asked for analysis. The date 2026 is far away. I should mention it's a "future change". * *Memory.md:* The table reorder means "Project instructions" loads *before* "User instructions" in the broad-to-specific sequence shown, though the specific logic "More specific locations take precedence" still holds. The text says "load order, from broadest scope to most specific". Managed -> Project -> User -> Local. Wait, let me look closer at the diff. * *Diff Check on memory.md:* * Old order: Managed -> Project -> User -> Local. * New order: Managed -> User -> Project -> Local. * *Correction:* The table rows swapped. "User instructions" is now above "Project instructions". The text says "from broadest scope to most specific". User (`~/.claude/`) is usually broader than Project (`./.claude/`). So this makes logical sense. * *Output styles:* The explanation removed "Token usage depends on the style..." details in the "How it works" section, but kept the note about caching in the "Change your output style" section. This is just simplification. 5. **Final Output Generation (Markdown):** * *Summary:* Concise. * *Themes:* Clear bullets. * *Impact:* Medium. * *Actions:* Practical. (Proceed to generate Chinese response.)

📚 Claude Code

📚 Anthropic API

13:12 EST

🤖 AI Batch Analysis

### 1. Overall Summary 文档更新了 Prompt Caching 的最小 token 限制规则,区分了 Claude API/Vertex AI/Foundry 与 Amazon Bedrock 的不同行为,并将 Claude Sonnet 4.6 的最小缓存门槛从 2,048 tokens 下调至 1,024 tokens。 ### 2. Key Themes * **平台差异化说明**:明确将 Amazon Bedrock 与其他平台(Claude API, AWS上的 Claude Platform, Vertex AI, Microsoft Foundry)区分开来,指出 Bedrock 有独立的缓存限制、失败行为和字段名称规范。 * **Sonnet 4.6 缓存门槛降低**:Claude Sonnet 4.6 的最小可缓存长度要求减半,从 2,048 tokens 降至 1,024 tokens,使其与 Sonnet 4.5 和旧版 Opus 保持一致。 * **行为透明化**:重申了当提示词低于最小长度限制时,请求会“静默”成功(不报错但不缓存),并强调通过检查响应中的 usage 字段来验证缓存状态。 ### 3. Impact level **Medium (中等)** * **理由**:对于使用 Claude Sonnet 4.6 的开发者,这是一个积极的变更,允许在更小的上下文中启用缓存以降低成本。对于 Amazon Bedrock 用户,这是一个重要的澄清,防止直接套用通用文档规则导致预期外的行为或计费问题。 ### 4. Action items for developers * **Bedrock 用户**:请立即查阅 [AWS Bedrock 文档](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html),以获取特定于该平台的模型缓存最小值和字段名称,**不要**套用本文档的通用规则。 * **Sonnet 4.6 用户**:利用新的 1,024 tokens 门槛,检查现有的短提示词是否现在可以被缓存,从而优化成本。 * **调试验证**:在开发中监控 `cache_creation_input_tokens` 和 `cache_read_input_tokens` 字段,如果两者均为 0,说明提示词长度不足或发生了其他静默失败。
💭 Model Reasoning
1. **分析请求:** * **角色:** 世界级程序员。 * **任务:** 分析文档变更(单个批次)。 * **输入:** 一个文件的 Diff:`build-with-claude/prompt-caching.md`(+9 / -8 行)。 * **输出格式:** Markdown。 * **语言:** 中文(按要求)。 * **要求:** 简洁,有见地,关注开发者的需求。 2. **分析 Diff:** * **文件:** `build-with-claude/prompt-caching.md` * **章节:** “缓存策略与考量” -> “缓存限制”。 * **变更内容:** * *原文:* 仅列出了最小可缓存提示词长度(如 4096, 2048, 1024 等具体数值)以及特定模型。 * *新版:* * 阐明了具体平台:Claude API、AWS 上的 Claude Platform、Vertex AI 和 Microsoft Foundry (beta)。 * *关键数据变更:* * Claude Sonnet 4.6:2048 -> **1024** tokens(原文未明确列出 4.6,但现在归入 1024 类别,尽管原文暗示较低模型为 2048)。等等,让我仔细看看列表。 * 旧版:Claude Sonnet 4.6 (2048),Claude Sonnet 4.5/Opus 4.1 等 (1024)。 * 新版:Claude Sonnet 4.6 (1,024)。*降低*。 * 新列表将 Claude Sonnet 4.6、4.5 等归为 1024。 * 新增文本:“Model availability varies by platform.”(模型可用性因平台而异)。 * 更新了验证建议(提到检查缓存字段以确认)。 * 新增关于 **Amazon Bedrock** 的注释。这是一个特殊/例外情况。它说 Bedrock 是 AWS 运营的平台,并指向 AWS 文档以获取具体的每模型最小值、失败行为和字段名称。这暗示了 Bedrock 的行为与其他平台 *不同*。 * 更新了故障排查列表以反映“你的模型和平台”(而不仅仅是模型)。 3. **综合变更(头脑风暴):** * *什么变了?* 缓存限制表的细化。 * *关键点:* Claude Sonnet 4.6 的最小缓存大小从 2048 降至 1024。这对该模型来说是件好事。 * *关键点:* 平台区分。文档明确列出了 API、AWS Platform、Vertex AI、Foundry 的新规则。 * *关键点:* Bedrock 被特别排除/例外化。开发者在 Bedrock 上必须查看 AWS 文档,因为“缓存限制”章节可能不适用于它(或者至少,最小值/字段名称不同)。 * *原因?* 准确性,处理不同云提供商之间的实现差异(特别是 Bedrock 的运作方式似乎不同)。 4. **起草输出(中文迭代完善):** * **1. Overall Summary(总体摘要):** * *草稿:* 文档更新了 Prompt Caching 的最小 token 限制,明确了不同平台(AWS Bedrock 除外)的规则,降低了 Claude Sonnet 4.6 的缓存门槛。 * *润色:* 更新了 Prompt Caching(提示词缓存)的最小 token 限制,区分了支持平台与 Amazon Bedrock 的不同行为,并显著降低了 Claude Sonnet 4.6 的缓存门槛。 * **2. Key Themes(关键主题):** * *Theme 1: 降低阈值。* Claude Sonnet 4.6 降至 1024。 * *Theme 2: 平台碎片化。* API/Vertex/Foundry 遵循一套规则;Bedrock 则不同。 * *Theme 3: 精确性。* 明确说明“可用性因平台而异”。 * *草稿:* * **平台差异化**:明确区分了 Claude API/Vertex AI/Foundry 与 Amazon Bedrock 在缓存限制上的差异,Bedrock 需参考独立文档。 * **缓存门槛降低**:将 Claude Sonnet 4.6 的最小可缓存长度从 2048 tokens 下调至 1024 tokens。 * **行为透明化**:强调了当缓存长度不足时请求会静默成功(无错误),增加了开发者验证建议。 * **3. Impact Level(影响级别):** * *评级:* Medium(中)。 * *推理:* Sonnet 4.6 的降低是一个积极的功能变更。Bedrock 的分离是一个关键的澄清,防止了那些在 Bedrock 上但遵循此处通用规则的开发者出现 Bug。 * *草稿:* **Medium (中等)**。Claude Sonnet 4.6 的缓存门槛降低有利于成本优化,但对 Amazon Bedrock 用户的特殊说明意味着部分开发者需要查阅特定文档以避免配置错误。 * **4. Action Items for Developers(开发者行动项):** * *Action 1:* Bedrock 用户检查 AWS 文档。 * *Action 2:* Sonnet 4.6 用户可以利用新的 1024 限制。 * *Action 3:* 检查缓存字段 (`cache_creation_input_tokens`) 以确保实际上达到了最小值。 * *草稿:* * **Bedrock 用户**:请务必查阅 [AWS Bedrock 文档](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html),因为本文档列出的限制和行为不适用于 Bedrock。 * **Sonnet 4.6 用户**:利用新降低的 1,024 tokens 门槛优化缓存策略,在较小上下文中也能启用缓存。 * **通用检查**:在调试缓存时,检查响应中的 `cache_creation_input_tokens` 和 `cache_read_input_tokens` 字段,确认缓存是否因长度不足而静默失败。 5. **最终审查:** * 是否覆盖了所有变更?是(Sonnet 4.6 降低,Bedrock 警告,平台列表)。 * 是否简洁?是。 * 是否为中文?是。 * 格式是否正确?是。 6. **最终润色(输出生成):**(根据起草的要点继续生成回答)。

📚 Anthropic API