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

Claude Code v2.1.285:新增allowedProviders限制API提供商及多项安

v2.1.285

原文
发到 X
推荐理由

本次更新引入了 allowedProviders 这一关键的合规管控特性,直接影响企业级部署的安全边界;同时修复了 Artifact 覆盖风险与权限绕过等潜在安全问题。建议依赖此工具进行自动化编码或受管环境部署的开发者立即升级以启用新策略并消除隐患。

What's changed

变更内容

  • Added CLAUDE_CODE_DISABLE_WEB_FETCH environment variable to turn off the WebFetch tool
  • Added claude --desktop to open the Claude desktop app on the current directory, or on a session with --continue / --resume <id>
  • Added claude plugin configure <plugin> to show a plugin's options and which are unset, or save new values read from stdin with --values-stdin
  • Added <server>.<key>=<value> to claude plugin install --config, so a bundled .mcpb MCP server's own settings can be set at install time and it starts without visiting /plugin → Configure
  • Added allowedProviders managed setting to limit which API providers a machine may use (Anthropic API, a custom endpoint, Bedrock, Mantle, Vertex AI, Foundry, Claude Platform on AWS, or a Cloud gateway)
  • Added CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES environment variable to cap re-sends of a non-streaming fallback request that timed out
  • Fixed claude -p with CLAUDE_CODE_FORK_SUBAGENT=1: a subagent's own Agent call now runs in the foreground, so the subagent gets the child's result
  • Fixed plugin and marketplace installs and updates over SSH ignoring the ssh program set in GIT_SSH or in your git config's core.sshCommand
  • Fixed Claude Code refusing to start when the OS denies reading the managed settings file; it now warns and starts without that file's policies. Other read errors and unparseable files stop every session
  • Fixed cloud sessions that restarted after their conversation was compacted refusing the next update to an artifact the session had already read or published
  • Fixed claude plugin disable and enable with a full name@marketplace id changing a settings entry in another letter case instead of the installed plugin's own
  • Fixed files attached to a message sent over Remote Control being left out after a single failed download; a network error, timeout or server error is now retried up to twice
  • Fixed switching models mid-session with a set_model request (such as the Agent SDK's setModel) leaving the new model on the built-in output-token limit and auto-compact window until restart
  • Fixed redacted logs and transcripts showing part of a URL password that contains @, or all of it when the URL writes its @ as %40
  • Fixed SSH passphrase and new-host prompts from worktree and /teleport fetches taking over the terminal; these fetches now fail fast instead of asking
  • Fixed switching off an MCP server added mid-session in SDK and -p sessions leaving its tools available
  • Fixed claude -p --permission-prompt-tool: a background subagent's permission request now goes to the prompt tool instead of being auto-denied
  • Fixed claude mcp list and claude mcp get, and the not-found error of claude mcp remove, login and logout, printing line breaks and terminal escape sequences from MCP server names and values
  • Fixed sandbox auto-allow asking for approval on every run of many inline scripts (python3 -c, node -e) just because they contain =
  • Fixed fork subagents not keeping the session's plan mode or dontAsk mode: a fork now runs under its parent's permission mode and cannot exit plan mode
  • Fixed claude remote-control --help saying --[no-]chrome defaults to the machine's /chrome setting; spawned sessions keep Claude in Chrome off unless --chrome is passed
  • Fixed background subagents in auto mode prompting a second, redundant reply after each report
  • Fixed cloud session creation and /remote-env reading only the newest 20 of an account's environments
  • Fixed Remote Control marking a message as read as soon as it arrived instead of when Claude started on it, and losing a message still queued when the terminal quit (it now arrives on the next resume)
  • Fixed installing a plugin with claude plugin install or /plugin putting it into an installed plugin's cache or data folder when their ids differ only in ., -, @ or (macOS, Windows) capitals; the install is now refused
  • Fixed hooks and SDK permission callbacks seeing a missing or outdated plan on ExitPlanMode when the plan was written in the same response
  • Fixed the first reply in cloud sessions arriving tens of milliseconds late, a regression in 2.1.283
  • Fixed sessions that authenticate with ANTHROPIC_AUTH_TOKEN against the Anthropic API never loading the organization's policy
  • Fixed a failed agent(), parallel() or pipeline() call that a workflow script awaits later, or not at all, being treated as an unhandled promise rejection, which could end a background session
  • Fixed synchronous hooks hanging Claude Code while a background process the hook started (for example some-daemon &) kept its output open; the hook now finishes shortly after its own process exits
  • Fixed WebFetch reporting a rate-limited domain safety check as a network or enterprise policy block
  • Fixed the fullscreen ctrl+o transcript freezing briefly when opened on turns with hundreds of file reads or searches; tool calls still running when the transcript opens now show their results when they finish
  • Fixed Amazon Bedrock mid-stream modelTimeoutException and serviceUnavailableException errors showing a raw JSON body instead of the error message
  • Fixed /autofix-pr and /schedule saying the Claude GitHub App is not installed on a repository whose install status had not been checked yet
  • Fixed dismissing a row (x) in /artifacts unlinking its file from the artifact, so publishing the same file again created a new artifact instead of updating it
  • Fixed Artifact tool publishes after a conversation rewind (Esc Esc) overwriting a file's newer content that Claude had read only in the rewound turns; the publish is now refused until Claude re-reads the file
  • Fixed an Artifact allow rule ("don't ask again") letting the Artifact tool publish a file outside the working directories without asking; add the file's folder with --add-dir for the rule to cover it
  • Fixed /cost and SDK modelUsage reporting a turn under the wrong model when the server answered a refusal with a different fallback model than the client expected
  • Fixed the Artifact tool so that publishing a page no longer lets Claude overwrite its source file without re-reading it when Claude's earlier read was cut short or the file had changed since
  • Fixed auto mode skipping its classifier for Artifact tool asset uploads and reads of someone else's artifact when you had approved that artifact earlier in another permission mode
  • Fixed a misleading "core.worktree is set" error from /ultrareview when the project folder briefly could not be read
  • Fixed /ultrareview on macOS and Linux failing to upload the working tree from a git worktree whose per-worktree config sets core.longpaths
  • Fixed the Artifact tool sometimes reporting a publish as a conflict with another session after retrying a temporary server error, when the first attempt had actually succeeded
  • Fixed /ultrareview uploads including uncommitted changes to credential files whose name has a colon before the extension, such as server:8443.key
  • Fixed a rare auth failure when two sessions recover a login refresh lock left by a crashed process at the same time
  • Fixed the PowerShell tool's permission check skipping deny and ask rules, and caching that failure for later checks, when its command parser failed to start (for example when the machine was out of memory)
  • Fixed /ultrareview uploads on macOS and Linux running slowly on some unusual file names, and their credential-file check missing file or folder names with many backup or editor marks
  • Fixed a cancelled shell command or hook still starting, and running to its end, when the cancel arrived while it was being set up
  • Fixed vim mode: after editing in the external editor (Ctrl+G), x or r in NORMAL mode no longer breaks a pasted-text placeholder at the end of the prompt
  • Fixed responses blocked by the API's output content filter being re-sent and retried, sometimes for minutes, instead of showing the filter's error right away
  • 新增 CLAUDE_CODE_DISABLE_WEB_FETCH 环境变量,用于关闭 WebFetch 工具
  • 新增 claude --desktop 命令,可在当前目录或指定会话(通过 --continue / --resume <id>)中打开 Claude 桌面应用
  • 新增 claude plugin configure <plugin> 命令,用于显示插件的选项及其未设置的值,或通过 --values-stdin 从标准输入读取新值并保存
  • 在 claude plugin install --config 中支持 <server>.<key>=<value> 格式,以便在安装时为内置 .mcpb MCP 服务器设置其自身配置,从而无需访问 /plugin → Configure 即可启动
  • 新增 allowedProviders 托管设置,用于限制机器可使用哪些 API 提供商(Anthropic API、自定义端点、Bedrock、Mantle、Vertex AI、Foundry、AWS 上的 Claude Platform 或 Cloud 网关)
  • 新增 CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES 环境变量,用于限制对超时的非流式回退请求的重试次数
  • 修复了在使用 CLAUDE_CODE_FORK_SUBAGENT=1 时 claude -p 的问题:子代理自身的 Agent 调用现在在前台运行,因此子代理能获取子进程的结果
  • 修复了通过 SSH 安装和更新插件及市场组件时,忽略 GIT_SSH 或 git 配置中 core.sshCommand 所设置的 ssh 程序的问题
  • 修复了当操作系统拒绝读取托管设置文件时 Claude Code 拒绝启动的问题;现在它会发出警告并在没有该文件策略的情况下启动。其他读取错误和无法解析的文件仍会导致所有会话停止
  • 修复了在会话对话被压缩后重启的云会话,拒绝对该会话已读取或发布的工件进行后续更新的问题
  • 修复了使用完整名称@市场 ID 执行 claude plugin disable 和 enable 时,更改了不同大小写设置的条目,而非已安装插件自身设置条目的问题
  • 修复了通过远程控制发送的消息中附加的文件在单次下载失败后被遗漏的问题;现在网络错误、超时或服务器错误将重试最多两次
  • 修复了在会话中途通过 set_model 请求(例如 Agent SDK 的 setModel)切换模型时,新模型直到重启前仍保留内置输出令牌限制和自动压缩窗口的问题
  • 修复了脱敏日志和转录文件中显示包含 @ 的 URL 密码部分,或在 URL 将 @ 写为 %40 时显示全部密码的问题
  • 修复了来自 worktree 和 /teleport 拉取的 SSH 密码短语和新主机提示接管终端的问题;这些拉取操作现在会快速失败而不是询问
  • 修复了在 SDK 和 -p 会话中中途关闭 MCP 服务器后,其工具仍然可用的问题
  • 修复了 claude -p --permission-prompt-tool:后台子代理的权限请求现在会发送到提示工具,而不是被自动拒绝
  • 修复了 claude mcp list 和 claude mcp get,以及 claude mcp remove、login 和 logout 中的未找到错误,并解决了从 MCP 服务器名称和值中打印换行符和终端转义序列的问题
  • 修复了沙箱自动允许在每次运行许多内联脚本(如 python3 -c、node -e)时都询问批准,仅仅因为它们包含 = 符号
  • 修复了 fork 子代理不保持会话的计划模式或 dontAsk 模式的问题:fork 现在在其父代理的权限模式下运行,且无法退出计划模式
  • 修复了 claude remote-control --help 中关于 --[no-]chrome 默认使用机器的 /chrome 设置的说明;除非传递 --chrome 参数,否则派生的会话会将 Claude 保持在 Chrome 关闭状态
  • 修复了自动模式下的后台子代理在每个报告后提示第二次冗余回复的问题
  • 修复了云会话创建和 /remote-env 仅读取账户最新 20 个环境的问题
  • 修复了远程控制将消息标记为已读的时间点问题(应在 Claude 开始处理时标记,而非到达时),以及终端退出时丢失排队消息的问题(现在会在下次恢复时到达)
  • 修复了通过 claude plugin install 或 /plugin 安装插件时,当插件 ID 仅在 .、-、@ 或大小写(macOS、Windows)上存在差异时,将其放入已安装插件的缓存或数据文件夹的问题;现在此类安装将被拒绝
  • 修复了在 ExitPlanMode 期间,当计划在同一响应中写入时,hooks 和 SDK 权限回调看到缺失或过期的计划的问题
  • 修复了云会话中第一条回复延迟数十毫秒到达的问题,这是 2.1.283 版本中的回归
  • 修复了使用 ANTHROPIC_AUTH_TOKEN 向 Anthropic API 进行身份验证的会话从未加载组织策略的问题
  • 修复了工作流脚本稍后等待或未等待的 agent()、parallel() 或 pipeline() 调用失败时,被视为未处理的 Promise 拒绝,从而导致后台会话结束的问题
  • 修复了同步 hooks 在后台进程(例如 some-daemon &)保持输出打开时挂起 Claude Code 的问题;现在 hook 在其自身进程退出后不久完成
  • 修复了 WebFetch 将速率限制域安全检查报告为网络或企业策略阻止的问题
  • 修复了在包含数百次文件读取或搜索的轮次上打开全屏 ctrl+o 转录本时短暂冻结的问题;当转录本打开时仍在运行的工具调用,现在会在完成后显示其结果
  • 修复了 Amazon Bedrock 中途模型超时异常(modelTimeoutException)和服务不可用异常(serviceUnavailableException)错误显示原始 JSON 正文而非错误信息的问题
  • 修复了 /autofix-pr 和 /schedule 命令在尚未检查安装状态的存储库上声称未安装 Claude GitHub App 的问题
  • 修复了在 /artifacts 中点击行(x)取消选中时,解除了该文件与工件的关联,导致再次发布同一文件时会创建新工件而非更新现有工件的问题
  • 修复了对话回滚(Esc Esc)后 Artifact 工具发布操作覆盖了 Claude 仅在回滚轮次中读取过的文件的较新内容的问题;现在直到 Claude 重新读取文件前,发布操作将被拒绝
  • 修复了 Artifact 允许规则(“不再询问”)使 Artifact 工具无需询问即可在工作目录外发布文件的问题;需使用 --add-dir 添加文件所在文件夹,以使规则覆盖该路径
  • 修复了当服务器使用不同于客户端预期的备用模型进行拒绝响应时,/cost 和 SDK modelUsage 将某个轮次报告给错误模型的问题
  • 修复了 Artifact 工具的问题,使得发布页面不再允许 Claude 在未重新读取的情况下覆盖其源文件,这种情况发生在 Claude 之前的读取被截断或文件自那以后发生更改时
  • 修复了自动模式下跳过分类器的问题,该问题出现在你此前在其他权限模式下已批准某工件的情况下,涉及 Artifact 工具的资产上传和读取他人工件的操作
  • 修复了当项目文件夹暂时无法读取时,/ultrareview 产生的误导性“core.worktree is set”错误
  • 修复了 macOS 和 Linux 上 /ultrareview 无法从设置了 core.longpaths 的 git worktree 上传工作树的问题
  • 修复了 Artifact 工具在重试临时服务器错误后,有时将发布报告为与其他会话冲突的问题,而实际上第一次尝试已成功
  • 修复了 /ultrareview 上传包含对扩展名前带有冒号的凭据文件(如 server:8443.key)的未提交更改的问题
  • 修复了当两个会话同时恢复由崩溃进程留下的登录刷新锁时发生的罕见身份验证失败问题
  • 修复了 PowerShell 工具权限检查跳过拒绝和询问规则,并在命令解析器启动失败时(例如内存不足时)缓存该失败以供后续检查的问题
  • 修复了 macOS 和 Linux 上 /ultrareview 上传在某些不常见文件名下运行缓慢,且其凭据文件检查遗漏包含大量备份或编辑器标记的文件或文件夹名的问题
  • 修复了取消的 shell 命令或钩子仍在启动并运行至结束的问题,当取消操作在设置过程中到达时
  • 修复了 vim 模式:在外部编辑器中编辑后(Ctrl+G),NORMAL 模式下的 x 或 r 不再破坏提示符末尾的粘贴文本占位符
  • 修复了被 API 输出内容过滤器阻止的响应被重新发送并重试的问题,有时持续数分钟,而不是立即显示过滤器的错误

更进一步:量化金融体系

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

进入量化体系 →

相似阅读

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