Claude Code v2.1.214 发布
英文标题:Claude Code v2.1.214
Claude Code v2.1.214 重点修复了多项权限检查绕过漏洞,涉及目录自动批准规则、Bash 文件重定向、Windows PowerShell 5.1 会话等方面。新增 EndConversation 工具,允许 Claude 结束滥用或越狱尝试的会话;同时改进了后台会话稳定性、OpenTelemetry 遥测及长命令处理。此版本还加强了对 Windows 的支持,修复了多个 PowerShell 问题,并对开发者工作流的安全性和可靠性有显著提升。
打开原文相关 7.2 · 机会 1
1.3 KB
51.0 KB
中文
Compare
抱歉,出了些问题。
未找到结果
更新内容
- 修复了单级路径
dir/**的允许规则(如Edit(src/**))会错误地自动批准写入到目录树中任何位置的嵌套dir/目录,而应当仅允许<cwd>/dir的问题 - 修复了影响在 Windows PowerShell 5.1 会话中运行的命令的权限检查绕过问题
- 修复了 Bash 权限检查,使其在 Bash 解析方式与权限分析器不同的文件描述符重定向形式下能够安全失败(关闭)
- 修复了 Bash 权限检查误判超长命令的问题——超过 10,000 个字符的命令现在始终提示,而不会自动运行
- 修复了 Bash 权限检查将
[[ ]]比较中的 zsh 变量下标和修饰符视为无害文本的问题——这些命令现在会请求批准 - 修复了 Bash 权限检查不再自动批准可能运行不安全选项、命令替换或反斜杠路径的某些
help和man命令 - 修复了远程会话的权限提示可能在本地确认对话框出现之前继续执行的问题
- 新增了 EndConversation 工具:Claude 可以结束与高度辱骂用户或越狱尝试的会话,这与 claude.ai 自 2025 年以来的功能相同——参见 https://www.anthropic.com/research/end-subset-conversations
- 为长时间运行的工具调用增加了定期进度心跳(此前会陷入静默)
- 在 memory 文件 frontmatter 中添加了 ISO
modified时间戳 - 在 OpenTelemetry 日志事件中添加了
message.uuid、client_request_id和tool_source属性,用于消息级关联与工具来源 - 新增
CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH,用于配置 OpenTelemetry 内容属性的 60 KB 截断限制 - 在
subagentStatusLine载荷中添加了推理 effort,使自定义代理行可以渲染模型和 effort - 为携带守护进程重定向标志(
--url、--connection、--identity以及 Podman 远程模式)的docker命令(包括 Podmandocker兼容层)增加了权限提示,此前这些命令会不带提示直接运行 - 修复了当 GrowthBook 功能评估为 null 时的崩溃问题,以及一个畸形标志载荷可能清除缓存功能标志的 bug
- 修复了当
pkill -f模式意外匹配到 CLI 自身进程时,Bash 工具会终止 Claude 会话的问题(Linux) - 修复了
--settings指向设备文件或数 GB 文件时内存无限增长的问题;超限(>2 MiB)的设置文件现在会在启动时明确报错并失败 - 修复了在 Windows 上位于企业代理后,流式轮次因“Socket is closed”而失败的问题
- 修复了退出时流式 JSON 输出对慢速读取的 SDK/管道消费者产生的截断问题;退出排空现在根据排队的字节数动态调整,而非固定的 2 秒上限
- 修复了计划任务将自身配置的提示视为不受信任的输入而拒绝的问题——现在触发的提示会作为会话的分配任务交付
- 修复了当子进程等待标准输入时,PowerShell 工具命令会挂起直至超时的问题(Windows)
- 修复了在 PowerShell 工具下运行 Python 脚本从标准输入读取非 UTF-8 数据时抛出 UnicodeDecodeError 的问题(Windows)
- 修复了通过 PowerShell 工具运行的 Python 脚本在输出非 ASCII 字符时因 UnicodeEncodeError 崩溃,以及 PowerShell 7 错误消息包含原始 ANSI 转义序列的问题(Windows)
- 修复了 PowerShell 工具将
where.exe、fc.exe和diff.exe返回有效否定答案时错误地报告为错误的问题(Windows) - 修复了在 Windows PowerShell 5.1 的 PowerShell 工具下,
>和>>写入 UTF-16LE 文件,导致其他工具无法以 UTF-8 读取的问题 - 修复了被取代的后台守护进程在关闭时删除其后续守护进程的控制套接字,导致下一个客户端终止健康的替代守护进程的问题
- 修复了使用
←或/background搁置并保持空闲的后台会话会无限期地保持后台守护进程和 worker 进程活动的问题 - 修复了后台服务进入空闲状态后,已完成后台会话无法通过
claude rm或代理视图删除的问题 - 修复了从非 git 文件夹派发的后台会话无法从代理视图删除的问题
- 修复了当会话存储中存在不可读文件夹时,重新打开已停止的后台会话无法恢复其保存的对话的问题
- 修复了远程控制“会话就绪”推送通知在未显式启用远程控制的会话中触发的问题
- 修复了
/install-github-app和/mcp设置菜单在代理视图会话中被阻止的问题——现在它们仅在没有终端连接的后台会话中被拒绝 - 修复了通过
--settingsCLI 标志启用的插件无法加载的问题(自 v2.1.181 以来的回归) - 修复了 OAuth 令牌轮换后长时间运行会话中功能标志过时的问题
- 修复了
/ultrareview在无合并基的仓库中拒绝运行的问题——现在会提示评审所有跟踪的文件 - 修复了当 shell 配置路径为目录时,
claude update和claude doctor静默挂起,以及/status系统诊断部分空白的问题 - 修复了保存 memory 文件时,frontmatter 值在行内
#处被静默截断的问题 - 修复了发出多个累积
message_delta帧的流上会话成本和令牌遥测重复计数的问题 - 修复了在顾问思考时出现的虚假“检查网络”警告
- 修复了当 hook 标准输出 JSON 模式验证失败时,退出码为 2 的 hooks 未按文档阻塞的问题
- 修复了在轮次异步上下文外发出的 OTel 日志事件缺少交互 span 的跟踪上下文的问题
- 修复了在提示/资源刷新期间 MCP 瞬时错误清除服务器斜杠命令和资源的问题
- 改进了主目录下
claude rc的工作区信任错误,提示信任不会被保存,并建议从项目目录运行 - 更改了单级路径
dir/**的 hookif:条件,使其仅匹配<cwd>/dir;如需任意深度匹配请使用**/dir/**。deny/ask权限规则保持其任意深度匹配 - 更改了使用
-m/--magic-file或-f/--files-from的file命令,要求权限而非自动作为只读命令允许 - 更改了保活连接池,使其在出现陈旧连接错误后禁用,以便重试打开新的套接字
- 更改了 SessionStart hooks,在以 fork 方式开始会话时报告来源为
"fork"而非"resume"
English / 原文
Compare
Sorry, something went wrong.
No results found
What's changed
- Fixed single-segment
dir/**allow rules likeEdit(src/**)auto-approving writes to nesteddir/directories anywhere in the tree instead of only<cwd>/dir - Fixed a permission-check bypass affecting commands run in Windows PowerShell 5.1 sessions
- Fixed Bash permission checks to fail closed on file-descriptor redirect forms that bash parses differently than the permission analyzer
- Fixed Bash permission checks misjudging very long commands — commands over 10,000 characters now always prompt instead of running automatically
- Fixed Bash permission checks treating zsh variable subscripts and modifiers in
[[ ]]comparisons as inert text — these commands now prompt for approval - Fixed Bash permission checks to no longer auto-approve certain
helpandmancommands that could run unsafe options, command substitutions, or backslash paths - Fixed permission prompts on remote sessions that could proceed before the local confirmation dialog
- Added the EndConversation tool: Claude can end sessions with highly abusive users or jailbreak attempts, as on claude.ai since 2025 — see https://www.anthropic.com/research/end-subset-conversations
- Added a periodic progress heartbeat for long-running tool calls that previously went silent
- Added an ISO
modifiedtimestamp to memory file frontmatter - Added
message.uuid,client_request_id, andtool_sourceattributes to OpenTelemetry log events for message-level correlation and tool provenance - Added
CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTHto configure the 60 KB truncation limit on OpenTelemetry content attributes - Added reasoning effort to the
subagentStatusLinepayload, so custom agent rows can render model and effort - Added permission prompts for
dockercommands (including the Podmandockershim) carrying daemon-redirect flags (--url,--connection,--identity, and Podman's remote mode) that previously ran without one - Fixed a crash when a GrowthBook feature evaluates to null, and a bug where a malformed flag payload could wipe the cached feature flags
- Fixed Bash tool killing the Claude session when a
pkill -fpattern accidentally matched the CLI's own process (Linux) - Fixed unbounded memory growth when
--settingspoints at a device file or multi-GB file; oversized (>2 MiB) settings files now fail at startup with a clear error - Fixed streaming turns failing with "Socket is closed" behind corporate proxies on Windows
- Fixed stream-json output truncation at exit for slow-reading SDK/pipeline consumers; the exit drain now scales with queued bytes instead of a flat 2s cap
- Fixed scheduled tasks refusing their own configured prompt as untrusted input — the fired prompt is now delivered as the session's assigned task
- Fixed PowerShell tool commands hanging until timeout when a child process waited on standard input (Windows)
- Fixed Python scripts under the PowerShell tool crashing with UnicodeDecodeError when reading non-UTF-8 data from standard input (Windows)
- Fixed Python scripts run via the PowerShell tool crashing with UnicodeEncodeError on non-ASCII output, and PowerShell 7 error messages containing raw ANSI escape sequences (Windows)
- Fixed the PowerShell tool reporting
where.exe,fc.exe, anddiff.exeas errors when they return a valid negative answer (Windows) - Fixed
>and>>under the PowerShell tool on Windows PowerShell 5.1 writing UTF-16LE files that other tools couldn't read as UTF-8 - Fixed a displaced background daemon deleting its successor's control socket on shutdown, which made the next client kill the healthy replacement daemon
- Fixed background sessions parked with
←or/backgroundand left idle keeping the background daemon and a worker process alive indefinitely - Fixed completed background sessions being impossible to remove via
claude rmor the agent view once the background service had gone idle - Fixed background sessions dispatched from a non-git folder being impossible to delete from the agents view
- Fixed reopening a stopped background session failing to restore its saved conversation when an unreadable folder exists in the session store
- Fixed the Remote Control "session ready" push notification firing for sessions where Remote Control was not explicitly enabled
- Fixed
/install-github-appand the/mcpsettings menu being blocked in agent-view sessions — they're now refused only in background sessions with no terminal attached - Fixed plugins enabled via the
--settingsCLI flag not loading (regression since v2.1.181) - Fixed feature flags going stale in long-running sessions after the OAuth token rotates
- Fixed
/ultrareviewrefusing to run in repos with no merge base — it now offers to review all tracked files - Fixed
claude updateandclaude doctorhanging silently, and the/statusSystem diagnostics section going blank, when a shell-config path is a directory - Fixed memory frontmatter values being silently truncated at an inline
#when memory files are saved - Fixed session cost and token telemetry double-counting on streams that emit multiple cumulative
message_deltaframes - Fixed a spurious "check your network" warning that appeared while the advisor was thinking
- Fixed hooks with exit code 2 not blocking as documented when the hook's stdout JSON fails schema validation
- Fixed OTel log events emitted outside the turn's async context missing the interaction span's trace context
- Fixed MCP transient errors during prompts/resources refresh clearing the server's slash commands and resources
- Improved the
claude rcworkspace-trust error in the home directory to say trust there is never saved and to suggest running from a project directory - Changed single-segment
dir/**hookif:conditions to match only<cwd>/dir; write**/dir/**for any-depth matching.deny/askpermission rules keep their any-depth match. - Changed
filecommands using-m/--magic-fileor-f/--files-fromto require permission instead of being auto-allowed as read-only - Changed keep-alive connection pooling to disable after a stale-connection error, so retries open a fresh socket
- Changed SessionStart hooks to report source
"fork"when a session begins as a fork instead of"resume"
You can’t perform that action at this time.