黄奕彬

外部精选

Claude Code · v2.1.307

本文来自外部来源,不是黄奕彬的原创文章。本站提供原文入口,并在采集端生成 AI 结构化摘要、解读与中文翻译(如有),一切以原文为准。

阅读原文(github.com)
来源
Claude Code releases ↗
作者 / 署名
ashwin-ant
来源更新时间
本站收录时间
原文域名
github.com

以上时间均为北京时间;来源更新时间由来源提供,不代表首次发布时间。

结构化摘要 AI 生成

背景与问题

这是 Claude Code 在 GitHub releases 上发布的官方版本说明(标记为 Immutable 不可变发布),面向 Claude Code 的使用者与维护者。它要回答的问题是:v2.1.307 相对此前版本新增、修复、改进了哪些功能与缺陷,便于用户评估升级与排查已知问题。

方法或内容

以变更清单形式发布 v2.1.307(对应 commit 1132b8a),条目按 Added、Fixed、Improved、Changed 分类。覆盖 CLI 核心、MCP、云会话、自托管 runner、VSCode 扩展、Agent SDK 与 Code Review。原文未说明清单之外的发布流程或测试细节。

关键发现 / 结果

  • 新增 /claude-api api-version,将 Claude API 代码迁移到 API 版本 2026-10-21
  • 新增 claude_code.safety_event OpenTelemetry 事件,在权限规则、auto mode、安全检查、hook 或沙箱停止、提示或退回工具调用时发出
  • 修复设置 CLAUDE_CODE_DISABLE_1M_CONTEXT 时带 [1m] 后缀的别名模型(如 opus[1m])报 model-not-found
  • 修复多项 MCP 问题:macOS 钥匙串锁定时的认证提示、计算机睡眠导致的超时、HTTP MCP 调用连接中断被发两次(现仅重试只读或幂等工具)
  • 修复读取大量 PDF/图片时 Autocompact is thrashing 错误
  • Agent SDK setModel() 确认等待由 5 秒提高到 15 秒
  • 无法解析的工具调用最多重试两次再结束回合
  • 自托管 runner:checkout hook 默认 30 分钟超时,可用 --checkout-hook-timeout-min 调整
  • VSCode:听写自动停止时提示原因并保留已识别文本;修复 TLS 代理下听写失败
  • Code Review:新增 @claude review stop(含 off、pause)

结论与意义

原文为变更清单型发布说明,未给出总体性结论,可归纳为:一次以缺陷修复为主、辅以少量新功能(API 版本迁移命令、安全遥测事件、Code Review 停止指令)的维护性版本。适用边界:所有条目仅针对 v2.1.307 及清单中点名的组件与环境。

AI 解读 AI 生成

方法:按「时空变量」分析(时间 / 空间 / 变量,严格区分包含、相关与因果),对象包括原文作者、署名人员与关键技术及其实际原理;结论用「元反空」(元思考、反思考、空思考、综合)整理。

时间:何时发生,现在是否仍成立

来源日期为 2026年10月22日 06:17(北京时间),即北京时间 2026-10-22 06:17:02,此为 v2.1.307 的发布时点,全部条目描述该版本发布时的状态。是否仍成立:原文未说明后续版本情况;作为迭代产品的发布快照,具体行为与参数(如各处超时数值)可能被后续版本再次修改。

空间:谁的环境 / 场景

适用于 Claude Code v2.1.307 用户,覆盖多种形态:CLI(含 headless claude -p)、VSCode 扩展、云会话与 Cowork、自托管 runner、桌面应用及其 Code 标签页、基于 Agent SDK 构建的应用、Code Review(pull request 场景)。

部分条目限定操作系统(macOS 钥匙串、macOS/Linux 睡眠)或网关环境(自定义 ANTHROPIC_BASE_URL 网关、Foundry、Claude apps gateway)。

变量:实际改变了什么

  • 行为:HTTP MCP 调用仅对只读或幂等工具重试;无法解析的工具调用重试至多两次;setModel() 等待上限 5 秒改为 15 秒;checkout hook 默认 30 分钟停止并使会话 setup 失败
  • 配置:新增 /claude-api api-version 与 claude_code.safety_event;axScreenReader 与 CLAUDE_AX_SCREEN_READER 仅在 user、managed 或 --settings 设置中生效(自 2.1.305 起);证书文件按 CLI 方式过滤受信证书
  • 界面:/permissions 批准行显示命令名而非描述;/help 改为显示简短描述;VSCode 听写停止提示;仓库选择器显示 Searching…
  • 价格:原文未说明任何变化

区分:包含 ≠ 相关 ≠ 因果

发布说明大多给出明确因果修复:如设置 CLAUDE_CODE_DISABLE_1M_CONTEXT 且模型为 [1m] 别名时报错、计算机睡眠导致 MCP 报超时,均为原文明确因果。归类而非因果:[VSCode]、[Cloud sessions]、[Code Review] 标签仅表示变更所属组件(包含关系);since 2.1.305 表示 axScreenReader 行为自该版本起生效,属时间关联而非本版因果。

Improved 类条目(如 fork subagents 改进、首条回复提速)原文未提供量化证据,只是可能性降低的描述。

对象:作者/署名与关键技术原理

署名作者:ashwin-ant(来自结构化作者字段;正文未提及其他署名人员)。关键技术按原文描述:

  • MCP 服务器:认证、超时、HTTP 工具调用重试、后台任务运行时工具同步
  • OpenTelemetry:claude_code.safety_event 事件与 OTEL_EXPORTER_OTLP_HEADERS 遥测导出
  • Agent SDK:setModel() 模型切换确认
  • 自托管 runner:checkout hook、Anthropic-managed git 证书构建、--use-anthropic-git-proxy
  • TLS 证书:NODE_EXTRA_CA_CERTS、CLAUDE_CODE_CERT_STORE 与受信证书过滤
  • 其他:prompt-caching-scope beta header、CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS、WebFetch/WebSearch、语音听写

原文未说明这些技术的底层实现原理。

元反空综合结论

元——这条内容本质在回答「v2.1.307 改了什么」,服务于用户的升级决策与问题排查。

反——最可能失效或有边界的部分:具体超时数值(setModel() 的 15 秒、checkout hook 的 30 分钟、听写 15 秒无语音与 2 分钟上限)及 UI 提示文案可能随版本调整;MCP 与网关相关修复依赖具体客户端、网关与部署组合,环境差异可能使其不适用;「通常约 10 分钟自行结束」是原文的或然表述。

空——去掉发布叙事后剩下的必要事实:版本号 v2.1.307、commit 1132b8a、发布时间(北京时间 2026-10-22 06:17:02),以及一组逐条列出的 Added/Fixed/Improved/Changed 条目。

综合:这是一次以修复为主的维护版本,修复集中在 MCP、云会话与自托管 runner 的稳定性;新增能力(API 版本 2026-10-21 迁移命令、claude_code.safety_event 安全遥测事件、@claude review stop)是明确可验证的变更点,其余评价性判断原文未提供。

中文译文 AI 生成

不可变的 release。只有 release 标题和发布说明可以被修改。

1132b8a

更新内容

  • 新增 /claude-api api-version,用于将 Claude API 代码迁移到 API 版本 2026-10-21
  • 新增 claude_code.safety_event OpenTelemetry 事件,在每次工具调用被权限规则、auto mode、安全检查、hook 或沙箱停止、提示或退回时发出
  • 修复了在设置了 CLAUDE_CODE_DISABLE_1M_CONTEXT 且模型是带 [1m] 后缀的别名(例如 opus[1m])时,请求以 model-not-found 错误失败的问题
  • 修复了 prompt-caching-scope beta header 在自定义 ANTHROPIC_BASE_URL 网关之后以及在 Foundry 上仍被发送的问题,该 header 在这些环境中不生效
  • 修复了 macOS 上登录钥匙串被锁定时,MCP 服务器在 claude -p 中显示 "needs authentication" 的问题;现在它们会说明原因,且解锁后的下一次运行无需重新登录即可连接
  • 修复了 macOS 或 Linux 计算机在 MCP 服务器连接期间进入睡眠时,这些服务器被报告为超时并在 headless 运行中持续处于失败状态的问题
  • 修复了连接在调用中途关闭时 HTTP MCP 工具调用被发送两次的问题;现在仅重试只读或幂等工具
  • 修复了当后台任务正在运行时,回合有时会在缺少某个 SDK MCP 服务器最新工具的情况下开始的问题
  • 修复了在读取大量 PDF 页面、图片或其他大型工具结果的回合中出现的部分 "Autocompact is thrashing" 错误
  • 修复了云会话中的 /autocompact 在会话重启后回到默认窗口的问题
  • 修复了用 /clear 清除的对话在云或 self-hosted runner 会话重启后有时会重新出现的问题
  • 修复了 CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS 在 Claude apps gateway 会话中被忽略的问题
  • 修复了在设置了 OTEL_EXPORTER_OTLP_HEADERS 时,Claude apps gateway 之后的 Claude Desktop 会话的遥测数据被拒绝的问题
  • 修复了 /permissions > Recently denied 不显示被拒绝的 shell 命令的问题,以及 auto mode 的本地分类器在检查重试的命令时忽略来自该处的批准的问题;现在批准某一行时显示的是命令本身,而不是其描述
  • 修复了 /help 和 / 命令菜单对 /claude-api 等捆绑技能显示面向模型的长描述而非其简短描述的问题
  • 修复了子代理 transcript 为流式响应记录占位 token 用量和空停止原因的问题
  • 修复了通过 Agent SDK 的 setModel()(以及基于其构建的应用)进行的模型切换在 API 确认模型耗时超过 5 秒时被拒绝的问题;Claude Code 现在最多等待 15 秒
  • 修复了通过已连接的应用停止的后台命令(例如桌面应用归档空闲会话)被报告给 Claude 为由用户停止的问题;现在该通知会指出其输出文件
  • 修复了 Cowork 云会话中的 WebFetch 在网站以 4xx 状态回应或依据 robots.txt 拒绝时报告工具错误的问题;现在它与本地会话中一样是正常结果
  • 修复了在直接配置的 GitHub MCP 服务器上,写入工具在桌面应用的 Code 标签页中显示一个表单、但表单关闭时未创建任何内容的问题
  • 修复了当服务器已关闭某个被复用的连接时,Artifact 工具读取因连接重置而失败的问题
  • Self-hosted runner:修复了带 --use-anthropic-git-proxy 的会话提交先前会话遗留在克隆中的 .claude/settings.local.json 的问题
  • Self-hosted runner:修复了在会话的 checkout hook 期间归档或重新排队会话、或停止 runner 时,hook 的进程仍在运行且 runner 的槽位仍被占用的问题
  • 改进了对无法解析的工具调用的恢复:Claude Code 现在会在以错误结束回合之前最多重试该调用两次
  • 改进了一同启动的 fork 子代理:现在每个子代理都会被告知哪次启动属于自己,因此各 fork 尝试启动彼此工作的可能性大大降低
  • 改进了浏览器登录:成功页面现在会在登录完成后立即出现,无需等待账户资料加载
  • 改进了云和 self-hosted runner 会话中的网页搜索错误:当搜索被以附带原因的 403 拒绝时,现在会显示该原因,而不是通用的 "Authentication error"
  • 改进了当桌面应用的某个 MCP 服务器无法连接时云会话的首次回复时间
  • 改进了 transcript 中包含大型粘贴图片或 PDF 读取内容的会话的 Remote Control 连接时间
  • 更改了 WebSearch 预算用尽时 Claude 收到的通知,使其还告知 Claude 不要在浏览器中或通过 computer use 查询搜索引擎
  • 更改了 axScreenReader 设置以及 settings env 块中的 CLAUDE_AX_SCREEN_READER,使其仅从 user、managed 或 --settings 设置生效(自 2.1.305 起)
  • Self-hosted runner:更改了 checkout hook,现在默认在 30 分钟后被停止,并使会话的 setup 失败;如果你的 hook 需要更长时间,请调高 --checkout-hook-timeout-min 或将其设为 0
  • Self-hosted runner:更改了为 Anthropic-managed git 构建的证书文件,使其像 CLI 一样过滤受信任证书;会有一条 [runner:warn] 行给出被排除的数量
  • [VSCode] 新增了语音听写自行停止时(15 秒未识别到语音,或达到 2 分钟限制)麦克风按钮上的通知,说明原因以及目前已有的文本会被保留
  • [VSCode] 修复了通过 Show more 展开的长提示词覆盖整个聊天面板的问题:固定的提示词现在最多占面板的 40% 并可滚动
  • [VSCode] 修复了列表项或表格单元格中带 LaTeX 数学公式的部分在富文本编辑器中被粘贴为新列表或表格的问题
  • [VSCode] 修复了当 NODE_EXTRA_CA_CERTS 仅在 ~/.claude/settings.json 中设置时,听写在 TLS 检查代理之后失败的问题;现在它也遵循 CLAUDE_CODE_CERT_STORE
  • [VSCode] 更改了 "still open somewhere else" 通知,使其也涵盖扩展重启后遗留的 Claude 进程,该进程通常会在约 10 分钟内自行结束
  • [VSCode] 更改了语音听写,使其像 CLI 一样过滤其受信任证书
  • [VSCode] 更改了扩展自身发出的请求,使其像 CLI 一样过滤其受信任证书,并信任环境中或用户设置中指定的 NODE_EXTRA_CA_CERTS 文件

[Cloud sessions] 修复了搜索仍在进行时仓库选择器就显示 "No repositories match" 的问题;现在在结果返回前会显示 "Searching…"

[Cloud sessions] 修复了自托管环境中 "Waiting for a runner" 状态被截断的问题;使用按需 runner 时,现在会从你的上一条消息开始向上计时,并显示失败的尝试

[Code Review] 为 Code Review 新增了 @claude review stop(也包括 off 和 pause),用于结束对某个 pull request 的 @claude review always 订阅,而不启动新的 review

展开原文提取正文(采集端自动提取,可能有缺失)

Immutable release. Only release title and notes can be modified.

1132b8a

What's changed

Added /claude-api api-version to move Claude API code to API version 2026-10-21 Added the claude_code.safety_event OpenTelemetry event for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back Fixed requests failing with a model-not-found error when CLAUDE_CODE_DISABLE_1M_CONTEXT is set and the model is an alias with the [1m] suffix, such as opus[1m] Fixed the prompt-caching-scope beta header being sent behind custom ANTHROPIC_BASE_URL gateways and on Foundry, where it has no effect Fixed MCP servers showing "needs authentication" in claude -p on macOS while the login keychain was locked; they now say why, and the next run after an unlock connects without a new sign-in Fixed MCP servers being reported as timed out, and staying failed in headless runs, when a macOS or Linux computer went to sleep while they were connecting Fixed HTTP MCP tool calls being sent twice when the connection closed mid-call; only read-only or idempotent tools are now retried Fixed a turn sometimes starting without an SDK MCP server's latest tools when a background task was running Fixed some "Autocompact is thrashing" errors in turns that read many PDF pages, images or other large tool results Fixed /autocompact in cloud sessions going back to the default window after the session restarted Fixed a conversation cleared with /clear sometimes coming back when a cloud or self-hosted runner session restarted Fixed CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS being ignored in Claude apps gateway sessions Fixed telemetry from Claude Desktop sessions behind a Claude apps gateway being rejected when OTEL_EXPORTER_OTLP_HEADERS is set Fixed /permissions > Recently denied not showing the denied shell command, and auto mode's local classifier ignoring an approval from there when it checks a retried command; approving a row now names the command, not its description Fixed /help and the / command menu showing long model-facing descriptions for bundled skills such as /claude-api instead of their short descriptions Fixed subagent transcripts recording placeholder token usage and an empty stop reason for streamed responses Fixed model switches through the Agent SDK's setModel(), and apps built on it, being refused when the API took more than 5 seconds to confirm the model; Claude Code now waits up to 15 seconds Fixed a background command stopped through a connected app (such as the desktop app archiving an idle session) being reported to Claude as stopped by the user; the notice now names its output file Fixed WebFetch in Cowork cloud sessions reporting a tool error when a site answered with a 4xx status or a robots.txt refusal; it is now a normal result, as in local sessions Fixed write tools on a directly configured GitHub MCP server showing a form that closed without creating anything in the desktop app's Code tab Fixed Artifact tool reads failing with a connection reset when the server had closed a reused connection Self-hosted runner: Fixed sessions with --use-anthropic-git-proxy committing a .claude/settings.local.json left in the clone by an earlier session Self-hosted runner: Fixed archiving or requeueing a session, or stopping the runner, during its checkout hook leaving the hook's processes running and the runner's slot held Improved recovery from unparseable tool calls: Claude Code now retries the call up to twice before ending the turn with an error Improved fork subagents launched together: each is now told which launch is its own, so forks are much less likely to try to start each other's work Improved browser sign-in: the success page now appears as soon as sign-in completes, without waiting for your account profile to load Improved web search errors in cloud and self-hosted runner sessions: a search refused with a 403 that gives a reason now shows that reason instead of a generic "Authentication error" Improved the time to the first reply in cloud sessions when one of the desktop app's MCP servers can't connect Improved Remote Control connect time for sessions whose transcript contains large pasted images or PDF reads Changed the notice Claude gets when the WebSearch budget is used up to also tell it not to query search engines in a browser or through computer use Changed the axScreenReader setting and CLAUDE_AX_SCREEN_READER in a settings env block to apply only from user, managed or --settings settings (since 2.1.305) Self-hosted runner: Changed checkout hooks to be stopped after 30 minutes by default, failing the session's setup; if yours needs longer, raise --checkout-hook-timeout-min or set it to 0 Self-hosted runner: Changed the certificate file built for Anthropic-managed git to filter its trusted certificates as the CLI does; a [runner:warn] line gives the number left out [VSCode] Added a notice on the microphone button when voice dictation stops by itself (15 seconds without recognized speech, or the 2-minute limit), saying why and that the text so far is kept [VSCode] Fixed a long prompt expanded with Show more covering the whole chat panel: a pinned prompt is now capped at 40% of the panel and scrolls [VSCode] Fixed part of a list item or table cell with LaTeX math pasting as a new list or table in rich text editors [VSCode] Fixed dictation failing behind a TLS-inspecting proxy when NODE_EXTRA_CA_CERTS is set only in ~/.claude/settings.json; it now also follows CLAUDE_CODE_CERT_STORE [VSCode] Changed the "still open somewhere else" notice to also cover a Claude process left over from an extension restart, which usually ends on its own within about 10 minutes [VSCode] Changed voice dictation to filter its trusted certificates as the CLI does [VSCode] Changed the extension's own requests to filter their trusted certificates as the CLI does, and to trust the NODE_EXTRA_CA_CERTS file named in the environment or in user settings [Cloud sessions] Fixed the repository picker saying "No repositories match" while a search was still running; it now shows "Searching…" until the results arrive [Cloud sessions] Fixed the "Waiting for a runner" status on self-hosted environments being cut off; with on-demand runners it now counts up from your last message and shows failed attempts [Code Review] Added @claude review stop (also off and pause) to Code Review, ending an @claude review always subscription on a pull request without starting a new review

原文入口

阅读原文(github.com)

原文将在新窗口打开。收录时间不是内容更新时间;正文、译文与解读的版权归原作者/来源所有,本站仅作个人阅读辅助并保留原文入口;页面时间均为北京时间。

作者/署名来自原文结构化字段(Atom/RSS/HTML meta/JSON-LD;GitHub release 显示的是发布者账号),未经模型补充。

了解来源批准与收录规则