← All reports

Changes on 2026-05-25

8 total changes in 2 runs

18:55 EST

🤖 AI Batch Analysis

# 文档变更分析摘要 ### 1. 总体概述 此次更新主要旨在提高可观测性数据的准确性,严格区分了“工具执行结果”与“工具权限决策”的触发逻辑;同时明确界定了子代理对 UI 依赖型工具的不可用性,并记录了一个已废弃 CLI 命令的移除情况。 ### 2. 核心主题 * **监控事件模型重构**:将 `tool_result` 事件的范围限制为仅包含“已接受并执行”的工具调用。拒绝调用不再触发此事件,必须通过 `tool_decision` 事件进行追踪。同时细化了 `decision_source` 的分类,特别是在交互式 CLI 和 SDK/非交互式环境下的行为差异。 * **子代理能力边界界定**:明确列出了子代理无法继承的特定内部工具(如 `Agent`、`AskUserQuestion` 等),这些工具依赖主会话的 UI 状态或特定的生命周期管理。 * **API 清理**:正式确认并文档化了 `/output-style` 命令在 v2.1.91 版本中的移除,引导用户使用 `/config`。 ### 3. 影响级别 **Medium (中等)** **理由**:虽然命令行变更的影响较小,但监控事件结构的变更对现有的遥测处理逻辑具有潜在的破坏性。依赖 `tool_result` 事件来检测拒绝操作或解析 `user_abort` 来源的系统将面临数据丢失或逻辑错误的风险,需要相应的代码调整。 ### 4. 开发者行动项 * **更新日志解析管道**:检查所有处理 `claude_code.tool_result` 事件的代码。移除对 `decision_type="reject"` 及相关 `decision_source`(如 `user_abort`)的处理逻辑,改为监听 `claude_code.tool_decision` 事件来获取拒绝详情。 * **调整子代理工具配置**:审查使用子代理的代码,移除对受限工具(`Agent`, `AskUserQuestion`, `EnterPlanMode`, `ScheduleWakeup`, `WaitForMcpServers`)的调用或依赖。 * **更新用户文档/脚本**:将仍在引用 `/output-style` 命令的文档、自动化脚本或教程更新为使用 `/config` 命令或直接编辑 `outputStyle` 配置。
💭 Model Reasoning
1. **Analyze the Request:** * **Role:** World-class programmer analyzing documentation changes. * **Input:** Three specific documentation diffs (`monitoring-usage.md`, `output-styles.md`, `sub-agents.md`). * **Format:** Markdown, concise, insightful, Chinese language response. * **Structure:** 1. Overall Summary, 2. Key Themes, 3. Impact Level, 4. Action Items. 2. **Analyze the Diffs:** * **Page 1: `monitoring-usage.md`** * *Change 1 (Tool result event):* Clarified that `tool_result` events are *not* emitted if a tool call was rejected. Instead, see the "Tool decision event". * *Change 2 (Tool result event fields):* Updated `decision_type` to say it's always `"accept"` (obvious, since it only logs execution). Updated `decision_source` to remove reject-only sources (`user_abort`, `user_reject`) because this event doesn't fire for rejections anymore. * *Change 3 (Tool decision event):* Refined the description of `"config"` source to include "allow or deny rules". * *Change 4 (Tool decision event):* Refined the description of `"user_reject"` source to distinguish behavior between interactive CLI (where it's just the user clicking "No") and SDK/non-interactive (where it matches a deny rule in personal settings). * *Theme:* Refinement of telemetry/monitoring logic to distinguish between permission decisions and actual tool execution results. Improves accuracy of event filtering. * **Page 2: `output-styles.md`** * *Change 1:* Added a deprecation note for the `/output-style` command (removed in v2.1.91), recommending `/config` instead. * *Theme:* Deprecation/Removal of a CLI command. Maintenance/Cleanup. * **Page 3: `sub-agents.md`** * *Change 1:* Clarified that subagents inherit tools by default but explicitly listed exceptions (tools dependent on UI/session state): `Agent`, `AskUserQuestion`, `EnterPlanMode`, `ExitPlanMode` (conditional), `ScheduleWakeup`, `WaitForMcpServers`. * *Theme:* Clarification of sub-agent capabilities and limitations regarding specific UI/State-dependent tools. 3. **Synthesize and Structure (in Chinese):** * **Overall Summary:** The updates focus on refining telemetry accuracy regarding tool execution vs. permission decisions, clarifying sub-agent tool limitations, and noting the removal of a deprecated CLI command. * *Draft (CN):* 此次更新主要聚焦于完善遥测数据的准确性,明确区分了“工具执行结果”与“工具权限决策”事件的触发逻辑;同时阐明了子代理对特定 UI 依赖型工具的不可用性,并标记了一个已废弃 CLI 命令的移除。 * **Key Themes:** * **Observability Precision:** Separating decision logic (accept/reject) from execution results in monitoring logs. * **Sub-Agent Constraints:** Defining boundaries for tools requiring main session state or UI interaction. * **API Lifecycle:** Removing deprecated `/output-style` command. * *Draft (CN):* * **遥测精准度提升**:严格区分了 `tool_result`(仅包含成功的执行)与 `tool_decision`(包含所有许可判定)事件,消除了逻辑歧义。 * **子代理边界明确**:列出了子代理无法使用的特定工具(如 `AskUserQuestion`、`Agent` 等),这些工具依赖主会话的 UI 或状态。 * **生命周期管理**:确认并记录了旧版 `/output-style` 命令的移除时间节点。 * **Impact Level:** * *Reasoning:* * Monitoring changes (`monitoring-usage.md`) are breaking changes for anyone parsing `tool_result` events expecting rejections or specific `decision_source` values. If they expected `user_abort` in `tool_result`, it's gone. If they filtered for rejections in `tool_result`, they will get 0 results. This is significant for telemetry pipelines. * Sub-agent changes are clarifications; they describe behavior that already exists (tools not available), but developers might have been confused. Low to Medium impact depending on if they were trying to use those tools. * Output style deprecation is Low impact (just a UI command). * *Conclusion:* Medium to High for telemetry users, Low generally. I'll rate it "Medium" overall because of the event schema change implications. * *Draft (CN):* **Medium (中等)** * *Reasoning:* 监控事件模型发生了实质性变更(`tool_result` 不再包含拒绝调用的事件),依赖旧日志结构的遥测系统需要更新。子代理工具限制的明确化有助于调试,命令移除的影响较小。 * **Action Items:** * Update log parsers (monitoring). * Check sub-agent code (if trying to use restricted tools). * Update scripts/docs using `/output-style`. * *Draft (CN):* * **更新日志解析逻辑**:检查并修改处理 `tool_result` 事件的代码,不再依赖其中的 `decision_source` 来追踪拒绝情况,应改用 `tool_decision` 事件。 * **审查子代理工具配置**:若在使用子代理时尝试调用 `Agent`、`AskUserQuestion` 或 `ExitPlanMode` 等工具,需调整代码逻辑,因为这些工具不可用。 * **更新脚本与文档**:将遗留的 `/output-style` 命令替换为 `/config` 或直接修改配置文件。 4. **Final Review:** * Does it meet the "World-class programmer" persona? Yes, precise and technical. * Is it in Chinese? Yes. * Is the format correct? Yes (Summary, Themes, Impact, Action Items). 5. **Construct Final Output.** (Proceeding to generate the response based on the drafted points).

📚 Claude Code

17:00 EST

🤖 AI Batch Analysis

# 文档变更分析摘要 ## 1. 总体概述 本次更新显著增强了开发者的成本控制与资源使用可见性,`/usage` 命令现在支持细粒度的消费明细分类和额度管理。同时,文档澄清了 Skill(技能)的命名规范,明确区分了“显示名称”与“命令调用名”,并优化了自定义脚本错误排查指引。 ## 2. 关键主题 * **精细化成本追踪**: `/usage` 命令新增了使用明细,能按 Skill、Subagent、Plugin 和 MCP 服务器分类展示消耗占比,支持 24 小时和 7 天视图切换。 * **消费额度管理**: Pro 和 Max 用户现在可以使用 `/usage-credits` 命令设置月度消费上限,并在达到限额时收到 CLI 内提示。 * **技能命名规范澄清**: 明确了 Skill 前置元数据中的 `name` 字段主要用于显示列表,而实际调用的命令名通常由文件或目录名决定(仅插件根目录的 `SKILL.md` 除外)。 * **MCP 配置灵活性**: 新增 `allowAllClaudeAiMcps` 托管设置,允许在部署 `managed-mcp.json` 的同时加载 claude.ai 的云端连接器。 * **调试能力增强**: 详细说明了自定义监控脚本失败时的错误报告路径(`/doctor`、Debug 日志、stderr),并增加了对 Windows 路径含空格情况的处理说明。 ## 3. 影响等级 **Medium (中等)** **理由:** 虽然没有破坏性变更,但 Skill 命名逻辑的澄清对于插件开发者的理解至关重要,而新增的消费明细和额度控制功能对长期使用 Claude Code 的开发者和团队管理员具有很高的实用价值,直接影响资源管理策略。 ## 4. 开发者行动项 * **修正 Skill 开发认知**: 如果你在开发 Skill 或插件,请查阅新增的 "How a skill gets its command name" 表格,确保没有混淆显示名称 (`name`) 与实际调用命令。 * **监控资源消耗**: 在 CLI 中使用 `/usage` 并尝试按 `d` 或 `w` 键,分析哪些 MCP 服务器或技能消耗了最多的 Token。 * **设置成本警报**: 如果使用 Pro/Max 计划,建议使用 `/usage-credits` 设置合理的月度预算上限,防止意外超支。 * **配置混合 MCP 环境**: 如果在受管环境中需要同时使用本地 MCP 配置和 claude.ai 官方连接器,请在 `managed-mcp.json` 中启用 `allowAllClaudeAiMcps`。 * **检查脚本错误日志**: 如果你的自定义监控脚本运行异常,请运行 `/doctor` 或开启 `--debug` 模式以获取具体的错误信息。
💭 Model Reasoning
1. **Analyze the Request:** * **Role:** World-class programmer analyzing documentation changes. * **Input:** 5 pages of diffs (costs.md, monitoring-usage.md, settings.md, skills.md, slash-commands.md). Note: `skills.md` and `slash-commands.md` diffs look identical in content, likely a cross-reference or duplicate content update. * **Output Format:** Markdown. Concise, insightful, developer-focused. * **Language:** Chinese. 2. **Analyze the Diffs:** * **Page: `costs.md` (+4 / -2):** * *Changes:* * Updated Note about `/usage` command to mention "usage breakdown" is now visible to subscribers. * Refined description of `/usage` to clarify it shows "Session block at the top". * Added a paragraph detailing the "usage breakdown" feature (attributes usage to skills, subagents, plugins, MCP servers). Added key bindings `d` or `w` for time switching (24h vs 7 days). Noted it's local only. * Added section on setting monthly spend limits on Pro/Max plans via `/usage-credits`. Explains the prompt when limits are reached and requirement for billing access. * *Impact:* Users of `/usage` command get better visibility into where their credits go. Pro/Max users get cost control features. * **Page: `monitoring-usage.md` (+5 / -0):** * *Changes:* * Clarified that the script value can be an executable path (with spaces) or a shell command line. Mentioned Windows shell behavior. * Added error reporting details: errors appear in `/doctor`, debug logs (`--debug` or `/debug`), and stderr in non-interactive sessions (`-p`). * *Impact:* Debugging custom auth scripts is easier. Better compatibility info for Windows. * **Page: `settings.md` (+1 / -0):** * *Changes:* * Added `allowAllClaudeAiMcps` setting (Managed settings only). Allows loading claude.ai connectors alongside a deployed `managed-mcp.json`. * *Impact:* Enterprise/Admins using managed settings can now allow cloud connectors (claude.ai MCPs) alongside local ones. * **Page: `skills.md` (+11 / -1) & `slash-commands.md` (+11 / -1):** * *Changes:* (Identical diffs) * Updated description of `name` field in frontmatter. Changed "Display name for the skill" to "Display name shown in skill listings... See [How a skill gets its command name]..." * Added a new section "How a skill gets its command name". Explains that usually, the command name comes from the directory/file name, *not* the `name` field. * Table showing mapping for: local skills directory, `.claude/commands/`, plugin subdirectory, and plugin root `SKILL.md`. * Clarified exception: Plugin root `SKILL.md` uses the `name` field (or plugin dir name) for the command. * *Impact:* Critical clarification for skill authors. Many likely thought `name` changed the command invocation. It distinguishes between "display name" and "invocation name". 3. **Synthesize Themes:** * *Visibility & Cost Management:* Enhanced `/usage` command with breakdowns and credits control. * *Configuration & Control:* New settings for MCP management (`allowAllClaudeAiMcps`) and spend limits. * *Authoring Clarity:* Clear distinction between a skill's display name and its command invocation name (Skills/Commands pages). * *Debugging:* Better error reporting for custom scripts. 4. **Determine Impact Level:** * *High?* No breaking changes. * *Medium?* Yes. Skill naming clarification prevents confusion. New usage features are significant for power users/admins. * *Low?* Too much new functionality for just "Low". * *Verdict:* **Medium**. Significant enhancements to usage tracking and important clarifications for developers building skills/plugins. 5. **Draft Action Items:** * Update Skill documentation/naming conventions based on the new "command name" logic. * Configure Managed Settings to allow cloud MCPs if needed. * Check new `/usage` features to monitor token consumption by skills/MCPs. * Set up usage credit limits if on Pro/Max plans. * Use new debug locations (`/doctor`, logs) if using custom monitoring scripts. 6. **Translate to Chinese:** * *Summary:* 此次更新主要增强了成本监控和可见性功能,并澄清了 Skill 的命名机制。 * *Themes:* 成本追踪增强, 技能命名规范, 管理配置扩展, 调试能力提升. * *Impact:* Medium. * *Action Items:* Review skill naming logic, use `/usage` breakdowns, configure managed settings, set spend limits, check error logs. 7. **Refine Output:** Ensure the tone is professional and insightful. * *Drafting the Chinese response...* * **Summary:** 本次文档更新主要集中在提升开发者对成本和资源使用的可见性,同时澄清了 Skill 的命令命名规则,消除了潜在的混淆。 * **Themes:** * **成本监控精细化:** `/usage` 命令新增了使用明细(按 Skill/MCP 分类)和 Pro/Max 用户的消费限额设置。 * **技能命名规范化:** 明确区分了 Skill 的“显示名称”和“调用命令名”,阐明了不同布局下的命名逻辑。 * **配置管理增强:** 新增 `allowAllClaudeAiMcps` 配置项,允许在受管环境中混用云端 MCP 服务。 * **调试体验优化:** 改进了监控脚本的错误报告机制,明确了日志输出位置。 * **Impact:** **Medium**。虽然不是破坏性变更,但对 Skill 开发者的行为修正和对成本敏感用户的资源控制具有重要价值。 * **Action Items:** * **检查 Skill 命名:** 若你是 Skill 或插件开发者,请务必查看新的命名逻辑表,确认你的 `name` 字段是否仅作为显示名称使用,而非命令调用名。 * **利用使用明细:** 使用 `/usage` 命令并按 `d` 或 `w` 查看按技能、MCP 服务器分类的资源消耗情况。 * **配置消费限额:** 如果是 Pro/Max 用户,使用 `/usage-credits` 设置月度消费上限以控制成本。 * **开启云端 MCP:** 在部署 `managed-mcp.json` 的环境中,如需同时使用 claude.ai 连接器,请在设置中添加 `allowAllClaudeAiMcps: true`。 * **优化脚本调试:** 如果监控脚本出现问题,检查 `/doctor` 输出或 `--debug` 日志以获取更详细的错误信息。 8. **Final Review:** The translation looks accurate and the summary captures the essence of the diffs. The duplicate content in `skills.md` and `slash-commands.md` is treated as one theme. *Self-Correction during drafting:* Initially I thought "Breaking" might be possible if people relied on `name` for the command. But the text says "defaults to directory name", so it likely still works as before for directory-based skills. It clarifies behavior rather than changing it drastically, except perhaps for plugin root cases. "Medium" is safer. *Formatting:* Check Markdown requirements. Let's produce the final output.

📚 Claude Code