Claude Code v2.1.246 发布:权限、后台会话与插件系统大量修复
英文标题:Claude Code v2.1.246
Claude Code v2.1.246 新增了对存在潜在风险的 Bash 通配符允许规则的启动警告,并在 `/permissions` 中加入 Auto mode 标签页,用于查看和编辑自动模式分类器规则。此次更新重点修复了全屏转录性能与滚动、后台会话、MCP 工具调用、插件安装与缓存、主题渲染、权限检查及第三方 API 兼容性等大量问题。对于开发者而言,更新提升了超长会话、大型 diff、后台 Agent、远程/无头运行和企业托管环境下的稳定性,并改善了非交互式会话的中断恢复能力。
打开原文相关 7.2 · 机会 3
1.3 KB
52.8 KB
中文
更新内容
- 为子命令之前带有通配符的 Bash 允许规则新增启动警告(例如
Bash(git * main)),因为这类规则同样会匹配插入在子命令之前的选项。 - 在
/permissions中新增 Auto mode 标签页,用于查看和编辑自动模式分类器规则。 - 在回合结束时长行末尾新增该回合的完成时间,例如
✻ Sautéed for 23s · done 6:05 PM。 - 修复了在调整终端大小并跳转到底部后,全屏模式会显示空白转录内容、直至下一次按键才恢复的问题。
- 修复了当 diff 包含极长的单行内容(例如 base64 字符串)时,转录内容会严重变慢的问题;此类行现在会被截断渲染并显示标记。
- 修复了位于较早消息时全屏滚动异常的问题,包括“跳转到底部”卡在转录内容中间的情况。
- 修复了以下情况下后台会话在 45 秒后无法打开的问题:Claude Code 的启动目录已被删除、机器曾进入睡眠状态,或主机启动进程较慢。
- 修复了当另一个 Claude Code 进程正在重新安装 npm 包时,后台会话无法打开并报错
Couldn't start the background service … EACCES的问题。 - 修复了当一条消息的前 500 个字符不含 Markdown 时,整条消息的 Markdown 渲染会被禁用的问题;同时修复了
+/N)列表及 Setext 标题的渲染问题。 - 修复了在无头/远程会话中,MCP 工具调用被传入消息中断时,会向模型报告为“completed with no output”,而非明确的中断错误的问题。
- 修复了当参数 schema 为空(
{})时,MCP 工具参数会以 JSON 字符串而非其真实类型发送的问题。 - 修复了命令在执行过程中被中断时,界面显示为
Ran 1 shell command且未表明其被截断的问题。 - 修复了在动态工作流期间按下 ← 或运行
/background会重新启动已完成子 Agent 的问题;现在会先询问确认,并说明将重新启动多少个子 Agent。 - 修复了在
claude agents中打开刚启动、其 worker 仍在引导的会话(Windows 上较常见)时,会以was stopped while the respawn was in flight停止的问题。 - 修复了
claude agents会将已转入后台的命名会话列出两次的问题;再次将同一对话转入后台时,新行现在会编号(例如my-session (2))。 - 修复了后台保留清理任务会删除
.claude/worktrees/下由用户自行创建的 Git worktree 的问题;此前旧的后台会话记录可能指向这些 worktree。 - 修复了在超大规模会话中,自动模式工具调用会因安全检查截止时间不足而被以“temporarily unavailable”拒绝的问题;安全检查截止时间现在会随提示词大小扩展。
- 修复了插件缓存会为同一插件创建重复的、以 SHA 命名目录的问题。
- 修复了插件 skill 的 frontmatter
name已包含<plugin>:前缀时,斜杠菜单中会重复显示此前缀的问题(例如/plugin:plugin:skill)。 - 修复了对已安装插件使用裸名称执行
claude plugin update时失败的问题;此前仅完全限定名称可用。 - 修复了当
plugin.json使用带 UTF-8 字节顺序标记(BOM)的格式保存时,插件安装失败的问题。 - 修复了对于在
skills/*/SKILL.md下定义 skill 的插件,/reload-plugins会报告 0 个 skill 的问题。 - 修复了 hook 错误消息会原样显示
${CLAUDE_PLUGIN_ROOT},而非显示解析后的插件路径的问题。 - 修复了
/rename会将主题的提示边框颜色(包括自定义主题的promptBorder)替换为默认青色的问题;除非通过/color选择颜色,边框现在会保留主题原有颜色。 - 修复了 diff 和
/theme预览中忽略自定义主题 diff 颜色(diffAdded/diffRemoved及其暗化变体)的问题。 - 修复了
keybindings.json中绑定未知操作名称时,该按键会被静默禁用的问题;现在会跳过该绑定以保留默认绑定,并在--debug下记录警告。 - 修复了在 UTC 以东时区中,
/stats活动热图会将每天活动错位一个单元格显示的问题(周日的计数显示在周一下面)。 - 修复了从已 fork 或已转入后台的会话运行
/fork时,新会话会以空对话开始的问题。 - 修复了以
/--开头的提示词(例如 Lean 文档注释)会被作为未知斜杠命令拒绝、而非发送给 Claude 的问题。 - 修复了在输入文本不再匹配真实路径后,
@文件选择器仍保持打开的问题。 - 修复了在导航至 Agent 视图后再返回时,状态行的成本和时长会重置为零的问题。
- 修复了全屏模式中,单击终端窗口只是为了重新获得焦点时,键盘焦点会移动到鼠标指针下方控件的问题。
- 修复了当补全 token 或工作目录包含空字节时,路径补全失败的问题。
- Windows/macOS:修复了无头会话不会清理
~/.claude/sessions中由未正常退出会话遗留的过期条目的问题。 - 修复了当第三方 Anthropic 兼容端点(
ANTHROPIC_BASE_URL)流式传输不带id的tool_use块时,首次工具调用会导致 UI 因渲染错误停止的问题。 - 修复了覆盖非常大的现有文件后,Write 工具尽管已写入文件仍报告“Out of memory”或长时间冻结的问题。
- 修复了当
~/.claude/plugins/known_marketplaces.json为空或损坏时,claude plugin install <name>会静默退出(或在终端中挂起)而非报告错误的问题。 - 修复了恢复的会话中,若保存历史包含 Anthropic API 不接受的工具块(通常由第三方 API 代理写入),每个回合都会以 400 错误失败的问题。
- 修复了部分采用服务器托管设置的 Team/Enterprise 用户运行
curl -fsSL https://claude.ai/install.sh | bash时,因Raw mode is not supported而失败的问题。 - 修复了在 VS Code 扩展中,以 plan mode 结束的会话恢复后会退出 plan mode 的问题;也修复了未设置权限模式时,在
claude -p --continue/--resume且使用权限提示工具时出现的相同问题。 - 修复了当沙箱的“Network request outside of sandbox”权限提示正在等待时,
Notificationhook 不会触发的问题。 - 修复了 Bash 权限检查对于带有悬空
&&或||运算符的格式错误命令未始终要求审批的问题。 - 修复了
--strict-mcp-config会话会提示批准其永远不会加载的.mcp.json服务器、导致后台会话在启动时等待的问题。 - 修复了发送至 Anthropic 的遥测和指标请求会携带为第三方网关(
ANTHROPIC_BASE_URL)配置的 API 密钥的问题;现在凭据仅会发送至其所属主机。 - 修复了当
apiKeyHelper返回短生命周期 JWT 时,空闲后的首个提示词会显示可见 API 错误的问题:现会在发送前刷新过期的缓存 token,并静默重试 401/403 认证错误。 - 修复了全屏和 Ctrl+O 转录视图中的内存会随会话长度增长的问题:每个渲染的消息行不再保留完整的、覆盖整个转录内容的工具查找副本。
- 修复了从同一仓库(例如多个 worktree)同时启动
/ultrareview运行和云端会话时,有时会携带另一启动任务的未提交更改的问题。 - 修复了后台云端会话(如
/autofix-pr)显示的任务进度计数(例如3/5)偶尔遗漏一个任务的问题。 - 修复了 Remote Control 会话在第二个提示词之前,会在 claude.ai 和 Claude 应用中保留占位名称的问题;自动生成的标题现在会在第一个提示词后出现。
- 修复了标记为
requiresUserInteraction的 MCP 工具仍会在权限提示中提供“是,并且不再询问”选项的问题;该选项会写入一个随后被工具忽略的允许规则。 - 修复了自托管 runner 在工作轮询响应格式错误时(例如拦截代理返回 HTML 页面)会结束实时会话或退出的问题;现在会重试轮询。
- 改进了
/cd:切换目录后,新目录的项目设置、hook、.mcp.json服务器(仍受常规审批提示保护)、skill 和 Agent 将立即生效,而不再需要使用--resume。 - 改进了 Bash shell 中 Bash 工具的延迟:通过重放快照函数,避免每个函数都启动一个 base64 子 shell。
- 改进了子 Agent 结果:达到
maxTurns限制而停止的子 Agent,现在会返回标注为部分结果的输出,并提示可通过SendMessage继续它,而不再看起来像已完成。 - 改进了非交互式会话(
-p、SDK、云端会话):当响应因服务器错误、连接丢失或停滞而在流传输中途被截断时,现在会自动继续响应,而不再以错误结束。 - 改进了以下场景中使用遥测对组织的归因:工作负载身份联合会话、启动时
apiKeyHelper运行期间发送的事件,以及空闲期间登录 token 过期后的事件。 - 修改了
/code-review:Claude 现在也可以在 Bedrock、Vertex AI 和 Foundry 上、通过 Claude apps gateway,以及在禁用遥测或非必要流量时自行启动该功能。 /goal:调整为对于每个目标,空闲会话最多对长期运行的后台工作发起三次 check-in;用户发送下一条消息后,还可再进行三次。- 修改了
claude install和claude update:对于待处理的托管设置同意提示,改为推迟到下一次交互式会话处理,而非在命令执行中途提示。 - 修改了从 claude.ai 同步的插件所产生的 OpenTelemetry 插件事件:
plugin_id_hash现在反映插件真实的 marketplace;对于管理员安装的插件,enabled_via为admin-install。 - 修复了命令沙箱的文件系统配置不遵守
--setting-sources的问题。
English / 原文
Compare
Sorry, something went wrong.
No results found
What's changed
- Added a startup warning for Bash allow rules with a wildcard before the subcommand (e.g.
Bash(git * main)), since they also match options inserted before the subcommand - Added an Auto mode tab to
/permissionsfor viewing and editing auto mode classifier rules - Added the turn's completion time to the end-of-turn duration line, e.g.
✻ Sautéed for 23s · done 6:05 PM - Fixed fullscreen mode showing a blank transcript after resizing the terminal and jumping to the bottom until the next keypress
- Fixed a severe transcript slowdown when a diff contained a very long single line (e.g. a base64 string); such lines now render truncated with a marker
- Fixed erratic fullscreen scrolling when positioned at an earlier message, including jump-to-bottom getting stuck mid-transcript
- Fixed background sessions failing to open after 45 seconds when Claude Code's starting directory had been deleted, the machine had slept, or the host is slow to start processes
- Fixed background sessions failing to open with "Couldn't start the background service … EACCES" when another Claude Code process was re-installing the npm package at that moment
- Fixed markdown rendering being disabled for a whole message when its first 500 characters contained no markdown, and for
+/N)lists and setext headings - Fixed MCP tool calls interrupted by an incoming message in headless/remote sessions being reported to the model as "completed with no output" instead of an explicit interrupted error
- Fixed MCP tool arguments being sent as JSON strings when the parameter's schema is empty (
{}), instead of their real type - Fixed a command interrupted mid-run showing as "Ran 1 shell command" with no sign it was cut
- Fixed pressing ← or running
/backgroundduring a dynamic workflow restarting its finished subagents; it now asks first and says how many subagents would restart - Fixed opening a just-started session in
claude agentswhile its worker was still booting (common on Windows) stopping it with "was stopped while the respawn was in flight" - Fixed
claude agentslisting a backgrounded named session twice; backgrounding the same conversation again now numbers the new row (e.g.my-session (2)) - Fixed the background retention sweep removing git worktrees under
.claude/worktrees/that you created yourself when an old background-session record pointed at them - Fixed auto mode tool calls being denied as "temporarily unavailable" on very large sessions by scaling the safety-check deadline with prompt size
- Fixed the plugin cache creating duplicate SHA-named directories for the same plugin
- Fixed plugin skills whose frontmatter
namealready includes the<plugin>:prefix showing it doubled in the slash menu (e.g./plugin:plugin:skill) - Fixed
claude plugin updatefailing for an installed plugin given its bare name (only the fully-qualified name worked) - Fixed plugin installation failing when
plugin.jsonwas saved with a UTF-8 byte-order mark (BOM) - Fixed
/reload-pluginsreporting 0 skills for plugins that define skills underskills/*/SKILL.md - Fixed hook error messages showing a literal
${CLAUDE_PLUGIN_ROOT}instead of the resolved plugin path - Fixed
/renamereplacing the theme's prompt border color (including a custom theme'spromptBorder) with the default cyan; the border now keeps your theme's color unless you pick one with/color - Fixed custom theme diff colors (
diffAdded/diffRemovedand their dimmed variants) being ignored in diffs and the/themepreview - Fixed a
keybindings.jsonbinding with an unknown action name silently deadening that key; it is now skipped so the default binding keeps working, and a warning is logged under--debug - Fixed
/statsactivity heatmap showing each day's activity one cell off (Sunday's count under Monday) in timezones east of UTC - Fixed
/forkfrom an already-forked or backgrounded session starting the new session with an empty conversation - Fixed prompts beginning with
/--(e.g. Lean doc comments) being rejected as an unknown slash command instead of being sent to Claude - Fixed the
@file picker staying open after the typed text stopped matching a real path - Fixed the status line's cost and duration resetting to zero after navigating to the agents view and back
- Fixed fullscreen mode moving keyboard focus onto the control under the pointer when you clicked the terminal window only to bring it back into focus
- Fixed path completion failing when the completion token or working directory contained a null byte
- Windows/macOS: Fixed headless sessions not cleaning up stale entries in
~/.claude/sessionsleft by sessions that exited uncleanly - Fixed the UI stopping with a render error on the first tool call when a third-party Anthropic-compatible endpoint (
ANTHROPIC_BASE_URL) streams atool_useblock without anid - Fixed the Write tool reporting "Out of memory" or freezing for a long time after overwriting a very large existing file, even though the file had been written
- Fixed
claude plugin install <name>exiting silently (or hanging in a terminal) instead of reporting an error when~/.claude/plugins/known_marketplaces.jsonis empty or corrupted - Fixed resumed sessions failing every turn with a 400 when the saved history contains tool blocks the Anthropic API does not accept (typically written by a third-party API proxy)
- Fixed
curl -fsSL https://claude.ai/install.sh | bashfailing with "Raw mode is not supported" for some Team/Enterprise users with server-managed settings - Fixed sessions that ended in plan mode resuming outside plan mode in the VS Code extension, and in
claude -p --continue/--resumewith a permission prompt tool, when no permission mode was set - Fixed the
Notificationhook not firing while the sandbox "Network request outside of sandbox" permission prompt is waiting - Fixed Bash permission checks to always require approval for malformed commands with a dangling
&&or||operator - Fixed
--strict-mcp-configsessions prompting to approve.mcp.jsonservers they would never load, which left background sessions waiting at startup - Fixed telemetry and metrics requests to Anthropic carrying the API key configured for a third-party gateway (
ANTHROPIC_BASE_URL); a credential is now only sent to its own host - Fixed a visible API error on the first prompt after idle when
apiKeyHelperreturns short-lived JWTs: an expired cached token is now refreshed before sending, and 401/403 auth errors retry quietly - Fixed memory growing with session length in the fullscreen and Ctrl+O transcript views: each rendered message row no longer retains a full copy of the transcript-wide tool lookups
- Fixed
/ultrareviewruns and cloud sessions launched at the same time from one repository (e.g. from several worktrees) sometimes starting with another launch's uncommitted changes - Fixed the task progress count (e.g.
3/5) shown for background cloud sessions such as/autofix-proccasionally missing a task - Fixed Remote Control sessions keeping their placeholder name in claude.ai and the Claude app until the second prompt; the auto-generated title now appears after the first prompt
- Fixed MCP tools marked
requiresUserInteractionstill offering "Yes, and don't ask again" in their permission prompt; the option wrote an allow rule the tool then ignored - Fixed the self-hosted runner ending its live sessions or exiting when a work-poll response is malformed (e.g. an intercepting proxy's HTML page); it now retries the poll
- Improved
/cd: the new directory's project settings, hooks,.mcp.jsonservers (behind the usual approval prompt), skills, and agents now take effect right after the move instead of on--resume - Improved Bash tool latency on bash shells by replaying snapshot functions without a base64 subshell per function
- Improved subagent results: a subagent that stops at its
maxTurnslimit now returns its output marked as partial, with a hint to continue it viaSendMessage, instead of appearing finished - Improved non-interactive sessions (
-p, SDK, cloud sessions) to automatically continue a response cut off mid-stream by a server error, connection loss, or stall instead of ending with an error - Improved attribution of usage telemetry to your organization for workload identity federation sessions, events sent while
apiKeyHelperruns at startup, and after a login token expired while idle - Changed
/code-reviewso Claude can also start it on its own on Bedrock, Vertex AI, and Foundry, through the Claude apps gateway, and when telemetry or non-essential traffic is disabled /goal: Changed idle sessions to start at most three check-ins on long-running background work per goal; your next message allows three more- Changed
claude installandclaude updateto defer a pending managed-settings consent prompt to the next interactive session instead of prompting mid-command - Changed OpenTelemetry plugin events for plugins synced from claude.ai:
plugin_id_hashnow reflects the plugin's real marketplace, andenabled_viaisadmin-installfor admin-installed plugins - Fixed the command sandbox's filesystem configuration not respecting
--setting-sources
You can’t perform that action at this time.