官方更新 Claude Code Releases 2026-08-06T00:52 正文 ok 419 words

Claude Code v2.1.223 发布:强化权限安全、市场规则与上下文管理

英文标题:Claude Code v2.1.223

Claude Code v2.1.223 为 `strictKnownMarketplaces` 和 `blockedMarketplaces` 增加 GitHub 组织级通配符规则,可统一允许或阻止组织下的全部 Marketplace 仓库。该版本修复了多项权限与沙箱安全问题,包括 Bash 权限检查绕过、Unicode 隐藏命令内容、工作流动态 `import()` 越出沙箱,以及代理定义绕过组织权限策略等问题。更新还改进了受限子代理模型的告警、云端会话本地续接、模型发现及托管设置合并逻辑。对于开发者而言,版本进一步提升了企业策略管控、会话恢复稳定性和长上下文模型的自动压缩行为可预测性。
打开原文相关 13.2 · 机会 5
media1.3 KB media54.9 KB

中文

更新内容

  • 在 strictKnownMarketplaces 和 blockedMarketplaces 托管设置中新增所有者通配符条目("owner/*"),可用于允许或阻止某个 GitHub 组织下的全部 Marketplace 仓库。
  • 当工作流 Agent、派生 Skill、斜杠命令或恢复的后台 Agent 所请求的子 Agent 模型受到限制、因而改由父模型运行时,新增警告提示。
  • 在云端会话中新增 /teleport 提示,说明如何通过 claude --teleport <session id> 在本地继续会话。
  • 修复 Bash 权限绕过问题:特制命令此前可在权限检查中隐藏自身的一部分内容。
  • 修复权限提示问题:以制表符或不可见 Unicode 字符填充的命令,现已无法在批准对话框中隐藏部分命令内容。
  • 修复工作流脚本可通过动态 import() 在工作流沙箱之外执行代码的问题。
  • 修复权限缺口:Agent 定义的 bypassPermissions 模式此前会忽略组织层面的“禁用绕过权限”策略。
  • 修复会话在中途执行 /cd 后恢复时返回空结果的问题。
  • 修复网关模型发现问题:此前会隐藏注册为带提供商前缀 ID 的 Claude 模型,例如 vertex_ai/claude-* 或 bedrock/anthropic.claude-*。
  • 修复 modelOverrides 中非 Anthropic 模型 ID 的键被视为会话规范模型 ID 的问题;现在会按文档说明忽略未知键。
  • 修复托管设置问题:服务器下发的设置不再禁用机器本地 managed-settings.json 或 MDM 配置文件中的环境变量区块;管理员环境变量现在按键合并。
  • 修复 Linux 上的沙箱命令启动失败问题:当 sandbox.filesystem.denyWrite 覆盖工作目录时,此前命令无法启动。
  • 修复派生后台 Agent 恢复时的问题:如果重建派生分支的父提示词失败,Agent 此前会在该会话剩余时间内一直卡在“already resuming”状态。
  • 修复恢复的会话在历史记录包含格式错误的诊断附件时,每一轮均失败或导致交互式应用停留在无响应错误界面的问题。
  • 修复解析异常 git push 输出时罕见的挂起问题。
  • 调整 CLAUDE_CODE_DISABLE_1M_CONTEXT:该设置现在会通过自动压缩,将所有原生支持 100 万上下文窗口的 Claude 模型限制至 20 万上下文,而不再仅针对固定模型列表;当自动压缩未能将会话限制在 20 万上下文时,启动时将显示警告。
  • 调整自动压缩行为:对于未识别模型 ID,自动压缩现在会将会话保持在假定的上下文窗口内,而不再允许其超出该窗口增长。设置 CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1 可恢复此前行为。
  • 将 /review 改为 /code-review 的别名,后者可审查当前 diff 或 PR(/code-review <level> <pr#>);使用 /code-review ultra 可进行深度云端审查。
  • 调整未指定工作强度级别时的 /code-review:现在会复用上一次输入的级别;输入如 /code-review high 的级别参数即可更改。

English / 原文

  1. Releases
  2. v2.1.223

Compare

Sorry, something went wrong.

No results found

What's changed

  • Added owner wildcard entries ("owner/*") to the strictKnownMarketplaces and blockedMarketplaces managed settings for allowing or blocking all marketplace repos under a GitHub org
  • Added a warning when workflow agents, forked skills, slash commands, or resumed background agents' requested subagent model is restricted and the parent model runs instead
  • Added a /teleport hint in cloud sessions showing how to continue locally with claude --teleport <session id>
  • Fixed a Bash permission bypass where a crafted command could hide parts of itself from permission checks
  • Fixed permission prompts so commands padded with tabs or invisible Unicode can no longer hide part of the command from the approval dialog
  • Fixed workflow scripts being able to use dynamic import() to run code outside the workflow sandbox
  • Fixed a permission gap where an agent definition's bypassPermissions mode ignored the org bypass-permissions disable policy
  • Fixed resuming a session after a mid-session /cd coming back empty
  • Fixed gateway model discovery hiding Claude models registered under provider-prefixed IDs such as vertex_ai/claude-* or bedrock/anthropic.claude-*
  • Fixed modelOverrides keys that aren't Anthropic model IDs being treated as the session's canonical model ID; unknown keys are now ignored as documented
  • Fixed managed settings: server-delivered settings no longer disable the env block of a machine-local managed-settings.json or MDM profile; admin env now merges per key
  • Fixed sandboxed commands failing to start on Linux when sandbox.filesystem.denyWrite covers the working directory
  • Fixed forked background agents getting stuck "already resuming" for the rest of the session when rebuilding the fork's parent prompt failed during resume
  • Fixed a resumed session failing every turn, or leaving the interactive app on an unresponsive error screen, when its history held a malformed diagnostics attachment
  • Fixed a rare hang when parsing unusual git push output
  • Changed CLAUDE_CODE_DISABLE_1M_CONTEXT to hold every Claude model with a native 1M window to 200K via auto-compaction, not just a fixed list; a startup warning now appears when auto-compaction isn't holding the session to 200K
  • Changed auto-compact to keep sessions on unrecognized model IDs within the assumed context window instead of letting them grow past it; set CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1 to restore the previous behavior
  • Changed /review to be an alias of /code-review, which reviews the current diff or a PR (/code-review <level> <pr#>); use /code-review ultra for a deep cloud review
  • Changed /code-review with no effort level to reuse the level you typed last; type a level like /code-review high to change it

You can’t perform that action at this time.