官方更新 Claude Code Releases 2026-09-15T20:23 正文 ok 1592 words

Claude Code v2.1.273

英文标题:Claude Code v2.1.273

Claude Code v2.1.273 为 LLM 网关新增多项可选请求提示头,并改善 MCP 服务器断连、远程控制会话分叉及云端会话等功能。此次更新集中修复了权限检查、上下文压缩、子 Agent、GitHub 集成、Artifact 工具以及 Bedrock、Vertex、Foundry 认证等问题。对开发者而言,新版本提高了长时间会话、后台 Agent、企业托管配置和多平台部署的可靠性,同时提供了更具针对性的诊断错误信息。
打开原文相关 15.6 · 机会 4
media1.3 KB media54.1 KB

中文

  1. 版本发布
  2. v2.1.273

更新内容

  • 为 LLM 网关新增 x-claude-code-request-class、x-claude-code-agent-type、x-claude-code-prev-tool-durations、x-claude-code-compaction 和 x-claude-code-context-compacted 请求头;可通过 CLAUDE_CODE_GATEWAY_HINT_HEADERS=1 选择启用。
  • 当 MCP 服务器在会话中途断开连接且自动重连最终放弃时,新增通知,并指向 /mcp。
  • 支持从 Claude 应用中分叉通过 claude --remote-control 或 /remote-control 启动的会话;分叉后的会话将在你的计算机上作为后台会话运行。
  • 修复了在 permissions.blockReadsOutsideWorkingDirectories 下,权限检查器无法完全分析的 Bash 命令会跳过提示的问题;同时修复了在绕过模式下,子 shell 隐藏危险 rm 命令的问题。
  • 修复从 claude.ai 同步的 Skills 在组织关闭 Skills 后仍可使用的问题;这些 Skills 现在会被移至可恢复的垃圾箱。
  • 修复了通过 MDM 或 managed-settings.json 设置的 allowManagedMcpServersOnly、deniedMcpServers 和 disableClaudeAiConnectors 在同时存在服务器托管设置时被忽略的问题。
  • 修复 Bedrock、Vertex 和 Foundry 上的 401/403 错误,以及 Claude 应用网关的 403 错误;现在会提示你运行 /login。消息现在会指出需要刷新的凭证,或引导你联系网关管理员。
  • 修复 /login、/upgrade 和 /extra-usage 丢弃对话中先前思考内容的问题,该问题此前会迫使下一次请求完整重写提示词缓存。
  • 修复自动模式在云端或 Remote Control 会话中,当 Artifact 工具上传你附加到聊天中的文件时会停止并等待批准的问题。
  • 修复了仓库的 .git 目录被删除或移走后,长时间运行的会话重新创建空白 .git/info/exclude 文件的问题。
  • 修复已处于 shell 模式时,在开头输入的 ! 会从主提示中丢失的问题;现在可以输入 ! grep … 等否定命令。
  • 修复 macOS 上 Read 拒绝读取拖入的截图,或系统报告为第二路径的任何文件,并显示“权限检查后符号链接解析发生变化”的问题。
  • 修复 permissions.blockReadsOutsideWorkingDirectories:仓库设置所选定的 memory 目录不再被加载到提示词、被回忆、被索引或用于 memory 提取。
  • 修复当最终流式回复缺少 token 使用量或不包含模型 ID 时,子 Agent 和后台 Agent 被报告为失败且其结果永远无法送达的问题。
  • 修复上下文计量器和自动压缩将 advisor-tool 轮次计为实际上下文大小约两倍的问题;该问题此前会导致自动压缩在真实窗口约一半时触发。
  • 修复 /tui 因 Agent 团队中已完成任务且不再显示在 Agent 面板中的队友而拒绝重启的问题。
  • 修复将 .claude/scheduled_tasks.json 复制到其他文件夹(例如新的 worktree)后,已保存的定时任务在错误会话中运行的问题。
  • 修复 SDK 和 --output-format stream-json 输出在子 Agent 运行中途转入后台后(例如由 CLAUDE_AUTO_BACKGROUND_TASKS 触发),丢失其剩余消息和最终报告的问题。
  • 修复 /install-github-app 将 SAML 单点登录阻止错误报告为“需要管理员权限”的问题。
  • 修复附加到 Claude Desktop、VS Code 或 JetBrains 会话的 Remote Control 客户端在请求会话上下文窗口使用量时被拒绝的问题。
  • 修复压缩状态行(例如“Running PreCompact hooks…”)中的加载指示器显示双省略号(“……”)的问题。
  • 修复在读取或发布 Artifacts 后,加载指示器错误推荐 frontend-design 插件的提示。
  • 回退 2.1.268 中对权限检查器无法分析的 Bash 行(eval、env -C)检查 Read 和 Edit 拒绝规则的改动;诸如 time -p make build 的命令现在会再次请求确认,而非被拒绝。
  • 改善长会话响应性:hook 进度和子 Agent 活动不再在每次更新时重新处理整个对话。
  • 改进 Artifact 工具的错误信息:当发布包含 artifacts 不提供服务的文件类型时,Claude 会获知可提供服务的类型及后续操作,终端则会显示一行简明信息。
  • 改进 Artifact 工具的页面读取功能,向任何可发布该页面的用户说明 artifact 服务为页面提供的功能与数据库规则。
  • 改进 artifact 数据库写入:更新现在可删除单个字段,而不必重写整个文档。
  • 改进 artifact 发布:发布请求在到达 claude.ai 后连接中断时,现在会被安全地重新发送,而不会失败或创建重复版本。
  • 改进云端会话中 GitHub 对 IP 允许列表、暂停的应用安装或 SAML 单点登录的错误提示,显示具体原因而非通用安装提示。
  • 改进 /autofix-pr:当 gh pr view 失败时,现在显示 gh 自身的错误信息(登录、SAML、速率限制),而非通用退出代码行。
  • 改进 /autofix-pr,现在会说明无法为 PR 配置 GitHub webhook 投递的原因(例如未关联 GitHub 账号),而非显示通用警告。
  • 改进 /web-setup 错误:被拒绝的 GitHub token 现在会列出可能原因和解决方法;连接失败则会指出已配置的代理或 TLS 证书问题。
  • 改进会话内 SSL 证书和代理连接错误信息,显示错误代码及修复方式,例如不受信任的企业 CA 可使用 NODE_EXTRA_CA_CERTS。
  • 改进当 Claude 登录过期或被撤销而无法创建云端会话时的错误信息:现在会提示你运行 /login。
  • 改进 MCP 服务器的登录在会话中途过期时显示的错误信息,说明如何重新认证(/mcp)。
  • 将 Bedrock、Vertex 和 Foundry 上的自动模式暂时改为默认使用本地分类器;设置 CLAUDE_CODE_AUTO_MODE_SERVER=1 可使用平台的服务器端分类器。
  • 修改 OTEL_LOG_TOOL_DETAILS=1,使成本和 token 指标中也包含真实的 Agent、Skill、插件和 MCP 服务器名称。
  • 使用 Claude 账户登录时,现同时请求访问你的 claude.ai 插件。
  • 修改 /bug 和 /feedback 报告,使其仅包含最后一次 API 请求中的模型行为参数(模型、系统提示词、工具),省略请求元数据和 CLAUDE_CODE_EXTRA_BODY 字段。
  • [VSCode] 修复对于已禁用产品反馈的组织,“Report a problem”仍然显示,以及 /bug / /feedback 仍打开报告表单的问题。
  • [VSCode] 修复 Windows 上已完成轮次后出现红色“Claude Code process exited with code 4294967295”横幅的问题。
  • Windows:改进通过 --add-dir 添加映射网络驱动器时,对 UNC 路径的网络路径权限检查。
  • [Claude Code on the web] 修复管理员移除并重新添加组织连接器后,例行任务失去该组织连接器访问权限、却仍调用旧连接器的问题。
  • [Claude Code on the web] 修复从组织设置创建自托管环境时偶尔因服务器错误失败,并遗留半创建环境的问题。
  • [Claude Code on the web] 将管理员的“Share cloud sessions”设置移至“Data and privacy”,不再放在 Claude Code 页面;“Data and privacy”管理员也可以在该处管理此设置。
  • [Claude Code on the web] 在 New routine 页面或 Edit routine 对话框丢弃你输入的例行任务名称、提示词或编辑内容前,新增“Discard unsaved changes?”确认提示。
  • [Claude Code on the web] 移除没有云端环境的新用户在 Mac 和 Windows 上看到的全页桌面应用下载页面;现在会直接进入设置流程。
  • [Claude Code on the web] 改进例行任务详情页:在面包屑中加入菜单和重命名功能,将开关和 Run 移至顶部,并将运行历史放在例行任务设置旁。
  • [Claude Tag] 修复 Enterprise Grid 已断开连接但其中一个工作区仍保持连接时,重新安装应用数分钟后 Claude 会停止响应的问题。
  • [Claude Tag] 修复在组织共享的私密 Slack 频道中设置的定时任务悄然从不发布的问题;现在它们会继续在创建时所在的线程中运行。
  • [Claude Tag] 修复当 Claude 正在执行任务时,在较早 Slack 线程中回复有时会从头重启任务,并丢失尚未推送工作的情况。
  • [Claude Tag] 修复账户 token 刷新后,Claude 偶尔会立即发出一条错误的“couldn't find a Claude Code environment”通知的问题。
  • [Claude Tag] 修复 AWS 连接拒绝无区域端点(如 Budgets、Savings Plans、WAF Classic 和 Import/Export)的问题;Global Accelerator 请求现在可正确签名。
  • [Claude Tag] 改进 AWS 连接失败信息:当请求无法签名(例如主机名没有区域)时,Claude 会获知原因和修复方法,而非只收到无详细信息的错误。
  • [Claude Tag] 修复 OAuth client-credentials 和 JWT-bearer 连接在提供商返回小写 token 类型时失败的问题;请求现在使用标准 Bearer 方案。
  • [Claude Tag] 修复在 Enterprise Grid 共享频道、Claude 尚未使用过的频道以及旧版私密频道中,添加频道管理员被拒绝的问题。
  • [Claude Tag] 修改 Claude,使其自动开始监控相关公共频道,例如某个对话所依赖的事故频道,而不再仅在被要求时监控。
  • [Claude Tag] 修复管理员 Memory 页面未列出 Claude 自动设置且已保存 memory 的 Slack 频道的问题;管理员现在可以打开、编辑和删除这些 memory。
  • [Code Review] 修复将基准分支合并到此前审查列出“Additional findings”的 PR 时触发完整重新审查的问题;此类推送现在会获得更轻量的后续审查。
  • [Code Review] 修复因 @ 提及、跨行的代码跨度或反引号包裹的 HTML 标签而导致整个 REVIEW.md 被忽略的问题;现在仅会隐藏链接到已变更文件的行。
  • [Code Review] 改进修复建议,说明当其他代码依赖正被修改的行为时,修复必须保持哪些功能正常。
  • [Code Review] 改进指向第二个受影响位置的审查评论:现在会用完整句子说明该位置的问题,而非显示被截断的片段。
  • [Code Review] 修复 /ultrareview --post:在 GitHub 错误后重试时,审查发现评论将恰好发布一次,而不是从不发布或发布两次;评论现在会标明已审查的提交。
  • [Code Review] 修复在所有者或仓库名称包含大写字母的 GitHub 仓库中,空推送或内容完全相同的推送被重新审查的问题;此类推送现在会被跳过。

English / 原文

  1. Releases
  2. v2.1.273

Compare

Sorry, something went wrong.

No results found

What's changed

  • Added x-claude-code-request-class, x-claude-code-agent-type, x-claude-code-prev-tool-durations, x-claude-code-compaction and x-claude-code-context-compacted request headers for LLM gateways; opt in with CLAUDE_CODE_GATEWAY_HINT_HEADERS=1
  • Added a notification when an MCP server disconnects mid-session and automatic reconnection gives up, pointing at /mcp
  • Added forking a session started with claude --remote-control or /remote-control from the Claude app; the fork runs as a background session on your computer
  • Fixed Bash commands the permission checker cannot fully analyze skipping the prompt under permissions.blockReadsOutsideWorkingDirectories, and a subshell hiding a dangerous rm in bypass mode
  • Fixed skills synced from claude.ai staying available after your organization turns Skills off; they now move to the recoverable trash
  • Fixed allowManagedMcpServersOnly, deniedMcpServers and disableClaudeAiConnectors set via MDM or managed-settings.json being ignored when server-managed settings are also present
  • Fixed 401/403 errors on Bedrock, Vertex and Foundry, and Claude apps gateway 403s, telling you to run /login; the message now names the credential to refresh or points to your gateway administrator
  • Fixed /login, /upgrade, and /extra-usage discarding earlier thinking from the conversation, which forced a full prompt-cache rewrite on the next request
  • Fixed auto mode stopping for approval when the Artifact tool uploads a file you attached to the chat in a cloud or Remote Control session
  • Fixed a long-running session recreating a stub .git/info/exclude after the repository's .git directory was removed or moved away
  • Fixed the main prompt dropping a ! typed at the start while already in shell mode, so negated commands like ! grep … can be typed
  • Fixed Read on macOS refusing a dragged-in screenshot, or any file the system reports under a second path, with "symlink resolution changed after permission was checked"
  • Fixed permissions.blockReadsOutsideWorkingDirectories: a memory directory chosen by a repository's settings is no longer loaded into the prompt, recalled, indexed, or used by memory extraction
  • Fixed sub-agents and background agents being reported as failed, with their result never delivered, when the final streamed reply omitted token usage or carried no model id
  • Fixed the context meter and auto-compact counting advisor-tool turns at roughly twice their real context size, which made auto-compact fire at about half the real window
  • Fixed /tui refusing to restart because of an agent-team teammate that had already finished its work and was no longer shown in the agents panel
  • Fixed saved scheduled tasks running in the wrong session after .claude/scheduled_tasks.json was copied into another folder, such as a new worktree
  • Fixed SDK and --output-format stream-json output dropping a subagent's remaining messages and final report after it is moved to the background mid-run (e.g. by CLAUDE_AUTO_BACKGROUND_TASKS)
  • Fixed /install-github-app reporting a SAML single sign-on block as "admin permissions required"
  • Fixed Remote Control clients attached to a Claude Desktop, VS Code or JetBrains session being refused when they ask for the session's context window usage
  • Fixed the spinner showing a doubled ellipsis ("……") on compaction status lines such as "Running PreCompact hooks…"
  • Fixed a false-positive spinner tip suggesting the frontend-design plugin after reading or publishing Artifacts
  • Reverted a 2.1.268 change that checked Read and Edit deny rules on Bash lines the permission checker can't analyze (eval, env -C); commands like time -p make build prompt again instead of being denied
  • Improved responsiveness in long sessions: hook progress and sub-agent activity no longer re-process the whole conversation on every update
  • Improved the Artifact tool's error when a publish includes a file type artifacts don't serve: Claude is told which types are served and what to do instead, and the terminal shows one plain line
  • Improved the Artifact tool's page read to state the capabilities and database rules the artifact service holds for the page, for anyone who can publish to it
  • Improved artifact database writes: an update can now remove a single field instead of rewriting the whole document
  • Improved artifact publishing: a publish whose connection drops after reaching claude.ai is now re-sent safely instead of failing or creating a duplicate version
  • Improved the cloud-session GitHub error for an IP allow list, a suspended app installation or SAML single sign-on to show the cause instead of a generic install hint
  • Improved /autofix-pr: when gh pr view fails it now shows gh's own error (sign-in, SAML, rate limit) instead of a generic exit-code line
  • Improved /autofix-pr to say why GitHub webhook delivery couldn't be set up for the PR (for example, no linked GitHub account) instead of a generic warning
  • Improved /web-setup errors: a refused GitHub token now lists the likely reasons and the fix, and a connection failure names a configured proxy or TLS certificate problem
  • Improved the in-session SSL certificate and proxy connection errors to name the error code and what to fix, such as NODE_EXTRA_CA_CERTS for an untrusted corporate CA
  • Improved the error when a cloud session can't be created because your Claude login expired or was revoked: it now tells you to run /login
  • Improved the error shown when an MCP server's sign-in expires mid-session to say how to re-authenticate (/mcp)
  • Changed auto mode on Bedrock, Vertex and Foundry to use the local classifier by default for now; set CLAUDE_CODE_AUTO_MODE_SERVER=1 to use the platform's server-side classifier
  • Changed OTEL_LOG_TOOL_DETAILS=1 to also include real agent, skill, plugin and MCP server names on cost and token metrics
  • Changed sign-in with a Claude account to also request access to your claude.ai plugins
  • Changed /bug and /feedback reports to include only model-behavior params (model, system prompt, tools) from the last API request, omitting request metadata and CLAUDE_CODE_EXTRA_BODY fields
  • [VSCode] Fixed "Report a problem" still appearing, and /bug / /feedback opening a report form, for organizations that have product feedback disabled
  • [VSCode] Fixed a red "Claude Code process exited with code 4294967295" banner appearing after completed turns on Windows
  • Windows: Improved the network-path permission check for UNC paths when a mapped network drive was added with --add-dir
  • [Claude Code on the web] Fixed routines losing access to an organization connector, and still calling the old one, after an admin removed and re-added that connector
  • [Claude Code on the web] Fixed creating a self-hosted environment from organization settings occasionally failing with a server error and leaving a half-created environment behind
  • [Claude Code on the web] Changed the admin "Share cloud sessions" setting to live under Data and privacy instead of the Claude Code page, where Data and privacy admins can also manage it
  • [Claude Code on the web] Added a "Discard unsaved changes?" confirmation before the New routine page or the Edit routine dialog throws away a routine name, prompt or edit you typed
  • [Claude Code on the web] Removed the full-page desktop-app download screen that new users without a cloud environment saw on Mac and Windows; they now go straight to setup
  • [Claude Code on the web] Improved the routine detail page: menu and rename in the breadcrumb, the on/off switch and Run now at the top, and run history beside the routine's settings
  • [Claude Tag] Fixed Claude going silent minutes after reinstalling the app when an Enterprise Grid was disconnected but one of its workspaces stayed connected
  • [Claude Tag] Fixed scheduled tasks set up in an organization-shared private Slack channel silently never posting; they now keep running in the thread they were created in
  • [Claude Tag] Fixed replying in an older Slack thread while Claude is mid-task sometimes restarting it from scratch and losing work it had not pushed yet
  • [Claude Tag] Fixed Claude occasionally dropping a message with an incorrect "couldn't find a Claude Code environment" notice right after your account token refreshed
  • [Claude Tag] Fixed AWS connections refusing region-less endpoints such as Budgets, Savings Plans, WAF Classic and Import/Export; Global Accelerator requests now sign correctly
  • [Claude Tag] Improved AWS connection failures: when a request can't be signed, such as a hostname with no region, Claude is told why and how to fix it instead of a bare error
  • [Claude Tag] Fixed OAuth client-credentials and JWT-bearer connections failing with providers that return a lowercase token type; requests now send the standard Bearer scheme
  • [Claude Tag] Fixed adding a channel manager being refused on Enterprise Grid shared channels, on channels where Claude hasn't been used yet, and on legacy private channels
  • [Claude Tag] Changed Claude to start watching related public channels on its own, such as an incident channel a conversation depends on, instead of only when asked
  • [Claude Tag] Fixed the admin Memory page not listing Slack channels Claude set up on its own even when they had saved memory; admins can now open, edit and delete that memory
  • [Code Review] Fixed merging the base branch into a PR whose earlier review listed "Additional findings" triggering a full re-review; these pushes now get the lighter follow-up review
  • [Code Review] Fixed a whole REVIEW.md being ignored because of an @-mention, a code span wrapped across lines, or a backticked HTML tag; only lines linking to changed files are withheld
  • [Code Review] Improved suggested fixes to say what the fix must keep working when other code depends on the behavior being changed
  • [Code Review] Improved review comments that point to a second affected location to state that location's issue in a full sentence instead of a cut-off stub
  • [Code Review] Fixed /ultrareview --post so a retry after a GitHub error posts the findings comment exactly once instead of never or twice; the comment now names the reviewed commit
  • [Code Review] Fixed empty or content-identical pushes being re-reviewed on GitHub repositories whose owner or name contains a capital letter; these pushes are now skipped

You can’t perform that action at this time.