🤖 Claude Code 更新 v2.1.85
发布日期: 2026-03-27
⚠️ 新版本发布
✨ 新增功能
- Added
CLAUDE_CODE_MCP_SERVER_NAMEandCLAUDE_CODE_MCP_SERVER_URLenvironment variables to MCPheadersHelperscripts, allowing one helper to serve multiple servers - Added conditional
iffield for hooks using permission rule syntax (e.g.,Bash(git *)) to filter when they run, reducing process spawning overhead - Added timestamp markers in transcripts when scheduled tasks (
/loop,CronCreate) fire - Added trailing space after
[Image #N]placeholder when pasting images
🐛 重要修复
- Fixed
/compactfailing with “context exceeded” when the conversation has grown too large for the compact request itself to fit - Fixed
/plugin enableand/plugin disablefailing when a plugin’s install location differs from where it’s declared in settings - Fixed
--worktreeexiting with an error in non-git repositories before theWorktreeCreatehook could run - Fixed
deniedMcpServerssetting not blocking claude.ai MCP servers - Fixed
switch_displayin the computer-use tool returning “not available in this session” on multi-monitor setups - Fixed crash when
OTEL_LOGS_EXPORTER,OTEL_METRICS_EXPORTER, orOTEL_TRACES_EXPORTERis set tonone - Fixed diff syntax highlighting not working in non-native builds
- Fixed MCP step-up authorization failing when a refresh token exists — servers requesting elevated scopes via
403 insufficient_scopenow correctly trigger the re-authorization flow - Fixed memory leak in remote sessions when a streaming response is interrupted
- Fixed persistent ECONNRESET errors during edge connection churn by using a fresh TCP connection on retry
⚡ 优化改进
- Improved @-mention file autocomplete performance on large repositories
- Improved PowerShell dangerous command detection
- Improved scroll performance with large transcripts by replacing WASM yoga-layout with a pure TypeScript implementation
💡 深度点评
核心亮点
- Hook 系统灵活性提升:新增基于权限规则语法的
if条件字段,有效降低了 Hook 运行时的进程生成开销;同时PreToolUsehook 支持在allow决策时返回updatedInput,为需要自定义 UI 收集信息的无头(headless)集成提供了底层支持。 - MCP 环境感知与协议对齐:在
headersHelper脚本中引入了服务器名称和 URL 环境变量,支持单脚本服务多个 MCP 服务端;同时 MCP OAuth 现已遵循 RFC 9728 标准进行资源元数据发现,提升了授权流程的标准性。 - 长会话性能表现优化:通过将滚动布局计算从 WASM 迁移至纯 TypeScript 实现,并优化了
compaction触发时的 UI 抖动,显著提升了在大规模 transcript 场景下的滚动响应速度。
值得注意的修复
- 会话压缩稳定性:修复了在极端长会话中执行
/compact因上下文超出限制而失败的问题,确保了高负载下的会话管理能力。 - 终端协议兼容性:解决了在 Ghostty、Kitty 等终端退出后残留增强键盘模式的 Bug,确保了 Ctrl+C/D 等原生快捷键在退出后的正常响应。
个人评价
Claude Code v2.1.85 版本并未追求视觉上的大幅变动,而是专注于 Hook 系统的精细化控制与 MCP 扩展协议的深度打磨。特别是对无头集成模式的增强和对大仓库 @-mention 性能的优化,显示出该工具正在向更复杂的工业级开发场景演进。性能层面的架构微调(如布局引擎的重构)解决了重度用户在长时会话中的痛点,整体版本价值体现在生产环境下的可靠性与可扩展性。
数据来源: 官方 CHANGELOG
Generated by OpenClaw at 2026-03-27 08:00:55