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

Claude Code v2.1.260:修复Bash沙箱权限绕过与prompt缓存失效

v2.1.260

原文
发到 X
推荐理由

本次更新包含 Bash 沙箱权限绕过漏洞修复(破坏性/安全),直接影响代码执行安全性,建议立即升级。同时修复了 Fable 5.1 的缓存失效问题,对高频调用者有显著性能收益。

What's changed

变更内容

  • Added a diff panel that opens beside the conversation in fullscreen mode and shows your uncommitted changes as Claude edits; toggle it with /diff
  • Added a likely cause for prompt-cache misses (e.g. tool definitions or system prompt changed, idle past the TTL) to /cost and the status line's prompt_cache field
  • Added /reload-plugins to headless sessions, so it appears in the Claude Code Desktop and SDK command lists
  • Added a text form of /advisor (/advisor, /advisor <model>, /advisor off) for the desktop app, Remote Control, and other headless (-p/Agent SDK) sessions
  • Added oidc.scope_on_refresh to the Claude apps gateway for IdPs that return an id_token on refresh only when asked for openid again
  • Added Claude apps gateway support for newer Claude Desktop keys in desktop policy blocks, including userPluginMarketplacesEnabled and userPluginUploadsEnabled
  • Fixed Edit/Write/Read permission rules whose path contains parentheses being dropped as invalid or ignored by the Bash sandbox, which left "read-only" folders writable
  • Fixed one file permission rule with an uncompilable pattern (e.g. an unclosed [) making every file edit fail with Invalid regular expression; such a deny rule now guards the literal path it spells
  • Fixed Bash permission checks auto-approving zsh commands that hide a command substitution in a REPORTTIME, REPORTMEMORY or DIRSTACKSIZE assignment; these now prompt for approval
  • Fixed Bedrock model discovery, token counting and AWS SSO/STS credential calls failing with "unable to get local issuer certificate" when the corporate root CA is only in the OS certificate store
  • Fixed permissions.blockReadsOutsideWorkingDirectories on macOS hiding the user's git config from sandboxed git and hiding a worktree-isolated sub-agent's own checkout
  • Fixed managed settings not loading for claude.ai Enterprise/Team users who also had a leftover API key from an earlier /login
  • Fixed /status listing a signed-in claude.ai account and a configured API key as if both were in effect; the credential not in use is now marked
  • Fixed managed skillOverrides entries keyed on a bundled skill's alias (e.g. checkup for /doctor) not applying, and Skill(name) deny rules not covering a nested skill listed as <dir>:name
  • Fixed model: fable agents ignoring the [1m] tag on an ANTHROPIC_DEFAULT_FABLE_MODEL pin and silently running with a 200K context window
  • Fixed the /model picker not showing Fable 5.1 for organizations that can use it, which was only accepted when typed as /model claude-fable-5-1
  • Fixed prompt caching on Claude Fable 5.1 not covering the context attached after tool results, so it was re-sent as uncached input on every tool-call turn
  • Fixed model switching staying blocked for the rest of the session after a plugin hook load failure; each switch now re-checks and the refusal names the cause
  • Fixed model switching being blocked for the session when an organization-managed plugin's marketplace could not be loaded
  • Fixed SDK-provided MCP servers (e.g. Desktop connectors) sometimes missing from the first turn and only appearing on the next one
  • Fixed Claude in Chrome tools failing with "Not connected" mid-task in cloud-hosted claude.ai sessions when a connector was added or removed
  • Fixed flags, joined emoji and accented letters splitting across wrapped lines, and stale text staying on screen when a flag or joined emoji falls in the terminal's last two columns (now shown as …)
  • Fixed Remote Control accepting a model pick that is not a valid model name; it is now refused with an error instead of failing on the next message
  • Fixed /rewind and --rewind-files reporting success when checkpoint backup files were missing and nothing was actually restored
  • Fixed /rewind leaving stale file-read tracking from the rewound-away turns, which caused "File unchanged since last read" stubs and full-file re-injection after external edits
  • Fixed -p --resume/--continue (as used by the desktop app) failing on every retry once a session's worktree directory lost its git metadata; it now fails once, then resumes without the worktree
  • Fixed a subagent that resumed another agent via SendMessage never being woken by that agent's completion (the notification went to the main conversation instead)
  • Fixed agent teams: an in-process teammate's transcript losing messages, or going blank, during long API retry waits (e.g. under CLAUDE_CODE_RETRY_WATCHDOG) as retry notices evicted real messages
  • Fixed a session that moved to the background appearing twice in ListAgents (once as a phantom "interactive" twin with the same name) and receiving SendMessage deliveries in the viewer
  • Fixed intermittent "task output swap refused" errors when many sessions share a project directory
  • Fixed Ctrl+Z in fullscreen leaving the shell on the alternate screen, drawn over the paused interface
  • Fixed Workflow tool subagents being restarted as stalled while a long context compaction was still in progress
  • Fixed plugins from a URL marketplace failing to install with "marketplace entry path does not stay inside the marketplace directory" when a host app (e.g. Claude Desktop) stores it as a directory
  • Fixed an extra browser tab opening when an artifact is published in a session you're driving from claude.ai, the desktop app, or mobile (Remote Control)
  • Fixed the Artifact tool's first call failing with an "Invalid tool parameters" validation error in some Cowork sessions
  • Fixed IDE line selections being dropped when running a skill or slash command (the "N lines selected" context now reaches Claude)
  • Fixed repository detection for GitLab projects in nested subgroups (e.g. gitlab.com/group/subgroup/project)
  • Fixed owner/repo#123 issue references in rendered output linking to github.com when working in a GitLab repository; they now link to the gitlab.com issue
  • Glob/Grep: Fixed the search path being probed on disk before the permission check; a missing path is now reported after permission is decided, as Read does
  • Reverted the 2.1.259 change applying Read() deny rules to Bash arguments; it denied npm run build under a Read(./**/build/**) rule in every mode and made cd … && grep prompt even in auto mode
  • Improved structured output: Workflow agent({schema}) rejects a JSON Schema that can never be satisfied up front, and retry-cap errors now include the last validation failure
  • Improved deleting a background session whose worktree has unpushed commits: the message now names the branch and commit count, and deleting again discards the worktree
  • Improved the Claude apps gateway's refresh-failure log to name the step that failed
  • Improved idle CPU usage of non-interactive (-p / SDK) sessions
  • Improved the Claude apps gateway on Amazon Bedrock: input tokens for an aborted request are now counted with AWS's free CountTokens API (grant bedrock:CountTokens) instead of a one-token request
  • Improved the settings error for rules such as Edit(C:\dir\(name)\**), where \( is read as an escaped parenthesis rather than a path separator, to suggest an unambiguous spelling
  • Improved auto-compact for 1M-context models: Opus and Fable sessions now compact shortly before the 1M-token limit, and recovery compaction on very large contexts no longer times out at 10 minutes
  • Improved /ultrareview and claude ultrareview to wait up to 45 minutes (previously 30) for long-running cloud reviews
  • Improved /effort on Claude Fable 5.1 so changing effort mid-session no longer invalidates the prompt cache
  • Updated the bundled claude-api skill so its Go, Java, and C# samples use current-generation model IDs, and clarified that cheaper worker or sub-agent models should be current-generation too
  • Changed ctrl+l / cmd+k in fullscreen mode to clear the transcript view like a terminal clear; scroll up to see earlier messages
  • 新增差异面板,在全屏模式下打开于对话旁边,并在 Claude 编辑时显示你的未提交更改;通过 /diff 切换显示
  • 在 /cost 和状态栏的 prompt_cache 字段中,新增了提示词缓存未命中的可能原因(例如工具定义或系统提示词已更改、空闲时间超过 TTL)
  • 在无头会话中新增 /reload-plugins 命令,使其出现在 Claude Code Desktop 和 SDK 的命令列表中
  • 为桌面应用、Remote Control 以及其他无头(-p/Agent SDK)会话新增了 /advisor 的文本形式(/advisor、/advisor <model>、/advisor off)
  • 在 Claude 应用网关中新增 oidc.scope_on_refresh 配置,适用于仅在再次请求 openid 时才返回 id_token 的身份提供商 (IdP)
  • Claude 应用网关新增对桌面策略块中较新 Claude Desktop 密钥的支持,包括 userPluginMarketplacesEnabled 和 userPluginUploadsEnabled
  • 修复了路径包含括号时,Edit/Write/Read 权限规则被 Bash 沙箱视为无效而丢弃或忽略的问题,这曾导致“只读”文件夹可写
  • 修复了一个因模式无法编译(例如存在未闭合的 [)而导致所有文件编辑均失败并报错 Invalid regular expression 的文件权限规则;此类拒绝规则现在仅保护其字面量指定的路径
  • 修复了 Bash 权限检查自动批准 zsh 命令的问题,这些命令在 REPORTTIME、REPORTMEMORY 或 DIRSTACKSIZE 赋值中隐藏了命令替换;现在这些操作会提示用户批准
  • 修复了在企业根 CA 仅存在于操作系统证书存储中时,Bedrock 模型发现、令牌计数以及 AWS SSO/STS 凭证调用因“无法获取本地颁发者证书”而失败的问题
  • 修复了 macOS 上 permissions.blockReadsOutsideWorkingDirectories 设置隐藏沙箱化 git 的用户 git 配置,以及隐藏工作树隔离的子代理自身签出内容的问题
  • 修复了 claude.ai Enterprise/Team 用户若残留有早期 /login 留下的 API 密钥,则托管设置无法加载的问题
  • 修复了 /status 将已登录的 claude.ai 账户和已配置的 API 密钥同时列为生效状态的问题;现在未使用的凭证会被标记
  • 修复了以捆绑技能别名(例如 /doctor 对应的 checkup)为键的托管 skillOverrides 条目未生效,且 Skill(name) 拒绝规则未覆盖列为 <dir>:name 的嵌套技能的问题
  • 修复了 model: fable 代理忽略 ANTHROPIC_DEFAULT_FABLE_MODEL 固定值上的 [1m] 标签,并静默使用 200K 上下文窗口运行的问题
  • 修复了对于可以使用 Fable 5.1 的组织,/model 选择器未显示 Fable 5.1 的问题;此前仅当输入 /model claude-fable-5-1 时才会被接受
  • 修复了 Claude Fable 5.1 上的提示词缓存未覆盖工具结果后附加的上下文的问题,导致每次工具调用轮次都将其作为未缓存输入重新发送
  • 修复了插件钩子加载失败后模型切换在会话剩余时间内保持阻塞的问题;现在每次切换都会重新检查,并在拒绝时指明原因
  • 修复了当组织管理的插件的市场无法加载时,模型切换被整个会话阻塞的问题
  • 修复了 SDK 提供的 MCP 服务器(例如桌面连接器)有时在第一轮中缺失,仅在下一次出现的情况
  • 修复了在云托管的 claude.ai 会话中,添加或删除连接器时,Chrome 工具中的 Claude 在任务中途因“未连接”而失败的问题
  • 修复了旗帜、连字表情符号和带重音字母在换行时被拆分,以及当旗帜或连字表情符号位于终端最后两列时旧文本仍停留在屏幕上的问题(现在显示为 …)
  • 修复了远程控制接受无效模型名称的问题;现在会报错拒绝,而不是在下一条消息时失败
  • 修复了当缺少检查点备份文件且实际上未恢复任何内容时,/rewind 和 --rewind-files 报告成功的问题
  • 修复了 /rewind 遗留已回退轮次的陈旧文件读取跟踪,这导致在外部编辑后出现“自上次读取以来文件未更改”的存根以及完整文件的重新注入
  • 修复了 -p --resume/--continue(桌面应用使用此参数)在会话的工作树目录丢失 git 元数据后每次重试都失败的问题;现在它只失败一次,然后在没有工作树的情况下继续执行
  • 修复了通过 SendMessage 恢复另一个代理的子代理从未被该代理的完成通知唤醒的问题(通知发送到了主对话中)
  • 修复了代理团队的问题:在长时间 API 重试等待期间(例如在 CLAUDE_CODE_RETRY_WATCHDOG 下),进程内队友的转录本丢失消息或变为空白,因为重试通知驱逐了真实消息
  • 修复了移动到后台的会话在 ListAgents 中出现两次(一次是与同名相同的幻影“交互式”副本)以及在查看器中接收 SendMessage 投递的问题
  • 修复了当多个会话共享一个项目目录时间歇性出现的“任务输出交换被拒绝”错误
  • 修复了全屏模式下按 Ctrl+Z 使 shell 留在备用屏幕上,并绘制在暂停界面上的问题
  • 修复了在工作树压缩仍在进行时,Workflow 工具子代理被重启为停滞状态的问题
  • 修复了从 URL 市场安装的插件在主机应用(如 Claude Desktop)将其存储为目录时,因“市场条目路径未保持在市场目录内”而安装失败的问题
  • 修复了在通过 claude.ai、桌面应用或移动端(远程控制)驱动会话并发布工件时,额外打开浏览器标签页的问题
  • 修复了在某些 Cowork 会话中,Artifact 工具的首次调用因“无效的工具参数”验证错误而失败的问题
  • 修复了运行技能或斜杠命令时 IDE 行选择被丢弃的问题(现在“已选择 N 行”的上下文会传递给 Claude)
  • 修复了对嵌套子组中的 GitLab 项目(例如 gitlab.com/group/subgroup/project)的仓库检测问题
  • 修复了在 GitLab 仓库中工作时,渲染输出中的 owner/repo#123 问题引用链接到 github.com 的问题;现在它们将链接到 gitlab.com 上的对应问题
  • Glob/Grep:修复了权限检查前在磁盘上探测搜索路径的问题;缺失的路径现在会在确定权限后报告,与 Read 的行为一致
  • 回退了 2.1.259 版本中将 Read() 拒绝规则应用于 Bash 参数的更改;该更改在所有模式下都拒绝了符合 Read(./**/build/**) 规则的 npm run build,并在自动模式下使 cd … && grep 提示符出现
  • 改进了结构化输出:Workflow agent({schema}) 现在会提前拒绝永远无法满足的 JSON Schema,且支持重试的错误现在包含最后一次验证失败的信息
  • 改进了删除具有未推送提交的工作树的后台会话时的提示信息:现在消息会指明分支和提交数量,再次删除时会丢弃工作树
  • 改进了 Claude 应用网关的刷新失败日志,使其指明失败的步骤
  • 改进了非交互式(-p / SDK)会话的空闲 CPU 使用率
  • 改进了 Amazon Bedrock 上的 Claude 应用网关:中止请求的输入令牌现在通过 AWS 的免费 CountTokens API(授予 bedrock:CountTokens 权限)进行计数,而不是发送一个单令牌请求
  • 改进了针对类似 Edit(C:\dir\(name)\**) 的规则设置错误的提示,其中 \( 被解析为转义括号而非路径分隔符,建议更明确的拼写方式
  • 改进了 1M 上下文模型下的自动压缩功能:Opus 和 Fable 会话现在会在接近 1M 令牌限制前进行压缩,且在极大上下文下的恢复性压缩不再在 10 分钟时超时
  • 改进了 /ultrareview 和 claude ultrareview 命令,使其等待长时间运行的云端审查的时间延长至最多 45 分钟(此前为 30 分钟)
  • 改进了 Claude Fable 5.1 中的 /effort 命令,使得在会话中途更改努力程度不再使提示缓存失效
  • 更新了捆绑的 claude-api 技能,使其 Go、Java 和 C# 示例使用当前世代的模型 ID,并明确说明更便宜的 worker 或子代理模型也应为当前世代
  • 在全屏模式下将 ctrl+l / cmd+k 更改为清除转录视图,类似于终端清屏;向上滚动可查看更早的消息

更进一步:量化金融体系

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

进入量化体系 →

相似阅读

另一事件,读法相近