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

Claude Code v2.1.314:新增权限限制与网关功能,修复多项安全与稳定性问题

v2.1.314

原文
发到 X
推荐理由

新增的 blockWritesOutsideWorkingDirectories 是重要的安全加固特性,建议开发者在 CI 或共享环境中启用以限制文件写入范围;同时修复了 TLS 和 MCP 认证等影响核心连接稳定性的深层 Bug,升级收益显著。

What's changed

变更内容

  • Added permissions.blockWritesOutsideWorkingDirectories: Write, Edit and NotebookEdit refuse paths outside the working directories in every permission mode
  • Added an optional groups list to Claude apps gateway upstreams: only developers in the listed IdP groups are sent to that upstream, on failover too
  • Added guardrail_trace to Claude apps gateway Bedrock upstreams, to log which Amazon Bedrock guardrail filter fired on a request, without the matched text
  • Added idle compaction to VS Code and Claude Desktop's Code tab: a 200K+ token conversation left idle is summarized, and the summary is used on your next message if the prompt cache has expired
  • Fixed sessions failing turn after turn with "Invalid effort level" when an organization's admin caps a model's effort: Claude Code now lowers the effort, retries, and says which level it uses
  • Fixed claude -p exiting with code 0 and no output when startup failed; it now prints the error and exits 1
  • Fixed Bedrock sessions with many images failing every turn and /compact with "400 Input is too long." instead of removing older images and compacting
  • Fixed Microsoft Foundry sessions failing when the resource has no deployment for the default Sonnet, Opus or Haiku model: Claude Code now falls back to an older model of that family
  • Fixed repeated refused requests behind a gateway that doesn't accept tool search's tool_reference blocks: the request is sent again once without tool search, and the session remembers
  • Fixed TLS connections failing with UNABLE_TO_GET_ISSUER_CERT when the system certificate store holds a renewed root certificate that is cross-signed with its predecessor
  • Fixed MCP servers that also work without sign-in showing "needs authentication" after their stored sign-in stopped working; they are now used signed out
  • Fixed claude mcp logout reporting success when the MCP sign-in was not removed, for example while the macOS keychain is locked over SSH
  • Fixed extra sign-in renewals when several sessions share an Anthropic profile login and the credentials lock is busy
  • Fixed claude ultrareview and claude remote-control asking the workspace trust question in a CI job that has a terminal; with CI set they now refuse an untrusted folder at once
  • Fixed an administrator's TLS trust settings in managed settings not being applied in Claude Desktop sessions
  • Fixed model switching being refused on machines with managed plugin settings when one of your own --plugin-dir or --plugin-url plugins had a broken manifest or failed to download
  • Fixed the Bedrock and Vertex model upgrade offer coming back at every start when managed settings pin the model
  • Fixed forceRemoteSettingsRefresh set only in remote managed settings no longer applying once the stored copy had expired, which let sessions start without policy when the server could not be reached
  • Fixed "Continue automatically at usage limit" continuing more than three times without a prompt from you when a task restarted itself between waits (a /goal check-in, a background or scheduled task)
  • Fixed background and cloud sessions started with Ultracode turning it back on at their next start after it had been switched off
  • Fixed the last broken reply and its retry prompts staying in the conversation after Claude gave up on a tool call that could not be parsed
  • Fixed a PreCompact hook with very large output making compaction fail or repeat; each hook's output is now cut at 10,000 characters
  • Fixed background diff refreshes briefly taking the repository's index lock, which could make a git command run at the same moment fail with "Unable to create '.git/index.lock': File exists"
  • Fixed markdown tables jumping between grid and stacked layouts on half-typed rows while streaming, and long tables falling back to raw pipes
  • Fixed the /resume picker showing the text of CLAUDE.md or CLAUDE.local.md as a session's title when the session only ran slash commands
  • Fixed /btw answering from the main conversation when asked from a subagent's open transcript
  • Fixed pasting an image over SSH to a Linux machine doing nothing silently; the prompt now says to copy the file over and paste its path
  • Fixed claude remote-control sessions that failed to start when the session service was slow for a moment: the worker's registration is now retried with growing waits
  • Fixed model switches over Remote Control that take over 8 seconds getting a "still pending" error instead of the final result
  • Fixed the sandbox.excludedCommands setting description saying listed commands always run outside the sandbox; it now says every command in a call must match an entry
  • Fixed shell and MCP calls that auto mode, a deny rule or a PreToolUse hook blocked, or that otherwise did not run, reading as if they ran in a collapsed tool group
  • Fixed sandbox protections not applying to a worktree entered by claude -p --resume or --continue
  • Fixed hooks matching Bash not running on shell commands started by the Monitor tool; such hooks can block or ask, but not approve or rewrite those commands
  • Fixed a settings file excluded with --setting-sources still supplying some settings, such as auto mode rules and saved permission consents
  • Fixed auto mode reporting a call as blocked, and listing it in /permissions, when its safety check gave no verdict
  • Fixed a Claude apps gateway Vertex upstream hanging for minutes when a Google token endpoint accepts the connection and never answers
  • Fixed the Claude apps gateway's start-up warning for a deprecated Claude Desktop key that it still serves as written saying "stops being accepted" after the key's end date
  • Fixed /upgrade opening the browser and starting a new login for plans billed through the App Store or Google Play; it now says where to change the plan
  • Fixed --resume, and rewinding past a switch to another model after a refusal, moving a session on a model name Claude Code doesn't recognize to a different model
  • Fixed requests failing when a gateway or cloud provider refuses one of Claude Code's beta headers by name: the request is sent again without it
  • Fixed model IDs spelled with a dot behind an LLM gateway, such as claude-opus-4.8, being treated as an older model with the wrong context window, output limit, effort, thinking mode and cost
  • Fixed Remote Control clients showing a stray "Compacted (ctrl+o to see full summary)" row after /compact
  • Fixed the cloud sessions tip and the Remote Control idle notice showing when an organization's policy turns those features off
  • Fixed a resumed claude.ai cloud session making a model call nobody asked for when the previous worker stopped just after receiving a new chat's files
  • Fixed WebFetch in Cowork cloud sessions silently dropping a PDF's text past 100,000 characters; it now says how much was unread and where to read on
  • Fixed Claude being told only that a command was declined after you stopped it with Esc or Stop in a cloud session or the IDE; it now also hears that the command may have run
  • Fixed blank lines at the top of a code block disappearing when the code block opens a quote
  • Fixed a blank line appearing above some ⎿ rows in the transcript view (Ctrl+O)
  • Fixed vim mode dw, dW, yw and yW carrying on past the end of the line, and made w and W stop on empty lines
  • Fixed x and Enter in the agent panel sometimes acting on the wrong agent when another agent started or finished
  • Fixed pasted text and dragged-in files being lost in Claude's question dialog unless the "Other" row had focus
  • Fixed pasted text being lost when a row in the prompt footer was selected
  • Fixed vim mode p over a character selection ignoring whether the yanked text was whole lines
  • Fixed vim mode aw and iw taking the line break at the end of a line
  • Fixed ↓ selecting footer items hidden by the ? help menu, the command list or a paste hint
  • 新增 permissions.blockWritesOutsideWorkingDirectories:在所有权限模式下,Write、Edit 和 NotebookEdit 均拒绝工作目录之外的路径
  • 为 Claude apps gateway 上游服务新增了可选的 groups 列表:仅将列出的 IdP 组中的开发者路由到该上游,故障转移时亦然
  • 为 Claude apps gateway Bedrock 上游服务新增了 guardrail_trace,用于记录请求触发了哪个 Amazon Bedrock guardrail 过滤器,但不包含匹配的文本
  • 为 VS Code 和 Claude Desktop 的 Code 标签页新增了空闲压缩功能:超过 20 万 token 且处于空闲状态的对话会被摘要化,若提示词缓存已过期,下次消息时将使用摘要
  • 修复了当组织管理员限制模型 effort 级别时,会话逐轮失败并报错“Invalid effort level”的问题:Claude Code 现在会降低 effort 级别并重试,同时告知使用的级别
  • 修复了 claude -p 在启动失败时以代码 0 退出且无输出的问题;现在它会打印错误信息并以代码 1 退出
  • 修复了包含大量图片的 Bedrock 会话每轮都失败以及 /compact 命令报错“400 Input is too long.”而非移除旧图片并进行压缩的问题
  • 修复了 Microsoft Foundry 会话在资源未部署默认 Sonnet、Opus 或 Haiku 模型时失败的问题:Claude Code 现在会回退到该系列的旧版模型
  • 修复了在不接受 tool search 的 tool_reference 块的上游网关后重复被拒的请求问题:请求会在不使用 tool search 的情况下重试一次,且会话会记住这一状态
  • 修复了当系统证书存储中包含与前任交叉签发的续期根证书时,TLS 连接因 UNABLE_TO_GET_ISSUER_CERT 而失败的问题
  • 修复了无需登录即可运行的 MCP 服务器在其存储的登录方式失效后仍显示“needs authentication”的问题;现在它们将以未登录状态使用
  • 修复了 claude mcp logout 在 MCP 登录未被移除(例如通过 SSH 时 macOS 钥匙串处于锁定状态)时仍报告成功的问题
  • 修复了当多个会话共享 Anthropic 配置文件登录且凭据锁忙时出现的额外登录续期问题
  • 修复了 claude ultrareview 和 claude remote-control 在有终端的 CI 作业中询问工作区信任问题的情况;设置 CI 后,它们现在会立即拒绝不受信任的文件夹
  • 修复了受管设置中管理员的 TLS 信任设置在 Claude Desktop 会话中未应用的问题
  • 修复了在托管插件设置生效的机器上,当用户自己的 --plugin-dir 或 --plugin-url 插件存在损坏的清单或下载失败时,模型切换被拒绝的问题
  • 修复了当托管设置固定了模型时,每次启动都会重新出现 Bedrock 和 Vertex 模型升级提示的问题
  • 修复了仅在远程托管设置中设置的 forceRemoteSettingsRefresh 在存储副本过期后不再应用的问题,这导致在无法连接服务器时,会话会在无策略的情况下启动
  • 修复了当任务在等待期间自行重启(例如 /goal 签到、后台任务或计划任务)时,“达到使用限制后自动继续”功能在没有用户提示的情况下连续执行超过三次的问題
  • 修复了使用 Ultracode 启动的后台和云会话在 Ultracode 被关闭后,下次启动时又将其重新开启的问题
  • 修复了当 Claude 放弃解析失败的 tool call 后,最后一条损坏的回复及其重试提示仍保留在对话中的问题
  • 修复了输出量极大的 PreCompact 钩子导致压缩失败或重复执行的问题;现在每个钩子的输出将在 10,000 个字符处截断
  • 修复了后台差异刷新短暂占用仓库索引锁,从而导致同时运行的 git 命令因 "Unable to create '.git/index.lock': File exists" 而失败的问题
  • 修复了流式传输过程中,半输入的表格行在网格布局和堆叠布局之间跳动,以及长表格回退到原始管道格式的问题
  • 修复了当会话仅运行斜杠命令时,/resume 选择器将 CLAUDE.md 或 CLAUDE.local.md 的文本显示为会话标题的问题
  • 修复了从子代理的打开转录本中询问 /btw 时,它却从主对话中进行回答的问题
  • 修复了通过 SSH 向 Linux 机器粘贴图像时静默无响应的问题;现在提示会要求复制文件并粘贴其路径
  • 修复了当会话服务暂时变慢时,claude 远程控制会话无法启动的问题:现在工作进程的注册将采用递增等待时间进行重试
  • 修复了通过远程控制进行的耗时超过 8 秒的模型切换返回 "still pending" 错误而非最终结果的问题
  • 修复了 sandbox.excludedCommands 设置描述称列出的命令始终在沙箱外运行;现在改为说明调用中的每个命令都必须匹配某一项
  • 修复了 shell 和 MCP 调用在被自动模式、拒绝规则或 PreToolUse 钩子阻止,或以其他方式未运行时,却在折叠的工具组中显示为已执行的问题
  • 修复了通过 claude -p --resume 或 --continue 进入的工作树未应用沙箱保护的问题
  • 修复了与 Bash 不匹配的钩子未能在由 Monitor 工具启动的 shell 命令上运行的问题;此类钩子可以阻止或询问,但不能批准或重写这些命令
  • 修复了使用 --setting-sources 排除的设置文件仍会提供某些设置(如自动模式规则和已保存的权限同意)的问题
  • 修复了当安全检查未给出结论时,自动模式将调用报告为被阻止并在 /permissions 中列出该调用的问题
  • 修复了 Claude 应用网关在 Google token 端点接受连接但永不响应时,Vertex 上游挂起数分钟的问题
  • 修复了 Claude 应用网关对已弃用的 Claude Desktop 密钥发出的启动警告,该密钥在其结束日期后仍按原样提供服务,并提示“停止被接受”
  • 修复了 /upgrade 通过 App Store 或 Google Play 计费时打开浏览器并开始新登录的问题;现在它会告知在哪里更改计划
  • 修复了 --resume 以及在被拒绝后回退到另一个模型切换时,将会话从 Claude Code 无法识别的模型名称移动到不同模型的问题
  • 修复了当网关或云提供商因名称拒绝 Claude Code 的某个 beta 标头时请求失败的问题;请求会在不带该标头的情况下重新发送
  • 修复了 LLM 网关后带有句点的模型 ID(如 claude-opus-4.8)被当作具有错误上下文窗口、输出限制、努力程度、思考模式和成本的旧模型处理的问题
  • 修复了 Remote Control 客户端在 /compact 之后显示一个孤立的“Compacted (ctrl+o to see full summary)”行的问题
  • 修复了当组织的策略关闭这些功能时,仍显示云会话提示和 Remote Control 空闲通知的问题
  • 修复了恢复的 claude.ai 云会话在前一个工作进程刚收到新聊天文件后停止时,发起无人请求的模型调用的问题
  • 修复了 Cowork 云会话中的 WebFetch 静默丢弃超过 100,000 个字符的 PDF 文本的问题;现在它会说明有多少内容未被读取以及从哪里继续阅读
  • 修复了在云会话或 IDE 中使用 Esc 或 Stop 停止命令后,Claude 仅被告知命令被拒绝的问题;现在它还会得知该命令可能已运行
  • 修复了代码块打开引用时,代码块顶部的空行消失的问题
  • 修复了转录视图(Ctrl+O)中某些 ⎿ 行上方出现空行的问题
  • 修复了 vim 模式下 dw、dW、yw 和 yW 越过行尾继续执行的问题,并使 w 和 W 在空行处停止
  • 修复了当另一个代理开始或结束时,agent 面板中的 x 和 Enter 有时作用于错误代理的问题
  • 修复了在 Claude 的提问对话框中,除非“Other”行获得焦点,否则粘贴的文本和拖入的文件会丢失的问题
  • 修复了在提示词页脚中选择某一行时,粘贴的文本会丢失的问题
  • 修复了 Vim 模式下 p 键在字符选择时忽略已复制文本是否为整行的问题
  • 修复了 Vim 模式下 aw 和 iw 命令会选取行末换行符的问题
  • 修复了 ↓ 键会选择由 ? 帮助菜单、命令列表或粘贴提示隐藏的页脚项目的问题

更进一步:量化金融体系

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

进入量化体系 →

关联讨论

同一事件的更多信源

相似阅读

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