跳到主内容
@wquguru
精选85Claude Code(GitHub Releases)AI 编程与模型

Claude Code v2.1.300:新增AWS Advisor与OpenTelemetry增强

v2.1.300

原文
发到 X
推荐理由

本次更新包含对 Mod 系统和 Workflow Agent 的重要能力扩展(如 spawn 钩子重写权限),同时修复了影响自动化工作流的严重 Bug(如 headless 会话恢复丢数据、--worktree 失效)。依赖 Claude Code 进行开发或构建 Agent 的读者应升级以获取更稳定的体验和新特性。

What's changed

变更内容

  • Added virtualText to a mod's prompt decorations: text drawn in the prompt box that never enters the draft or the submitted prompt
  • Added cache_creation_5m_tokens and cache_creation_1h_tokens to the OpenTelemetry api_request event, splitting cache writes by lifetime
  • Added $.ui.view({ agentId }) for mods: shows an agent's transcript in the main view when you ask, and $.ui.view({}) goes back
  • Added a dir prop on a mod's Text for right-to-left text: on Windows and in VS Code's terminal its rows read in that direction and sit flush right
  • Added /advisor on Claude Platform on AWS; no advisor runs until you pick one with /advisor, advisorModel or --advisor, and CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1 turns it off
  • Added OpenTelemetry GenAI semantic-convention attributes to trace spans, such as gen_ai.provider.name, gen_ai.conversation.id, gen_ai.tool.name and error.type
  • Added support for rewriting a workflow agent's prompt and model in the agent.spawn mod hook, which could only refuse workflow agents before
  • Added the prompt.change mod hook, raised when the prompt box's text changes without a typed edit: a recalled history entry, a clear, an undo, or a plugin's fill
  • Fixed cloud sessions telling Claude that an organization policy blocked a host when the session's own network settings did
  • Fixed /autocompact warning about high token usage when you choose a smaller auto-compact window
  • Fixed SessionEnd hooks sometimes not running when you exit while a background command is still running
  • Fixed claude --help naming a removed tool in its description of --restricted
  • Fixed claude agents not refreshing any pull request's status when the data for one of them came back incomplete
  • Fixed Claude being told a background agent was lost, not resumable, after a cloud session's container was replaced, when the agent had already been resumed once
  • Fixed subagents you had typed messages to disappearing from /tasks shortly after finishing, leaving no way back to the conversation
  • Fixed a completed parent agent dropping off the breadcrumb (its child shown re-rooted at top level) while you were viewing the child
  • Fixed the agents view taking a typed word such as "up", "down" or "escape" for that key when input arrived in a burst, which could move the peek mid-reply or clear a draft
  • Fixed automatic tool search (ENABLE_TOOL_SEARCH=auto) turning off part-way through a conversation, for example while MCP servers reconnect after a resume
  • Fixed a login refused by forceLoginOrgUUID leaving the refused organization's token stored, or live after /login
  • Fixed the diff view in Claude Desktop and Remote Control sessions not noticing a conflicted cherry-pick or revert in reftable repositories
  • Fixed the Artifact tool's verbose and ctrl+o line reading Artifact("(unprintable path)") while a call's input arrives; its row now shows "Waiting…" and "Running…" as Bash's does
  • Fixed the first transcript entry written after resuming a session being lost when a crash had cut the transcript's last line short
  • Fixed /branch dropping messages, and claude purge skipping subfolder projects, when they contain a Unicode line or paragraph separator (U+2028, U+2029)
  • Fixed plugin WorktreeCreate and WorktreeRemove hooks not running when Claude Code starts with --worktree (not yet with --tmux)
  • Fixed OpenTelemetry tool_result events missing git_commit_id after git commit -q in repositories using reftable ref storage
  • Fixed a prompt that a mod's prompt.submit hook rewrote or dropped still being recorded as typed in the OpenTelemetry user_prompt event and interaction span, and in session title requests
  • Fixed a note meant for Claude about mod hot-reloading appearing in the transcript as if you had typed it
  • Fixed agent hooks ignoring their model: aliases like haiku now resolve, a subagent's model no longer overrides it, and an unavailable model falls back to the caller's instead of allowing the action
  • Fixed --worktree sessions sometimes starting from the wrong commit when a tag or branch was named like a commit ID, and their starting git status naming a branch other than the new worktree's
  • Fixed the branch showing as ".invalid" and --worktree failing to reopen a worktree in repositories using git's reftable ref storage
  • Fixed Claude naming files in the session scratchpad by a bare filename or relative path instead of their full path
  • Fixed claude remote-control servers giving up on renewing their connection after a brief sign-in error, such as a locked keychain; they now retry, and warn when you need to run claude /login
  • Fixed --worktree failing in a worktree of a bare repository when origin's default branch can't be fetched; the fallback base is now the current checkout's HEAD, not the main repository's
  • Fixed starting Claude Code in a VS Code, Cursor or Devin Desktop integrated terminal launching the editor's command-line tool twice to check for the extension; it now launches it once
  • Fixed a mod's prompt.edit hook not being raised for a newline entered with the chat:newline keybinding (Ctrl+J, or a rebound Enter)
  • Fixed a conversation failing on every turn with a 400 error when the API rejected an MCP tool's input schema; Claude Code now sends that tool without parameters for the rest of the conversation
  • Fixed resuming a headless or Agent SDK session losing the recent messages a compaction had kept, when the compaction followed a reply cut at the output token limit (compactions from this version on)
  • Fixed Claude not being told about an MCP server's tools and instructions until its next tool call, when the server finished connecting after a compaction
  • Fixed Remote Control sessions being marked stopped while still running, on a computer serving several sessions at once
  • Fixed resuming a headless or Agent SDK session losing its compaction summary or bringing back pre-compaction history, when the compaction followed a retried or unfinished reply in the same turn
  • Fixed Claude polling a background command's output file or sleeping while it runs
  • Fixed feature flags and staged rollouts staying stale behind a TLS-inspecting proxy whose certificate is trusted only through the OS certificate store
  • Fixed claude daemon stop --any printing "stopped" while a stuck background service kept running: it now waits, force-kills the service, and says so with exit 1 if it is still there
  • Fixed claude daemon stop exiting with no output, and leaving sessions listed as running, when telemetry is turned off
  • Fixed Write, Edit and NotebookEdit in Cowork cloud sessions reporting success for a path on your own computer, where the file never arrived
  • Fixed Claude searching for deferred tools already loaded earlier in the conversation when a session resumes a history that never listed them
  • Fixed secondary (dim) text looking the same as normal text under the dark ANSI theme and on 16-color terminals
  • Fixed cloud sessions hanging 5 minutes per turn when the organization's policy can't be read; the turn now ends promptly and says why
  • Fixed a cloud session sometimes running an already answered message a second time after the session restarted during a long reply
  • Self-hosted runner: Fixed the runner and orchestrator freezing (no polls, /healthz or SIGTERM shutdown) while nobody reads their output; logs keep the latest 256 KiB and count drops (not on Windows)
  • Improved WebFetch in Cowork cloud sessions to tell Claude that a page failed moments ago instead of fetching it again
  • Improved mod sharing in the built-in plugin-authoring skill: Claude scans a mod's files for keys before opening them, and asks before scanning a folder outside the project
  • Improved the note Claude 3 models get about an @-mentioned PDF, so they less often answer without reading it
  • 为 mod 的提示装饰添加了 virtualText:在提示框中绘制但不会进入草稿或已提交提示的文本
  • 向 OpenTelemetry api_request 事件添加了 cache_creation_5m_tokens 和 cache_creation_1h_tokens,按缓存写入的生命周期进行拆分
  • 为 mods 添加了 $.ui.view({ agentId }):当你提问时,在主视图中显示代理的对话记录;$.ui.view({}) 则返回
  • 为 mod 的 Text 添加了 dir 属性以支持从右到左的文本:在 Windows 和 VS Code 终端中,其行按该方向阅读并靠右对齐
  • 在 AWS 上的 Claude Platform 添加了 /advisor;在你通过 /advisor、advisorModel 或 --advisor 选择一个之前,不会有顾问运行;CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1 可将其关闭
  • 向追踪跨度添加了 OpenTelemetry GenAI 语义约定属性,例如 gen_ai.provider.name、gen_ai.conversation.id、gen_ai.tool.name 和 error.type
  • 在 agent.spawn mod 钩子中添加了对重写工作流代理的提示和模型的支持,此前仅能拒绝工作流代理
  • 添加了 prompt.change mod 钩子,当提示框中的文本发生非手动输入的更改时触发:如回忆历史记录条目、清空、撤销或插件填充
  • 修复了云会话在会话自身的网络设置阻止主机时,却告诉 Claude 是组织策略阻止的情况
  • 修复了在选择较小的自动紧凑窗口时,/autocompact 警告高令牌使用量的问题
  • 修复了在后台命令仍在运行时退出时,SessionEnd 钩子有时不运行的问题
  • 修复了 claude --help 在其对 --restricted 的描述中命名了一个已移除的工具的问题
  • 修复了当其中一个拉取请求的数据返回不完整时,claude agents 未刷新任何拉取请求状态的问题
  • 修复了云会话容器被替换后,即使代理已经恢复过一次,仍被告知后台代理丢失且不可恢复的问题
  • 修复了你在其中输入过消息的子代理在完成不久后从 /tasks 消失,导致无法返回对话的问题
  • 修复了在你查看子代理时,已完成的主代理从面包屑导航中消失(其子代理显示为重新根植于顶层)的问题
  • 修复了当输入以突发方式到达时,代理视图将输入的单词如“up”、“down”或“escape”误认为按键,从而可能在回复中途移动预览或清除草稿的问题
  • 修复了自动工具搜索(ENABLE_TOOL_SEARCH=auto)在对话中途关闭的问题,例如在恢复后 MCP 服务器重新连接期间
  • 修复了因 forceLoginOrgUUID 导致登录被拒,但被拒组织的 token 仍被存储或处于活跃状态的问题
  • 修复了 Claude Desktop 和远程控制会话中的差异视图未检测到 reftable 仓库中冲突的 cherry-pick 或 revert 的问题
  • 修复了 Artifact 工具在调用输入到达时冗长输出及 ctrl+o 行读取显示 Artifact("(unprintable path)") 的问题;其行现在像 Bash 一样显示“Waiting…”和“Running…”
  • 修复了当崩溃截断转录的最后几行时,恢复会话后写入的第一条转录条目丢失的问题
  • 修复了 /branch 丢弃消息以及 claude purge 跳过子文件夹项目的问题,这些情况发生在包含 Unicode 行分隔符或段落分隔符(U+2028、U+2029)时
  • 修复了 Claude Code 以 --worktree 启动时(尚未支持 --tmux)未运行插件 WorktreeCreate 和 WorktreeRemove 钩子的问题
  • 修复了在使用 reftable 引用存储的仓库中执行 git commit -q 后,OpenTelemetry tool_result 事件缺少 git_commit_id 的问题
  • 修复了 mod 的 prompt.submit 钩子重写或删除的提示词,仍在 OpenTelemetry user_prompt 事件和交互跨度中以及会话标题请求中被记录为已输入的问题
  • 修复了本意为告知 Claude 关于 mod 热重载的备注,在转录中显示为好像是你输入的一样
  • 修复了代理钩子忽略其 model: 别名的情况,例如 haiku 现在可以解析,子代理的模型不再覆盖它,且不可用的模型会回退到调用者的模型而不是允许该操作
  • 修复了当标签或分支名称类似于提交 ID,且其初始 git 状态命名的分支不是新 worktree 的分支时,--worktree 会话有时从错误的提交开始的问题
  • 修复了在使用 git 的 reftable 引用存储的仓库中,分支显示为“.invalid”以及 --worktree 无法重新打开 worktree 的问题
  • 修复了 Claude 在会话临时目录中命名文件时使用裸文件名或相对路径而非完整路径的问题
  • 修复了 claude remote-control 服务器在出现短暂登录错误(如密钥串锁定)后放弃续期连接的问题;现在它们会重试,并在你需要运行 claude /login 时发出警告
  • 修复了在裸仓库的 worktree 中,当无法获取 origin 的默认分支时 --worktree 失败的问题;现在的回退基础是当前检出的 HEAD,而不是主仓库的
  • 修复了在 VS Code、Cursor 或 Devin Desktop 集成终端中启动 Claude Code 时,为检查扩展而两次启动编辑器命令行工具的问题;现在只启动一次
  • 修复了在使用 chat:newline 键绑定(Ctrl+J,或重新绑定的 Enter)输入换行符时,mod 的 prompt.edit hook 未被触发的问题
  • 修复了在 API 拒绝 MCP 工具的输入模式时,对话在每一轮都因 400 错误而失败的问题;Claude Code 现在会在对话的其余部分将该工具作为无参数形式发送
  • 修复了在压缩操作紧随一次因输出令牌限制而被截断的回复之后时,恢复无头模式或 Agent SDK 会话会丢失压缩所保留的最近消息的问题(适用于从此版本开始的压缩操作)
  • 修复了在服务器于压缩操作完成后才完成连接时,直到下一次工具调用之前 Claude 都不知道 MCP 服务器的工具和指令的问题
  • 修复了在同时为多个会话提供服务的计算机上,远程控制会话被标记为已停止但仍在运行的问题
  • 修复了在压缩操作紧随同一轮中重试或未完成的回复之后时,恢复无头模式或 Agent SDK 会话会丢失其压缩摘要或重新引入压缩前历史的问题
  • 修复了 Claude 在后台命令运行期间轮询其输出文件或休眠的问题
  • 修复了功能标志和分阶段发布在仅通过操作系统证书存储信任证书的 TLS 检查代理后保持陈旧的问题
  • 修复了 claude daemon stop --any 在卡住的后台服务仍在运行时打印“stopped”的问题:现在它会等待、强制终止该服务,如果服务仍然存在则返回退出码 1 并告知用户
  • 修复了在关闭遥测功能时,claude daemon stop 无输出退出且将会话列为正在运行的问题
  • 修复了在 Cowork 云会话中,Write、Edit 和 NotebookEdit 对本地计算机上的路径报告成功,但文件从未到达的问题
  • 修复了在会话恢复从未列出这些工具的历史记录时,Claude 搜索已在对话早期加载的延迟工具的问题
  • 修复了在深色 ANSI 主题和 16 色终端下,次要(变暗)文本与正常文本外观相同的问题
  • 修复了在无法读取组织策略时,云会话每轮挂起 5 分钟的问题;现在该轮会及时结束并说明原因
  • 修复了在长时间回复期间会话重启后,云会话有时第二次运行已回答的消息的问题
  • 自托管运行程序:修复了当无人读取其输出时,运行程序和编排器冻结(无轮询、/healthz 或 SIGTERM 关闭)的问题;日志保留最新的 256 KiB,计数下降(不适用于 Windows)
  • 改进了 Cowork 云会话中的 WebFetch,使其能够告知 Claude 页面刚刚失败,而不是再次获取它
  • 改进了内置插件创作技能中的模组分享功能:Claude 在打开模组文件前会先扫描其中的键,并在扫描项目外的文件夹前进行询问
  • 改进了 Claude 3 模型关于 @提及 PDF 的提示说明,使其更少出现未阅读就作答的情况

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件