Claude Code v2.1.286:修复会话崩溃、MCP凭证泄露及权限提示等
v2.1.286
推荐理由
本次更新包含关键的安全修复(MCP 凭证泄露)和严重的稳定性问题(会话崩溃、Remote Control 状态不同步)。涉及敏感数据暴露与会话中断,建议开发者尽快升级以保障环境安全与工作流连续性。
What's changed
变更内容
- Added a count such as "2 of 5" to the permission prompt when several permission requests stack up
- Added mouse support for the "N more" rows of lists in fullscreen mode: click one to jump to that end of the list, with hover and pressed states
- Fixed several Claude Code processes and IDE extensions each opening a login browser when gcpAuthRefresh or awsAuthRefresh credentials expire
- Fixed claude --resume and --continue sometimes losing every turn after a batch of parallel tool calls when the earlier session crashed or was killed
- Fixed API 400 errors after a tool or hook returned an object, number or boolean instead of text, including in resumed sessions
- Fixed cloud sessions with very large histories never waking up because the container was stopped while the transcript was still loading
- Fixed the Claude apps gateway's spend meter pricing 1-hour prompt cache writes at the cheaper 5-minute rate, and counting only the first model call's input tokens on streamed turns that run a server-side tool such as web search
- Fixed macOS sessions still showing "Not logged in" or "Login expired" after /login succeeds in another Claude Code window when a leftover ~/.claude/.credentials.json exists
- Fixed every turn failing when the Anthropic API refuses the model your default or a model alias resolves to: Claude Code now retries once on the previous model of the same tier
- Fixed Remote Control sessions (including claude remote-control) staying connected after your organization's policy turns Remote Control off; they now disconnect with a notice
- Fixed refusal and --fallback-model retries failing when the fallback model can't run fast; they now run at standard speed, with a one-time notice in interactive sessions
- Fixed headless sessions repeating the "MCP servers require authentication" reminder after a successful re-authentication when the MCP discovery cache is enabled
- Fixed claude auth status reporting a Console sign-in's stored API key as claude.ai; it now reports api_key, and the VS Code extension treats that session as an API key session
- Fixed /status listing an Anthropic profile beside an API key as if both were in effect; the profile is now marked as not in use
- Fixed Claude not being told when a file attached to a message sent over Remote Control did not arrive, and a file sometimes getting only 10 seconds for its last download try
- Fixed a Remote Control message that arrived while Claude Code was exiting being marked delivered and then never answered; it now stays queued for the session's next run
- Fixed MCP error messages showing a credential's value when "Bearer" or "Basic" came before its key name
- Fixed percent-encoded Bearer tokens being only partly masked in error messages
- Fixed redacted logs and transcripts showing a secret whose key name has an invisible character inside, such as a zero-width space
- Fixed logs and transcripts showing part of a URL password that contains punctuation such as ), quotes, ], & or a second @, or that runs past a / to a bracketed host such as [::1] in an ssh URL
- Fixed the session transcript in the zip that /feedback saves to disk containing invalid JSON lines after secret redaction
- Fixed MCP connectors listing no tools for up to a day after their server dropped the older MCP handshake
- Fixed a repeat MCP sign-in request from Claude replacing the pending sign-in link, which could stop that link from working
- Fixed /usage not crediting an MCP server for a tool call made while that server was still connecting or had only just connected, such as right after a restart
- Fixed plugins enabled on claude.ai occasionally going missing from Claude Code for a session after a transient server error
- Fixed a message typed into a running subagent showing twice in its transcript after the subagent read it
- Fixed subagent hand-back messages showing a raw task id instead of the agent's name when the subagent had no registered name
- Fixed foreground subagents sometimes missing the task-tracking tools (TaskCreate/Get/Update/List, TodoWrite) in sessions that have them enabled
- Fixed subagents spawned with worktree isolation loading the project CLAUDE.md and its imports a second time from the worktree copy on their first file read
- Fixed Workflow tool subagents being restarted from their original prompt when a connection stalled for a few minutes mid-response
- Fixed /compact, /clear, and /rewind typed while viewing a background agent's or teammate's transcript silently acting on the main conversation: a dialog now names the target and asks first
- Fixed background jobs showing done while waiting for your approval
- Fixed the commit attribution reminder being re-sent inside tool output when a model fallback lasts only one turn
- Fixed a click on the space between words of a collapsed row (such as "Thought for 4s") highlighting the row without expanding it in fullscreen mode
- Fixed a row with no details, such as an action row with a long name, pushing every other row's details to the right in list screens
- Fixed files with very long names not reaching a cloud session when attached to it
- Fixed plugin errors for a marketplace Claude Code refuses to load: they now say why and how to fix it instead of "not found"
- Fixed /plugin's Discover tab showing a marketplace name unquoted in its "Checking … for new plugins" line when its rows already show that name in quotes
- Improved commit guidance: when your project or user skills include one named verify, Claude is now told to run it right before committing, except for docs-only and tests-only commits
- Improved send now (ctrl+enter) in a subagent's view: it now moves the subagent's running command to the background so your message is read right away
- Improved replies from background agents to your messages so they no longer open with a separate recap of what you said
- Improved claude.ai artifact link reads: WebFetch now asks the same questions as the Artifact tool's read (no artifact prompt while the session's network access is on, one per artifact while it is off), and an auto-mode yes no longer counts where only you can answer
- Improved fetch, skill, file read, sandbox network, Claude in Chrome, workflow script and notebook edit permission prompts to match the look of file edit prompts
- Improved Bash, PowerShell and Monitor permission prompts to show the command between dashed lines, matching file edit prompts
- Improved list scrollbars in fullscreen mode: in most lists the bar no longer shifts as the "N more" rows come and go, and it now has ↑/↓ arrows you can click or hold to scroll
- Improved the external editor (Ctrl+G): editors that take a line number now open on the line your cursor is on in the prompt
- Improved slash command suggestion responsiveness while typing when many skills or plugin commands are installed; command descriptions now match by word prefix
- Improved the output style picker: it now opens on your current style instead of Default, with each style's description on the line under its name; number keys no longer pick a style
- Improved /hooks: the closing line of a hook's detail screen now says "this hook" instead of "it"
- Improved the model fallback notice and the autocompact-thrashing error to say when a fallback dropped the context window from 1M to 200K tokens
- Improved responsiveness of SDK and -p sessions when a host re-sends an MCP server enable for a server that is already connected
- Improved the protocol page a Claude apps gateway serves at /protocol: it now says not to reject unknown input and matches what Claude Code sends today
- Changed prompts sent while nothing is running or queued to show in the normal text color right away instead of gray
- Changed how failed API requests are retried: one limit now covers a whole model call, so with the default retry settings a failing call sends at most 14 requests
- 当多个权限请求堆叠时,在权限提示中添加了计数,例如“5 个中的第 2 个”
- 在全屏模式下为列表的“更多 N 行”添加了鼠标支持:点击可跳转至该列表末端,并支持悬停和按下状态
- 修复了当 gcpAuthRefresh 或 awsAuthRefresh 凭证过期时,多个 Claude Code 进程和 IDE 扩展各自打开登录浏览器的问题
- 修复了 claude --resume 和 --continue 在某些情况下,当早期会话崩溃或被终止时,在一批并行工具调用后丢失所有回合的问题
- 修复了当工具或钩子返回对象、数字或布尔值而非文本时(包括在恢复的会话中),API 出现 400 错误的问题
- 修复了具有极长历史记录的云会话无法唤醒的问题,原因是容器在转录加载完成前被停止
- 修复了 Claude 应用网关的支出计量器将 1 小时提示缓存写入按更便宜的 5 分钟费率计算,并且在运行服务器端工具(如网络搜索)的流式传输回合中仅计算第一个模型调用的输入令牌的问题
- 修复了在另一个 Claude Code 窗口中 /login 成功后,若存在残留的 ~/.claude/.credentials.json 文件,macOS 会话仍显示“未登录”或“登录已过期”的问题
- 修复了当 Anthropic API 拒绝默认模型或模型别名解析到的模型时,所有回合均失败的问题:Claude Code 现在会在同一层级的上一个模型上重试一次
- 修复了远程操控会话(包括 claude remote-control)在组织策略关闭远程操控后仍保持连接的问题;它们现在会断开连接并显示通知
- 修复了当备用模型无法快速运行时,拒绝处理和 --fallback-model 重试失败的问题;它们现在以标准速度运行,并在交互式会话中显示一次性通知
- 修复了启用 MCP 发现缓存时,成功重新认证后无头会话重复显示“MCP 服务器需要身份验证”提醒的问题
- 修复了 claude auth status 将控制台登录存储的 API 密钥报告为 claude.ai 的问题;它现在报告 api_key,且 VS Code 扩展将该会话视为 API 密钥会话
- 修复了 /status 将 Anthropic 配置文件与 API 密钥并列列出,仿佛两者均生效的问题;配置文件现在标记为未使用
- 修复了当通过远程操控发送的消息所附加的文件未到达时,Claude 未被告知的情况,以及文件有时仅获得 10 秒进行最后一次下载尝试的问题
- 修复了 Claude Code 退出时到达的远程控制消息被标记为已送达但随后从未响应的问题;该消息现在会保留在队列中,直到会话的下一次运行
- 修复了 MCP 错误消息在 "Bearer" 或 "Basic" 位于密钥名称之前时显示凭证值的问题
- 修复了错误消息中仅部分掩码百分号编码的 Bearer token 的问题
- 修复了脱敏日志和转录文本显示密钥名称内部包含不可见字符(如零宽空格)的机密信息的问题
- 修复了日志和转录文本显示 URL 密码部分内容的问題,这些密码包含标点符号(如 )、引号、]、& 或第二个 @),或者在 ssh URL 中越过 / 延伸至方括号主机(如 [::1])
- 修复了 /feedback 保存到磁盘的 zip 文件中的会话转录文本在机密信息脱敏后包含无效 JSON 行的问题
- 修复了 MCP 连接器在其服务器丢弃旧版 MCP 握手后长达一天内未列出任何工具的问题
- 修复了重复的 MCP 登录请求替换待处理登录链接,从而导致该链接失效的问题
- 修复了 /usage 未在 MCP 服务器仍在连接或刚刚连接(例如重启后立即)时进行工具调用后为该服务器计权的问题
- 修复了 claude.ai 上启用的插件在短暂服务器错误后偶尔从 Claude Code 的某个会话中消失的问题
- 修复了输入到正在运行的子代理的消息在其转录文本中被显示两次的问题
- 修复了当子代理没有注册名称时,子代理交还消息显示原始任务 ID 而非代理名称的问题
- 修复了前台子代理在某些启用了任务跟踪工具(TaskCreate/Get/Update/List、TodoWrite)的会话中有时缺失这些工具的问题
- 修复了使用工作树隔离生成的子代理在首次读取文件时,从工作树副本中第二次加载项目 CLAUDE.md 及其导入内容的问题
- 修复了 Workflow 工具子代理在响应中途连接停滞几分钟时被从其原始提示词重新启动的问题
- 修复了在查看后台代理或队友的转录文本时键入 /compact、/clear 和 /rewind 会静默作用于主对话的问题:现在对话框会指明目标并先征求同意
- 修复了后台作业在等待用户批准时显示已完成的问题
- 修复了当模型回退仅持续一个回合时,提交归属提醒在工具输出内部被重新发送的问题
- 修复了点击折叠行(如“思考了 4 秒”)的词间区域会在全屏模式下高亮显示该行但不展开它的问题
- 修复了列表屏幕中无详细信息的行(例如名称过长的操作行)导致其他所有行的详细信息向右偏移的问题
- 修复了附加到云会话时,文件名过长导致无法到达云会话的问题
- 修复了市场应用中 Claude Code 拒绝加载的插件错误:现在会显示具体原因及修复方法,而非仅提示“未找到”
- 修复了 /plugin 的 Discover 标签页在“Checking … for new plugins”行中未对已以引号显示的市场应用名称进行引用的问题
- 改进了提交指引:当你的项目或用户技能中包含名为 verify 的技能时,Claude 现在会在提交前立即运行它,但仅限文档或测试的提交除外
- 改进了子代理视图中的发送功能(Ctrl+Enter):现在会将子代理的运行命令移至后台,以便立即读取你的消息
- 改进了来自后台代理对你消息的回复,使其不再以单独的重述你所说内容的摘要开头
- 改进了 claude.ai 工件链接的阅读体验:WebFetch 现在会提出与 Artifact 工具阅读相同的询问(会话网络访问开启时无工件提示,关闭时每个工件一次),且自动模式下的“是/否”选择仅在你能回答时才计数
- 改进了获取、技能、文件读取、沙箱网络、Chrome 中的 Claude、工作流脚本和笔记本编辑权限提示的外观,使其与文件编辑提示保持一致
- 改进了 Bash、PowerShell 和 Monitor 权限提示,使其在虚线之间显示命令,与文件编辑提示保持一致
- 改进了全屏模式下的列表滚动条:在大多数列表中,随着“N more”行的出现和消失,滚动条不再发生位移,并且现在提供了可点击或按住以滚动的 ↑/↓ 箭头
- 改进了外部编辑器(Ctrl+G):支持行号输入的编辑器现在会直接打开到提示词中光标所在的行
- 改进了安装大量技能或插件命令时输入斜杠命令建议的响应速度;命令描述现在按单词前缀进行匹配
- 改进了输出样式选择器:现在默认打开当前选中的样式而非 Default,每个样式的描述显示在其名称下方的行中;数字键不再用于选择样式
- 改进了 /hooks:钩子详情屏幕的结束行现在显示“this hook”而非“it”
- 改进了模型回退通知和自动紧凑抖动错误提示,明确说明回退何时将上下文窗口从 1M tokens 降至 200K tokens
- 改进了 SDK 和 -p 会话在主机重新发送 MCP 服务器启用请求时的响应速度,针对已连接的服务器
- 改进了 Claude apps 在 /protocol 路径下提供的协议页面:现在明确说明不应拒绝未知输入,并与当前 Claude Code 发送的内容保持一致
- 更改了提示词显示逻辑:当没有任务运行或排队时,提示词立即以正常文本颜色显示,而非灰色
- 更改了失败 API 请求的重试机制:现在一个限制覆盖整个模型调用,因此在默认重试设置下,一次失败的调用最多发送 14 个请求
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力