Claude Code v2.1.236 发布:新增默认模型配置与跨会话空闲通知
英文标题:Claude Code v2.1.236
Claude Code v2.1.236 新增 `ANTHROPIC_DEFAULT_MODEL` 环境变量,用于指定新会话默认启动的模型,同时保留 `/model` 选择在重启后的持久性。此次更新还为跨会话 `SendMessage` 增加 `notify_when_idle`,可在另一 Claude Code 会话下次空闲时发送一次性通知,无需轮询。版本重点修复了 macOS Sandbox、全屏渲染、终端界面、后台会话、MCP 日志及自动模式等多项问题,并改善了 VS Code 无障碍支持。对开发者而言,这意味着模型配置、跨会话协作、自动化安全检查和终端稳定性均得到增强。
打开原文相关 7.2 · 机会 1
1.3 KB
53.6 KB
中文
更新内容
- 新增
ANTHROPIC_DEFAULT_MODEL环境变量:用于设置新会话启动时使用的模型;通过/model选择的模型仍可覆盖该设置,并会在重启后保持生效(不同于ANTHROPIC_MODEL)。 - 为跨会话
SendMessage新增notify_when_idle:可请求本机上的另一 Claude Code 会话在其下次进入空闲状态时发送一条通知——需主动启用、仅触发一次、无需轮询(macOS 和 Linux)。 - Sandbox:在 macOS 上,通配符读取拒绝规则(例如
**/.env)现在会在允许读取的区域内优先执行,覆盖匹配目录中的内容,且不能通过重命名被拒绝的文件来绕过。 - 修复了会话切换到的目录被删除后,剪贴板复制、后台维护任务、后台会话和本地 MCP 日志失效的问题(自 2.1.229 起存在)。
- 修复全屏渲染器在一次启动失败后永久失效的问题:现在会回退到经典渲染器,而不是在之后每次启动时退出。
- 修复
/model选择器显示高度超过终端的问题:现在只显示窗口可容纳数量的模型,其余模型可通过滚动访问。 - 修复当格式错误的闭合标签导致消息文本留在摘要字段中时,
SendMessage调用被拒绝的问题。 - 修复子进程启动失败时未处理的 Promise 拒绝问题,例如在禁用 Windows 互操作的 WSL 中启动
powershell.exe时(2.1.234 中引入的回归)。 - 修复全屏模式下终端调整大小后,新发送的消息有时要到下一次更新才显示的问题。
- 修复全屏模式下清除多行提示词后,提示词上方可能残留空白区域,以及终端缩小后再恢复时窗格未重绘的问题。
- 修复托管设置审批提示有时未在启动时出现、却仍将第一次按键视为审批的问题。
- 修复 tmux 中终端标签标题跳动的问题(iTerm tmux 集成):现在仅在标题文本变化时写入标题,而不再每 960 毫秒更新一次。
- 修复云环境列表返回为空或格式错误时出现不清晰错误提示的问题。
- 修复使用 Remote Control 时,Fable 5 首次使用额度提示在 60 秒未得到回应后自动选择备用模型的问题。
- 修复当
~/.claude.json中缓存的访客通行证奖励格式错误时,加载动画提示始终不显示且反复产生后台错误的问题。 - 修复 SDK/VS Code 会话中的技能热重载问题:当会话工作目录被删除后,每次技能变更都会报错(2.1.229+)。
- 修复自托管 Runner 会话在因空闲、退役或启动超时而释放后,偶尔会在后置会话钩子完成前于另一 Runner 上恢复的问题。
- 修复 Clawd 吉祥物的眼睛和脚部在 iTerm2 的某些字体大小下显示不均匀的问题。
- 修复偶发的会话回顾文本无限增长问题:回顾文本(自动生成及
/recap)现在限制为 400 个字符,并在词边界处截断。 - 改进启动性能:会话计数器现在在后台写入。
- 改进自动模式:自动模式启用期间,
Monitor允许规则将被暂时搁置,因此 Monitor 命令将与 Bash 命令一样接受审查。 - 改进 Bedrock、Vertex AI、Foundry 平台以及禁用遥测时的自动模式:分类器现在采用与 Claude API 相同的默认设置,包括按严重程度评分的分类。
- 改进自动模式:Git 状态检查不再会被仓库的
status.showUntrackedFiles=no设置误导,从而错误报告工作树干净。 - 调整
/model选择器:现在只高亮最新模型的名称,使高亮标记新发布的模型,而不是列表中任意一部分模型。 /goal:目标因长时间运行的后台工作而被搁置的空闲会话,现在会在 30 分钟后自动主动联系用户(随后为 1 小时、2 小时),而不再等待用户返回。/usage现在会为 Team 和 Enterprise 成员显示使用额度消费行,并在尚未产生任何消费时以 0% 显示上限行。- print/SDK 模式下收到 SIGTERM 时,不再在退出前记录中断的轮次或合成的工具拒绝;正在运行的命令仍会被终止,进程仍以退出代码 143 退出。
- 在输入错误的斜杠命令或当前会话不可用的命令后按 Enter,现在会报告该问题,而不会执行最接近的模糊匹配;前缀和别名仍可正常执行。
- 当 CLI 退出或其终端关闭时,Remote Control 现在会在数秒内将会话标记为离线。
SendMessage现在会在快速连续发送将超过目标会话收件箱可接受范围时,预先拒绝后续消息,而不再显示消息已发送但实际被丢弃。- 将提示词边框上的会话标题标签与页脚右边缘对齐。
- 右对齐的页脚项目(目标指示器、会话状态、后台 Agent 状态)以及被截断的通知,现在与提示词区域其余部分保持一致的右侧边距。
- [VSCode] 为对话记录新增屏幕阅读器支持:包括对回复、权限请求、错误和状态变化的实时播报,以及按轮次标题导航。
English / 原文
Compare
Sorry, something went wrong.
No results found
What's changed
- Added
ANTHROPIC_DEFAULT_MODELenvironment variable: sets the model new sessions start on, while a/modelpick still overrides it and persists across restarts (unlikeANTHROPIC_MODEL) - Added
notify_when_idleto cross-sessionSendMessage: ask another Claude Code session on this machine to send one notice when it next goes idle — opt-in, one-shot, no polling (macOS and Linux) - Sandbox: on macOS, wildcard read-deny rules (e.g.
**/.env) now take precedence inside allowed read regions, cover matched directories' contents, and can't be bypassed by renaming the denied file - Fixed clipboard copy, background housekeeping, background sessions, and local MCP logs breaking after the directory a session had switched into was removed (since 2.1.229)
- Fixed the fullscreen renderer failing permanently after a single failed start: it now falls back to the classic renderer instead of exiting on every subsequent launch
- Fixed the
/modelpicker rendering taller than the terminal: it now shows only as many models as fit the window, with the rest reachable by scrolling - Fixed
SendMessagecalls being rejected when a malformed closing tag left the message text inside the summary field - Fixed unhandled promise rejections when a subprocess fails to start, for example
powershell.exeon WSL with Windows interop disabled (regression in 2.1.234) - Fixed fullscreen mode sometimes not showing a newly sent message until the next update after the terminal was resized
- Fixed a blank band that could remain above the prompt after clearing a multi-line prompt, and panes not repainting after resizing the terminal away and back, in fullscreen mode
- Fixed the managed-settings approval prompt sometimes not appearing at startup while still capturing the first keypress as approval
- Fixed terminal tab titles jumping in tmux (iTerm tmux integration): the title is now written only when its text changes instead of animating every 960ms
- Fixed an unclear error when the cloud environments list came back empty or malformed
- Fixed the Fable 5 first-time usage-credits prompt auto-selecting the fallback model after 60 seconds with no answer when using Remote Control
- Fixed spinner tips never appearing, with a repeated background error, when the cached guest-pass reward in
~/.claude.jsonwas malformed - Fixed skills hot-reload in SDK/VS Code sessions raising an error on every skills change after the session's working directory was deleted (2.1.229+)
- Fixed self-hosted runner sessions released on idle, retire, or startup timeout occasionally resuming on another runner before the post-session hook had finished
- Fixed the Clawd mascot's eyes and feet rendering unevenly in iTerm2 at some font sizes
- Fixed occasional runaway session recaps: recap text (automatic and
/recap) is now capped at 400 characters, cut at a word boundary - Improved startup performance: the session counter is now written in the background
- Improved auto mode:
Monitorallow rules are now set aside while auto mode is active, so Monitor commands are reviewed the same way Bash commands are - Improved auto mode on Bedrock, Vertex AI, and Foundry, and when telemetry is disabled: the classifier now uses the same defaults as on the Claude API, including severity-scored classification
- Improved auto mode: the git status check can no longer be fooled by a repo's
status.showUntrackedFiles=nosetting into reporting a clean tree - Changed the
/modelpicker to highlight only the newest model's name, so the highlight marks the new release rather than an arbitrary subset of the list /goal: an idle session whose goal is parked behind long-running background work now checks in automatically after 30 minutes (then 1h, 2h) instead of waiting for you to return/usagenow shows the usage-credits spend row for Team and Enterprise members, and shows a capped row at 0% before anything is spent- SIGTERM in print/SDK mode no longer records an interrupted turn or synthetic tool denials before exiting; running commands are still terminated and the process still exits with code 143
- Pressing Enter on a slash-command typo or a command unavailable in this session now reports it instead of running the closest fuzzy match; prefixes and aliases still run
- Remote Control now marks a session offline within seconds when the CLI exits or its terminal closes
SendMessagenow refuses further messages to a session up front once a rapid burst would exceed what that session's inbox accepts, instead of reporting them sent while they were dropped- Aligned the session title chip on the prompt border with the footer's right edge
- Right-aligned footer items (goal indicator, session state, background agent status) and truncated notices now share a consistent right margin with the rest of the prompt area
- [VSCode] Added screen reader support for the transcript: live announcements for replies, permission requests, errors, and status changes, plus per-turn heading navigation
You can’t perform that action at this time.