---
title: "Claude Code v2.1.222 发布：修复工作树隔离、代理连接与多项稳定性问题"
source: "Claude Code：GitHub Releases（RSS）"
source_tier: "t1_5"
url: "https://github.com/anthropics/claude-code/releases/tag/v2.1.222"
permalink: "https://feed.astralor.com/items/itm_a2aa8ac1f8275fff827d656e"
published: "2026-08-04T22:39:55.000Z"
score: 76
channel: "ai"
tags: ["Claude Code","MCP","代理","安全性","稳定性"]
---

# Claude Code v2.1.222 发布：修复工作树隔离、代理连接与多项稳定性问题

## AI 点评

> 这次发布看似只是常规修复，但其中工作树隔离和PreToolUse钩子的安全问题值得重视，使用Claude Code自动化流程的团队应尽快升级。此外，代理相关修复对在严格网络环境下的用户很重要。建议开发者阅读完整更新日志，确认是否影响自己的工作流。

## 速览

Claude Code v2.1.222发布，主要修复了工作树隔离会话中破坏性git命令的漏洞，防止子代理影响主检出；修复了PreToolUse钩子绕过工具限制的问题；解决了HTTPS代理下启动连接挂起失败的问题；改进了SendMessage长摘要截断、MCP服务器用量归因等。同时增强了远程控制自动启动的安全策略，并移除了ultraplan功能。该版本提升了安全性、稳定性和用户体验。

## 关键点

- 修复安全漏洞：工作树隔离会话和子代理不能再对主检出运行破坏性git命令，隔离现在适用于所有会话类型的文件编辑和Bash。
- 修复PreToolUse自动允许钩子在后台代理任务中绕过工具限制的问题。
- 修复HTTPS代理下启动连接检查挂起失败，现在使用与API请求相同的代理感知传输。
- 修复SendMessage拒绝长摘要改为截断，并修正MCP服务器用量归因偏差。

## 全文

What's changed Fixed worktree-isolated sessions and their subagents being able to run destructive git commands against the main checkout; isolation now applies to file edits and Bash in every session type Fixed PreToolUse auto-allow hooks bypassing tool restrictions in background agent tasks (summaries, compaction, renames) Fixed /usage-credits on Team and Enterprise showing "you've already sent a usage credit request" for members whose earlier request was dismissed, blocking them from sending a new one Fixed the startup connectivity check hanging and then failing behind an HTTPS proxy; it now uses the same proxy-aware transport as API requests and times out with a clear message Fixed "Connection closed mid-response" errors being reported on responses that had actually completed Fixed /usage overattributing usage to MCP servers: a server's share now reflects only the requests that actually consumed its tool results, instead of every turn after any call to it Fixed sessions not linking to pull requests created after the branch was pushed, including through the GitHub REST API Fixed org-restricted model: opus-style subagent and teammate family aliases dropping to the parent model instead of stepping down to the newest org-allowed model in the family Fixed stream idle timeout firing on custom ANTHROPIC_BASE_URL gateways despite server keep-alive pings arriving on the wire Fixed claude.ai connectors being falsely marked as needing authorization when the session token is invalid — they now show a /login hint instead Fixed tool errors not being displayed for tools no longer available locally, for example after an MCP server is removed Fixed SendMessage rejecting a long summary — it now truncates instead, so sends no longer fail on a character limit Fixed the spinner's effort label in a subagent's transcript view showing the session's effort level instead of the subagent's own effort: setting Fixed rare crashes when a file watcher hit a filesystem error or during file-watcher teardown Fixed screen readers re-reading the whole input line on every backspace in --ax-screen-reader mode — end-of-line deletions now echo just the deleted characters Fixed host model-selection keys not taking precedence over a stale on-disk managed-settings.json when CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST is set Improved auto mode safety: messages sent to other agent sessions via SendMessage are now evaluated by the permission classifier before dispatch Improved the refusal when Claude tries to invoke a skill with disable-model-invocation: Claude is now told to ask you to run the skill instead of replicating its workflow Improved the /diff view, the Remote Control workspace diff, and file-edit diffs in Claude Code on the web sessions to use raw git blob content, ignoring workspace-configured diff drivers and textconv Changed Remote Control auto-start so repo-local settings (.claude/settings.json or .claude/settings.local.json) can no longer turn it on (they can still turn it off); enable it at user scope via /config Removed ultraplan feature

---

引用前请核对原文;本文由星际流动整理:https://feed.astralor.com/items/itm_a2aa8ac1f8275fff827d656e
