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

Claude Code v2.1.312:修复CLAUDE.md截断、Hook并发限制及多项Bug

v2.1.312

原文
发到 X
推荐理由

本次更新修复了 CLAUDE.md 等大配置文件被意外截断覆盖的关键数据完整性 Bug,以及导致命令加载失败的严重逻辑错误。使用 Claude Code 进行自动化工作流的开发者必须升级以避免配置丢失或工具链瘫痪。

What's changed

变更内容

  • Added oidc.user_id_claim to the Claude apps gateway, to identify people by an id_token claim other than sub, such as Microsoft Entra ID's oid
  • Added click to send: in fullscreen, clicking the "to send now" hint under a queued message sends it right away, as its key does
  • Fixed managed settings and organization policy not being fetched for the rest of the session after signing in from the VS Code extension
  • Fixed Claude overwriting a very large CLAUDE.md, rules file or @-included file in a subdirectory after seeing only its start; Write now asks Claude to read it all or edit in place
  • Fixed per-directory and paths: skills not being found after a Bash cd deeper into a git repository
  • Fixed a rare case where the first reply after resuming a session in the terminal could be missing the next time the session was resumed
  • Fixed a command with an invalid name stopping all commands from loading, which could leave claude -p with no output
  • Fixed the Read tool sometimes failing on PDF pages with "pdftoppm failed: Could not write image" when the clean-up of old session files ran at the same time
  • Fixed the spinner, OpenTelemetry effort values and transcripts naming a newly picked effort level during a task before the model applied it; they now show the level in force
  • Fixed the /model and /effort cache warning saying the re-read waits for your next message; a change made while Claude is working can trigger it sooner
  • Fixed some sessions showing as waiting on you when the last message only mentioned items waiting on you mid-sentence
  • Fixed agent view restoring input text on the next launch after it was cleared with Ctrl+C just before exiting
  • Fixed agent view reopening in shell mode after exiting with Ctrl+D from an empty ! input
  • Fixed vim mode d, c and y with a gj or gk count larger than the lines left deleting or copying text; like Vim, they now only move the cursor
  • Fixed /verify showing a long description meant for Claude in /help and the / command menu instead of a short one
  • Improved the prompt's effort indicator: a change made mid-task now says it may wait for your next message, and the note clears when it no longer applies
  • Improved WebFetch errors in cloud sessions: a host that does not resolve is now explained as possibly outside the allowed network domains, so Claude names the host to allow
  • Changed Bedrock, Vertex, Foundry and Mantle to use the shorter system prompt for model names Claude Code doesn't recognize, such as custom deployment names and inference profile ARNs, even when they front Sonnet or Haiku; set CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0 to keep the full prompt
  • Changed automatic model switches after a flagged message to also cover model names Claude Code doesn't recognize, such as custom deployment names; set CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK=1 to turn them off
  • Changed usage limit messages to call the 5-hour window the "5-hour limit" instead of the "session limit"
  • Changed cloud sessions started from the CLI to get their names and branch names from the server
  • Changed prompt and agent hooks to run at most 24 at a time per session, sub-agents included, plus at most 12 that have waited longer than their event's timeout; a timeout under 1 second now counts as 1 second
  • Changed a subagent's autoCompactWindow to lower the window set by CLAUDE_CODE_AUTO_COMPACT_WINDOW, where it had no effect before; it still never raises that window
  • Changed OpenTelemetry mcp_server.name to report the real name of fixed-URL remote MCP servers declared by plugins from the official Anthropic marketplace, instead of custom
  • Changed Claude Code to stop sending the claude_code.safety_event OpenTelemetry event
  • [VSCode] Fixed sessions ending on a bare exit code when your organization's settings couldn't be loaded or were refused at startup; the tab now says why and offers Retry or Sign in again
  • [VSCode] Changed usage limit resets to show a clock time ("Resets at 3:10 PM") and to say "5-hour limit"
  • [Cloud sessions] Added an effort level to the model picker when you create or edit a routine that runs in the cloud
  • [Cloud sessions] Added a Bash editor with colors, line numbers and a Copy button to the setup script box in cloud environment settings
  • [Cloud sessions] Improved the step shown when Claude adds a repository to a cloud session: opening it now shows a short table of what happened instead of raw JSON
  • [Cloud sessions] Fixed resending an unchanged message after a failed send in a cloud session sometimes running it twice
  • [Cloud sessions] Fixed a failed cloud environment creation showing its error only as a toast outside the open dialog; it now appears inside the dialog
  • [Cloud sessions] Fixed Edit in a routine's menu on the Routines page going to the routine's page without opening its edit dialog
  • [Remote Control] Fixed an unarchived Remote Control session showing as working until a computer reconnected; it now shows as idle
  • [Claude Tag] Improved Claude Tag's retry notice in Slack to name the model in use, or say rate limits were hit, instead of a generic API error
  • [Claude Tag] Fixed a Claude Tag channel's on/off switch and agent settings falling back to workspace defaults when an older private Slack channel goes public and gets a new ID
  • [Claude Tag] Fixed Claude in Slack not replying in channels whose environment has network access set to None
  • [Claude Tag] Fixed Claude in Slack sometimes posting a file in the wrong thread when it was answering in another thread of the same channel
  • [Code Review] Fixed Code Review reviewing an outdated commit, or none at all, when GitHub delivered a push event late; it now reviews the pull request's current commit
  • 在 Claude 应用网关中添加了 oidc.user_id_claim,以便通过 id_token 声明(而非 sub)来识别用户,例如使用 Microsoft Entra ID 的 oid
  • 新增点击发送功能:在全屏模式下,点击排队消息下方的“立即发送”提示即可立即发送该消息,如同按下其快捷键一样
  • 修复了从 VS Code 扩展登录后,会话其余部分未获取托管设置和组织策略的问题
  • 修复了 Claude 在看到子目录中的大型 CLAUDE.md、规则文件或 @-included 文件的开头后覆盖整个文件的问题;现在 Write 会要求 Claude 读取全部内容或就地编辑
  • 修复了在 git 仓库中使用 Bash cd 进入更深层级后,找不到按目录和路径配置的 skills 的问题
  • 修复了一种罕见情况:在终端中恢复会话后,第一次回复可能缺失,导致下次恢复会话时出现问题
  • 修复了名称无效的命令停止加载所有命令的问题,这可能导致 claude -p 无输出
  • 修复了 Read 工具在清理旧会话文件的同时,有时因 "pdftoppm failed: Could not write image" 错误而在 PDF 页面上失败的问题
  • 修复了旋转指示器、OpenTelemetry 努力值和工作转录本在任务期间选择新努力级别但模型尚未应用时显示该级别名称的问题;现在它们显示当前生效的级别
  • 修复了 /model 和 /effort 缓存警告提示重新读取需等待下一条消息的问题;Claude 工作期间的更改可提前触发此警告
  • 修复了某些会话显示为等待用户响应,而最后一条消息仅在句子中间提及等待用户的项目的问题
  • 修复了代理视图在退出前使用 Ctrl+C 清除输入文本后,下次启动时恢复输入文本的问题
  • 修复了从空的 ! 输入使用 Ctrl+D 退出后,代理视图重新以 shell 模式打开的问题
  • 修复了 vim 模式中 d、c 和 y 命令在使用大于剩余行数的 gj 或 gk 计数删除或复制文本时的问题;现在它们仅移动光标,与 Vim 行为一致
  • 修复了 /verify 在 /help 和 / 命令菜单中显示原本为 Claude 设计的长描述,而非简短描述的问题
  • 改进了提示中的努力指标:任务中途的更改现在会提示可能需要等待下一条消息,且当不再适用时该说明会清除
  • 改进了云会话中的 WebFetch 错误处理:无法解析的主机现在被解释为可能位于允许的网络域名之外,因此 Claude 会列出该主机以允许访问
  • 将 Bedrock、Vertex、Foundry 和 Mantle 改为对 Claude Code 无法识别的模型名称(如自定义部署名称和推理配置文件 ARN)使用更短的系统提示词,即使这些名称指向 Sonnet 或 Haiku;设置 CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0 可保留完整提示词
  • 更改自动模型切换机制,使其在收到被标记的消息后也覆盖 Claude Code 无法识别的模型名称(如自定义部署名称);设置 CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK=1 可关闭此功能
  • 更改用量限制提示信息,将 5 小时窗口称为“5 小时限额”而非“会话限额”
  • 更改通过 CLI 启动的云会话,使其从服务器获取名称和分支名称
  • 更改提示词和代理钩子(hooks)的执行限制:每个会话同时运行最多 24 个(包括子代理),加上最多 12 个等待时间超过其事件超时时间的钩子;现在小于 1 秒的超时时间按 1 秒计算
  • 更改子代理的 autoCompactWindow 行为,使其降低由 CLAUDE_CODE_AUTO_COMPACT_WINDOW 设置的窗口值(此前该设置无效);它仍然不会提高该窗口值
  • 更改 OpenTelemetry mcp_server.name 字段,使其报告来自 Anthropic 官方市场插件声明的固定 URL 远程 MCP 服务器的真实名称,而非显示为 custom
  • 更改 Claude Code,停止发送 claude_code.safety_event OpenTelemetry 事件
  • [VSCode] 修复当组织设置无法加载或在启动时被拒绝时,会话因裸退出代码而结束的问题;现在标签页会说明原因并提供重试或重新登录选项
  • [VSCode] 更改用量限制重置提示,显示具体时间(如“下午 3:10 重置”)并使用“5 小时限额”字样
  • [Cloud sessions] 在创建或编辑在云中运行的例行任务时,向模型选择器添加了努力程度选项
  • [Cloud sessions] 在云环境设置的安装脚本框中添加了带颜色、行号和复制按钮的 Bash 编辑器
  • [Cloud sessions] 改进了 Claude 将仓库添加到云会话时显示的步骤:现在打开时会显示简短的操作结果表格,而非原始 JSON
  • [Cloud sessions] 修复了云会话中发送失败后重发未更改消息时有时会导致消息被执行两次的问题
  • [Cloud sessions] 修复了云环境创建失败时错误信息仅以对话框外的 Toast 形式显示的问题;现在错误信息会显示在对话框内部
  • [Cloud sessions] 修复了 Routines 页面中例行任务的菜单里“Edit”选项点击后跳转到例行任务页面但未打开编辑对话框的问题
  • [远程控制] 修复了未归档的远程控制会话在计算机重新连接前一直显示为工作状态的问题;现在会显示为空闲状态
  • [Claude 标签] 改进了 Slack 中 Claude Tag 的重试通知,使其指明正在使用的模型或提示已达到速率限制,而非显示通用的 API 错误
  • [Claude 标签] 修复了当较旧的私有 Slack 频道转为公开并获取新 ID 时,Claude Tag 频道的开关和代理设置回退到工作区默认值的问题
  • [Claude 标签] 修复了当环境的网络访问设置为 None 时,Slack 中的 Claude 无法在相应频道中回复的问题
  • [Claude 标签] 修复了 Claude 在 Slack 中回答同一频道内其他线程问题时,有时会将文件发布到错误线程的问题
  • [代码审查] 修复了在 GitHub 延迟推送事件时,代码审查可能审查过时提交或不进行任何审查的问题;现在会审查拉取请求的当前提交

更进一步:量化金融体系

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

进入量化体系 →

相似阅读

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