Claude Code v2.1.243
英文标题:Claude Code v2.1.243
Claude Code v2.1.243 为 `/usage` 新增 Loops 用量明细,并加入 `modelPicker`、提示词缓存 TTL、企业模型定价和免 API Key 登录等配置与管理能力。此次更新强化了组织级治理,包括托管设置来源提示、托管认证标记、GitHub Web 连接状态和用量遥测归属。版本还修复了 MCP 重连、自动模式、会话恢复、插件、CI 工作负载身份联合、Remote Control 和 VSCode 等大量问题。性能方面,原生安装包在 Linux x64 上从约 340 MB 缩小至约 75 MB,单会话内存占用也可减少约 40–70 MB。
打开原文相关 9.6 · 机会 3
1.3 KB
50.4 KB
中文
更新内容
- 在
/usage中新增 Loops 明细:显示每个循环的运行次数、总 token 数、每次运行的 token 数及最后运行时间,以便轻松发现失控或过度频繁的/loop任务 - 新增
modelPicker设置:可通过带顺序和标签的模型列表定制/model选择器(支持任意 ID 拼写形式,包括 Vertex/Bedrock ID),可追加到内置模型列表或替换内置列表 - 新增
promptCacheTtl和subagentPromptCacheTtl设置,使 API Key 及云服务提供商用户可让主对话保留 1 小时提示词缓存,同时子 Agent 仍保持 5 分钟缓存 - 新增
modelPricing托管设置,使组织签约的各模型费率和折扣乘数可用于/cost、状态栏和遥测成本数据,而非使用目录标价 - 在
/login→ Anthropic Console 下新增免 Key 登录方式:除创建 API Key 外,还提供“使用你的 Console 账户登录”(推荐),让不允许使用 API Key 的组织也能登录 - 在
/status中新增Skipped sources一行,列出存在但因更高优先级托管来源已启用而未被应用的托管设置来源(例如managed-settings.json) - 在
/mcp和/plugins中,为认证由组织管理的 claude.ai 连接器添加managed标记 - 为尚未连接 GitHub 以使用网页版 Claude Code 的 claude.ai 用户添加提示,引导其使用
/web-setup - 在
/status中新增一行,显示 GitHub 是否已连接至网页版 Claude Code(Pro/Max);未连接时会指向/web-setup - 在
/tasks及 Agent 详情对话框中新增显示各子 Agent 所使用的模型(及 effort 级别) - 修复非交互式(
-p)和 SDK 会话中的远程 MCP 服务器在连接断开后永远无法恢复的问题;现会自动重连或报告失败 - 修复从桌面应用发起的 MCP 服务器登录,在支持客户端 ID 元数据文档的服务器(例如 Linear)上因“Invalid redirect URI”失败的问题
- 修复启动时自动模式不可用的问题:此前若临时的服务端禁用状态被缓存,且后续标志获取失败,自动模式会持续不可用
- 修复自动模式工具调用的问题:当 API 短暂过载并要求客户端重试时,等待约一分钟后工具调用会被以“temporarily unavailable”拒绝
- 修复
/model选择器静默忽略 Ultracode 选择的问题;现在选择 Ultracode 会将其应用于当前会话 - 修复
/resume仅列出最近 50 个会话的问题;现在选择器会在滚动时加载更多会话 - 修复云端会话在轮次中途重启后恢复时,将待处理的 hook 或后台任务通知重新作为提示词发送,而非发送正常续接消息的问题
- 修复 2.1.232 版 socket 目录加固后,跨会话消息在用户命名空间和 rootless 容器内被静默关闭的问题
- 修复文本溢出容器时(例如
/login中的登录 URL),在屏幕其他部分重绘后丢失开头列的问题 - 修复在 emoji 后直接输入的拼写错误单词不会被
spellcheck标注下划线的问题 - 修复后台子 Agent 的最后一个后台 Bash 任务完成时不会被唤醒的问题
- 修复当 Anthropic API 始终未开始响应时,会话沉默超过 10 分钟的问题:请求现在会在约 3 分钟后超时、重试一次,随后显示
API Error: No response from API - 修复认证、模型可用性及其他客户端生成的错误消息呈现得像模型输出、而非错误行的问题
- 修复 CI 中的工作负载身份联合:同一任务内的进程会共享已交换的 token,而非重复交换一次性 token;遭拒绝的交换会快速失败并显示服务器消息
- 修复由服务器管理的
companyAnnouncements在以登录方式开启的会话启动时不显示的问题(例如/logout后首次启动) - 修复诸如
Bash(cat *)的 hookif条件会在无关 Bash 命令上触发的问题;此前当命令包含$()或反引号命令替换且后面跟有更多参数时会发生该问题 - 修复通过
--plugin-dir同时加载两个插件时,声明了marketplace字段的插件依赖永远无法解析的问题 - 修复最后一个 LSP 插件被禁用后,
/reload-plugins仍保留 LSP 工具的问题;现在,对于会重新读取对话的 LSP 插件变更,也会先发出警告 - 修复
--agents静默忽略无效 JSON 或无效 Agent 定义的问题;现在会像--mcp-config一样以明确错误退出 - 修复当
~/.claude.json包含无效 MCP 服务器条目时,/status显示“Found invalid entries in: .”却不显示文件名的问题 - 修复
/clear会从提示栏中移除/rename会话名称的问题;实际上该名称会保留给新会话 - 修复当
~/.claude/history.jsonl含有格式错误条目时,Ctrl+R 历史搜索及上箭头历史记录失效的问题 - 修复在对修改键进行编码的终端中(modifyOtherKeys / kitty 协议),Ctrl+[ 无法退出 vim INSERT 模式的问题
- 修复当
NO_PROXY中列出了localhost、但未设置小写no_proxy时,本地 IDE 连接仍通过HTTPS_PROXY路由并有时失败的问题;现在两种大小写形式都会被识别 - 修复当被阻止的命令仍以 0 退出时,沙箱网络违规详情会从 Bash 工具结果中丢失的问题(例如
curl输出代理服务器的 403 页面) - 修复在会话空闲期间,限流窗口重置后,状态栏
rate_limits字段和/usage仍显示重置前使用百分比的问题 - 修复
claude --teleport <session>在存在未提交更改时直接退出,而非像会话选择器一样提供暂存更改并继续的选项 - 修复当较旧版本的 GitHub CLI(不支持
gh auth token)已经完成认证时,/web-setup反复要求登录的问题 - 修复 Claude in Chrome 在自动更新清理其初始配置版本后失去与 Claude Code 连接的问题;原生宿主现在会通过稳定的
claude启动器启动 - [VSCode] 修复首次获取功能标志前启动的会话(例如刚安装后)以默认权限模式打开,而非自动模式或用户配置的默认模式的问题
- [VSCode] 修复在子 Agent 工具活动期间,Focus 视图中已展开的分区会自行折叠的问题
- 改进启动时间:沙箱和 MCP 初始化不再阻塞首帧渲染;纯启动跳过子命令注册;工作流发现、设置和信任存储相关操作的开销更低
- 改进原生安装和自动更新的下载体积:二进制文件现采用 zstd 压缩(Linux x64 上约为 75 MB,而此前为 340 MB)
- 改进通过
ANTHROPIC_AUTH_TOKEN直接向 Anthropic API 认证的会话,其使用量遥测数据向组织的归属方式,使相应的数据处理设置能够生效 - 改进原生二进制文件体积:通过更紧凑地存储内置 skill 和提示词文本,体积减少约 2 MB
- 改进原生构建的内存使用:代码现按需加载,而非让整个 bundle 常驻内存(每个会话内存占用约减少 40–70 MB)
- 改进长时间运行会话的峰值内存使用:随着堆内存增长,运行时现在会更早执行垃圾回收
- 改进 SSH 环境下的
/login:登录 URL 会立即显示;按下c会报告 URL 的复制方式,而非始终声称复制成功;同时新增提示说明如何在全屏模式下选择文本 - 改进在关闭 thinking 时使用
xhigh/maxeffort 的错误提示:现在会指出具体级别、关闭 thinking 的设置,以及使用/effort high作为解决方法 - 改进
/loop:Claude 连续被唤醒却无事可做时,终端会将其折叠为单行,而非逐条打印 - 修改沙箱 Bash 工具提示:不再列出允许访问的网络主机,因此 Claude 会尝试发起请求(而你可批准新主机),而非默认假定未列出的主机已被阻止
- 更新
/model选择器及内置claude-apiskill:将 Sonnet 5 的 $2/$10 每 Mtok 定价显示为标准目录价格,而非限时促销价 - 修改 macOS 上的 computer use:点击桌面、Dock 或 Finder 窗口时,现需像其他应用一样通过访问对话框授权 Finder
- 修改
/model、/fast和/effort:在 Bedrock、Vertex、Foundry 环境以及禁用遥测时,这些命令现在也会立即执行,而非排队至当前轮次结束 - 修复当服务器在会话中途丢失环境时,
claude remote-control会退出并使已连接的 Remote Control 会话搁置的问题;现可恢复 - 修复由
claude remote-control提供服务的 Remote Control 会话在停止并重启后有时会卡住的问题,影响不具管理员或所有者角色的 Team 和 Enterprise 成员 - 修改跨会话消息收件箱 socket:对于 30 秒内未发送任何完整行的连接会予以关闭;向其发送数据的脚本应在数据准备就绪后再连接
- 改进恢复由另一终端持有 Remote Control 的对话时的提示:现在会说明其他机器上的会话无法被本机看到,也无法连接到本机
- [VSCode] 改进长会话中的历史记录裁剪:优先丢弃较早的工具活动行,以便保留用户消息和 Claude 回复的可见性
- [VSCode] 改进扩展自身使用量遥测数据向组织的归属方式:当你使用 Claude 账户登录时,相应的数据处理设置能够生效
English / 原文
Compare
Sorry, something went wrong.
No results found
What's changed
- Added a Loops breakdown to
/usage: per-loop run count, total tokens, tokens per run, and last run, so runaway or chatty/looptasks are easy to spot - Added
modelPickersetting: curate the/modelpicker with an ordered, labeled list of models (any id spelling, including Vertex/Bedrock ids), appended to or replacing the built-in lineup - Added
promptCacheTtlandsubagentPromptCacheTtlsettings so API-key and cloud-provider users can keep a 1-hour prompt cache on the main conversation while subagents stay at 5 minutes - Added
modelPricingmanaged setting so an organization's contracted per-model rates and discount multiplier are used for/cost, the status line, and telemetry cost figures instead of list price - Added a keyless sign-in under
/login→ Anthropic Console: "Sign in with your Console account" (recommended) alongside creating an API key, so organizations that don't allow API keys can sign in - Added a
Skipped sourcesline to/statusthat lists managed settings sources (for examplemanaged-settings.json) present but not applied because a higher-precedence managed source is active - Added a
managedmarker in/mcpand/pluginson claude.ai connectors whose authentication is managed by your organization - Added a tip pointing claude.ai users who haven't connected GitHub for Claude Code on the web to
/web-setup - Added a
/statusline showing whether GitHub is connected for Claude Code on the web (Pro/Max), pointing to/web-setupwhen it isn't - Added the model (and effort level) each subagent ran on to
/tasksand the agent detail dialogs - Fixed remote MCP servers in non-interactive (
-p) and SDK sessions never recovering after a dropped connection; they now reconnect automatically or report as failed - Fixed MCP server sign-in started from the desktop app failing with "Invalid redirect URI" on servers that support client ID metadata documents (for example Linear)
- Fixed auto mode staying unavailable at startup when a temporary server-side disable was cached and later flag fetches failed
- Fixed auto mode tool calls being denied as "temporarily unavailable" after about a minute of waiting when the API was briefly overloaded and asked the client to retry
- Fixed the
/modelpicker silently ignoring an Ultracode selection; picking Ultracode now applies it to the current session - Fixed
/resumeonly listing the 50 most recent sessions; the picker now loads more as you scroll - Fixed cloud sessions resuming after a mid-turn restart with a pending hook or background-task notification re-sent as the prompt instead of the normal continuation message
- Fixed cross-session messaging silently turning off inside user namespaces and rootless containers after the 2.1.232 socket-directory hardening
- Fixed text that hangs outside its container (for example the sign-in URL in
/login) losing its leading columns when another part of the screen repaints - Fixed
spellchecknot underlining a misspelled word typed directly after an emoji - Fixed background subagents not waking when their last background Bash task completes
- Fixed sessions going silent for 10+ minutes when the Anthropic API never starts a response: the request now times out after ~3 minutes, retries once, then shows
API Error: No response from API - Fixed auth, model-availability, and other client-generated error messages rendering like model output instead of as error lines
- Fixed workload identity federation in CI: processes in one job share the exchanged token instead of re-exchanging the single-use token; a rejected exchange fails fast with the server's message
- Fixed server-managed
companyAnnouncementsnot showing at startup in a session that began with signing in (for example the first launch after/logout) - Fixed hook
ifconditions likeBash(cat *)firing on unrelated Bash commands when the command contained$()or backtick command substitution followed by more arguments - Fixed plugin dependencies declared with a
marketplacefield never resolving when both plugins are loaded together via--plugin-dir - Fixed
/reload-pluginskeeping the LSP tool after the last LSP plugin is disabled; it now also warns before an LSP plugin change that would re-read the conversation - Fixed
--agentssilently ignoring invalid JSON or invalid agent definitions; it now exits with a clear error, like--mcp-config - Fixed
/statusshowing "Found invalid entries in: ." with no filename when~/.claude.jsonhas an invalid MCP server entry - Fixed
/clearremoving the/renamesession name from the prompt bar even though the name was kept for the new session - Fixed Ctrl+R history search and up-arrow history breaking when
~/.claude/history.jsonlcontains a malformed entry - Fixed Ctrl+[ not leaving vim INSERT mode in terminals that encode modified keys (modifyOtherKeys / kitty protocol)
- Fixed the local IDE connection being routed through
HTTPS_PROXY(and sometimes failing) whenlocalhostwas listed inNO_PROXYbut not lowercaseno_proxy; both casings are now honored - Fixed sandbox network-violation details being dropped from the Bash tool result when the blocked command still exited 0 (for example
curlprinting the proxy's 403 page) - Fixed the status line
rate_limitsfields and/usagestill showing a rate-limit window's pre-reset usage percentage after the window reset while the session was idle - Fixed
claude --teleport <session>exiting on uncommitted changes instead of offering to stash them and continue, as the session picker already does - Fixed
/web-setuprepeatedly asking you to log in when an older GitHub CLI (withoutgh auth token) was already authenticated - Fixed Claude in Chrome losing its connection to Claude Code after an auto-update cleaned up the version it was set up with; the native host now launches via the stable
claudelauncher - [VSCode] Fixed sessions started before feature flags were first fetched (for example right after install) opening in the default permission mode instead of auto mode or your configured default mode
- [VSCode] Fixed Focus view sections you expanded collapsing on their own during subagent tool activity
- Improved startup time: sandbox and MCP bring-up no longer block the first frame, bare launches skip subcommand registration, and workflow discovery, settings, and trust-store work is cheaper
- Improved native install and auto-update download size: the binary is now zstd-compressed (about 75 MB instead of 340 MB on Linux x64)
- Improved attribution of usage telemetry to your organization for sessions that authenticate with
ANTHROPIC_AUTH_TOKENdirectly against the Anthropic API, so its data-handling settings apply - Improved native binary size: about 2 MB smaller by storing the bundled skill and prompt text more compactly
- Improved memory usage of native builds: code is now loaded on demand instead of keeping the whole bundle resident (roughly 40–70 MB less memory per session)
- Improved peak memory usage in long-running sessions (the runtime now garbage-collects sooner as the heap grows)
- Improved
/loginover SSH: the sign-in URL appears immediately, pressingcreports how the URL was copied instead of always claiming success, and a hint explains how to select text in fullscreen - Improved the error when effort
xhigh/maxis used with thinking turned off: it now names the level, the setting that disabled thinking, and/effort highas the fix - Improved
/loop: consecutive wake-ups where Claude has nothing to do now fold into a single line in the terminal instead of printing each one - Changed the sandboxed Bash tool prompt to no longer list allowed network hosts, so Claude attempts requests (and you can approve new hosts) instead of assuming unlisted hosts are blocked
- Updated the
/modelpicker and the bundledclaude-apiskill to show Sonnet 5's $2/$10 per Mtok pricing as its standard list price rather than a limited-time promo - Changed computer use on macOS so clicking the desktop, Dock, or a Finder window requires granting Finder via the access dialog, like any other app
- Changed
/model,/fast, and/effortto also run immediately instead of queueing until the turn ends on Bedrock, Vertex, and Foundry and when telemetry is disabled - Fixed
claude remote-controlexiting and stranding attached Remote Control sessions when the server drops its environment mid-session; it now recovers - Fixed Remote Control sessions served by
claude remote-controlsometimes getting stuck after it was stopped and restarted, for Team and Enterprise members without an admin or owner role - Changed the cross-session messaging inbox socket to close connections that send no complete line within 30 seconds; scripts posting to it should connect once their data is ready
- Improved the notice when resuming a conversation whose Remote Control is held by another terminal: it now says sessions on other machines can't be seen from, or reach, this one
- [VSCode] Improved history trimming in long sessions: older tool-activity rows are dropped first so your messages and Claude's replies stay visible
- [VSCode] Improved attribution of the extension's own usage telemetry to your organization when you are signed in with a Claude account, so its data-handling settings apply
You can’t perform that action at this time.