Claude Code v2.1.169 发布
全是修 bug 的版本里藏了两个实用命令,/cd 换目录不丢缓存和 safe-mode 跳过所有自定义直接排查,重度用户的小痛点被摸到了。
Claude Code v2.1.169 新增 `--safe-mode` 标志及环境变量,用于禁用所有自定义配置以排查问题;新增 `/cd` 命令,可在不破坏提示词缓存的情况下切换工作目录;新增 `disableBundledSkills` 设置隐藏内置技能。修复了企业 MCP 策略在重连、IDE 配置及首次会话中不被强制的问题,以及 macOS 用户每轮约 30–50ms 的 UI 卡顿、Windows 下 `claude -p` 和 Git 凭证弹窗等多项 bug。改进了任务创建的可靠性,恢复 Vertex/Foundry 默认 5 分钟空闲超时,并降低 CPU 占用。
## 变更内容
添加了 `--safe-mode` 标志(以及 `CLAUDE_CODE_SAFE_MODE`),用于在禁用所有自定义项(CLAUDE.md、插件、技能、钩子、MCP 服务器)的情况下启动 Claude Code,以便进行故障排查。
添加了 `/cd` 命令,用于将会话移至新的工作目录,且不会在会话中途破坏提示词缓存。
添加了 `disableBundledSkills` 设置和 `CLAUDE_CODE_DISABLE_BUNDLED_SKILLS` 环境变量,用于从模型中隐藏内置技能、工作流和内建斜杠命令。
修复了在长输入行中,上下方向键跳过换行行直接跳转到命令历史的问题——现在它们会先逐行移动,并在到达近边缘时进入历史回调。
修复了企业管理的 MCP 策略(`allowedMcpServers`/`deniedMcpServers`)在重新连接、IDE 类型配置、安装后的首次会话中 `--mcp-config` 服务器以及远程设置加载前无法生效的问题;同时修复了没有远程设置的组织启动缓慢的问题。
修复了 macOS 用户使用 claude.ai 凭据登录时,每个回合开始约 30-50ms 的 UI 卡顿。
修复了在 Windows 上使用 `claude -p` 时,因等待斜杠命令/技能扫描而变慢或似乎卡住的问题(2.1.161 版本回归)。
修复了在恢复会话时,如果恰好发生 OAuth token 刷新,远程控制会卡在“重新连接”状态的问题。
修复了在 Windows 上启动时,当后台 git 命令在没有缓存凭据的情况下运行时,Git 凭据管理器的“连接到 GitHub”弹窗出现的问题。
修复了没有自定义状态栏的用户无法显示页脚提示(例如“esc 中断”)的问题。
修复了陈旧权限和对话框提示在每次重新连接到远程会话时反复出现的问题,该会话的工作进程在等待这些提示时已崩溃。
修复了 `claude agents --json` 遗漏了已阻塞和刚调度的后台会话的问题;添加了 `--all` 参数以包含已完成的会话,以及新的 `id` 和 `state` 字段。
修复了在 Windows Terminal 的 WSL 中,从智能体导航返回后,`agents` 视图遗留陈旧/混乱帧的问题。
修复了后台智能体在调度到预热工作进程时忽略项目级设置 env 值(例如 `ANTHROPIC_MODEL`)的问题。
修复了 MCPB 插件缓存在 Windows 上被错误地失效,导致不必要的重新解压的问题。
修复了插件 `.in_use` PID 锁文件无限积累的问题;现在每天清理一次来自崩溃会话的过期标记。
修复了不受信任的项目设置能够在没有信任确认的情况下设置 OTEL 客户端证书路径的问题。
/workflows now opens immediately even while a turn is in progress
工作流现在即使在轮次进行中也能立即打开。
Improved TaskCreate reliability: malformed inputs are repaired automatically and validation errors for unloaded tools include the schema
提升了任务创建(TaskCreate)的可靠性:格式错误的输入会被自动修复,且针对未加载工具(unloaded tools)的验证错误会包含其架构信息。
Improved the error message shown when your organization has disabled API key authentication, with guidance based on where the active API key comes from
改进了当你的组织禁用 API 密钥认证时显示的错误消息,并根据当前 API 密钥的来源提供相应指引。
Reduced CPU usage while responses stream and during spinner animations
降低了响应流式传输以及旋转加载动画期间的 CPU 使用率。
Restored a default 5-minute idle timeout on Vertex/Foundry so a stalled stream aborts instead of hanging indefinitely; set API_FORCE_IDLE_TIMEOUT=0 to opt out
恢复了 Vertex/Foundry 上默认的 5 分钟空闲超时设置,使得停滞的流式传输会中止而非无限挂起;设置 `API_FORCE_IDLE_TIMEOUT=0` 可选择退出此超时。
Remote-managed settings with an invalid entry now apply their remaining valid policies and surface the validation error, instead of silently dropping the whole payload
远程管理的设置中如果包含无效条目,现在会应用其余有效策略,并显示验证错误,而非静默丢弃整个负载。
Background sessions now preserve --ide, --chrome, --bare, --remote-control, and other flags across retire→wake, and respawn state validation was hardened
后台会话现在在“退役→唤醒”过程中会保留 `--ide`、`--chrome`、`--bare`、`--remote-control` 等标志,并且重新生成状态验证得到了增强。
Background sessions are now told that shared-checkout edits are blocked until they enter a worktree, avoiding a wasted rejected edit before EnterWorktree
后台会话现在会被告知:在进入工作树(worktree)之前,共享检出(shared-checkout)的编辑操作会被阻止,从而避免在 `EnterWorktree` 之前出现一次无效的拒绝编辑。
The "CLAUDE.md is too long" warning threshold now scales with the model's context window
“CLAUDE.md 文件过长”的警告阈值现在会随模型的上下文窗口大小而缩放。
Auto-updater on Windows now stops retrying within a session once claude.exe is held by another process
Windows 上的自动更新程序现在会在 `claude.exe` 被其他进程占用时,停止在当前会话内的重试。
Improved color contrast for skill tags in the slash-command menu
改进了斜杠命令菜单中技能标签的颜色对比度。
Promo credit claims for Apple/Google-billed subscribers without a payment method now explain where to add one
对于通过 Apple/Google 计费但未设置支付方式的订阅用户,推广积分申领现在会说明在哪里添加支付方式。
Added a tip suggesting claude agents when running multiple concurrent sessions
新增了一条提示:在运行多个并发会话时,建议使用 claude agents。