官方更新 Claude Code Releases 2026-07-24T17:14 正文 ok 577 words

Claude Code v2.1.219

英文标题:Claude Code v2.1.219

Claude Code v2.1.219 新增 Claude Opus 5(`claude-opus-5`)并将其设为默认 Opus 模型,提供 100 万 token 上下文窗口,快速模式定价为每百万 token 10 美元输入、50 美元输出。此次更新强化了沙箱网络白名单、MCP 配置诊断、目录注册 Hook、嵌套子 Agent 转发及自托管 Runner 的错误分类能力。动态工作流默认规模调整为中等,目标是少于 15 个 Agent,子 Agent 默认可嵌套生成至第 3 层。版本还修复了流式 API 错误导致输出丢失、权限恢复、模型选择器、Windows Git Bash、无障碍输入和远程控制状态等问题。
打开原文相关 10.8 · 机会 2
media1.3 KB media53.9 KB

中文

更新内容

  • 新增 Claude Opus 5(claude-opus-5),现为默认 Opus 模型——支持 100 万 token 上下文窗口,快速模式价格为每百万 token 10 美元输入、50 美元输出
  • 新增 sandbox.network.strictAllowlist 设置,用于拒绝沙箱命令访问未在允许列表中的主机,且无需提示确认
  • 新增 DirectoryAdded Hook:在通过 /add-dir 或 SDK 的 register_repo_root 控制请求于会话中途注册新的工作目录后触发
  • 在无头模式的 stream-json 初始化事件中新增 mcp_server_errors,列出因配置验证失败而被跳过的 --mcp-config 条目;终端运行时会输出启动警告
  • 新增 workflowSizeGuideline 设置键,使建议性的 Dynamic 工作流规模指导可从任意设置文件中配置;当存在此类配置时,/config 中对应行将被隐藏
  • 在 stream-json 中新增嵌套子 Agent 转发:设置 --forward-subagent-text 后,现在会显示在第 2 层及更深层级生成的子 Agent,并以其创建者 Agent 的 tool_use ID 为键
  • 修复当某一轮在流式 API 错误期间终止时,claude -p 文本输出会丢弃已生成回答的问题
  • 当服务器连接失败时,claude mcp list 和 /mcp 现会显示 HTTP 状态及错误文本;同时会对 MCP 配置值中隐藏的前导或尾随空白字符发出警告
  • 修复自托管 Runner 重启期间已批准的权限在会话恢复后被丢弃的问题,现在已批准的操作会正常执行
  • 修复当过期缓存预先写入标签时,Fable 模型行会针对已包含该模型的套餐错误显示“Requires usage credits”的问题
  • 修复自托管 Runner 启动期间收到 SIGTERM 时,活跃记录会一直残留至租约过期的问题;现在会正常注销
  • 为自托管 Runner 的启动及会话失败新增结构化失败分类,以便区分 Hook 错误、Runner 崩溃和配置错误
  • 修复 /model 选择器将合并后的 Opus 行显示为普通“Opus”而非“Opus (1M context)”的问题
  • 修复在 GNU screen 中按选择复制时,会将 base64 内容打印到终端而非复制所选内容的问题
  • 修复 Remote Control 客户端在模型切换、重新连接或组织检查失败后仍保留过期快速模式状态的问题
  • 修复 Windows 上 CLAUDE_CODE_GIT_BASH_PATH 指向非 bash/sh 二进制文件时导致退出或被错误用作 bash 的问题;现在会忽略该路径并发出警告
  • 修复 Vim 模式:在空提示符上于 NORMAL 模式按下 ←,现在会返回 Agent 视图,而不再仅切换至 INSERT 模式
  • 修复屏幕阅读器模式在每次按键时重写整行输入、而非仅回显所输入字符的问题
  • 改进“Remote Control is only available via api.anthropic.com”错误信息,现会指出导致该错误的具体设置
  • 改进 claude --teleport:当当前检出版本指向的仓库与会话仓库不一致时,会显示当前检出版本所指向的仓库
  • 将动态工作流的默认规模指导改为中等(目标少于 15 个 Agent);可在 /config 的 Dynamic workflow size 中选择其他规模或不设限制
  • 更改托管 MCP 允许列表/拒绝列表中 ${VAR} 条目的解析方式:现在从启动环境和托管设置环境中解析,而非从设置文件环境中解析
  • 更改 /model 选择器,使其仅高亮最新模型的名称,从而让高亮标记新版本,而非列表中任意一部分内容
  • 在运行中工作流的状态行中新增当前默认工作流规模,并提供指向 /config 的入口以便修改
  • 从快速模式中移除 Opus 4.7;/fast 现在适用于 Opus 5 和 Opus 4.8
  • 更新 claude-api skill,默认使用 Claude Opus 5,并提供从 Opus 4.8 迁移的路径
  • 子 Agent 现在默认可生成嵌套子 Agent,最大深度为第 3 层(此前为第 1 层);设置 CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=1 可禁用嵌套

English / 原文

  1. Releases
  2. v2.1.219

Compare

Sorry, something went wrong.

No results found

What's changed

  • Added Claude Opus 5 (claude-opus-5), now the default Opus model — 1M context, fast mode at $10/$50 per Mtok
  • Added sandbox.network.strictAllowlist setting to deny non-allowlisted hosts for sandboxed commands without prompting
  • Added DirectoryAdded hook that fires after /add-dir or the SDK register_repo_root control request registers a new working directory mid-session
  • Added mcp_server_errors to the headless stream-json init event, listing --mcp-config entries skipped by config validation; terminal runs print a startup warning
  • Added the workflowSizeGuideline settings key so the advisory Dynamic workflow size guideline can be set from any settings file; the /config row is hidden while one does
  • Added nested subagent forwarding in stream-json: subagents spawned at depth-2+ now appear when --forward-subagent-text is set, keyed by their spawning Agent tool_use id
  • Fixed claude -p text output dropping the answer already produced when a turn dies on a mid-stream API error
  • Added HTTP status and error text to claude mcp list and /mcp when a server fails to connect, and a warning for MCP config values with hidden leading or trailing whitespace
  • Fixed a permission you approved while a self-hosted runner was restarting being dropped when the session resumed, so the approved action now runs
  • Fixed the Fable model row showing "Requires usage credits" for plans that include it, when a stale cache had baked the label in
  • Fixed a SIGTERM arriving while a self-hosted runner was starting up leaving a stale active row until the lease expired; it now deregisters cleanly
  • Added structured failure categories to self-hosted runner spawn and session failures, so hook errors, runner crashes and config errors can be told apart
  • Fixed the /model picker showing the merged Opus row as plain "Opus" instead of "Opus (1M context)"
  • Fixed copy-on-select inside GNU screen printing base64 into the terminal instead of copying the selection
  • Fixed Remote Control clients keeping a stale fast-mode status after a model switch, reconnect, or failed org check
  • Fixed CLAUDE_CODE_GIT_BASH_PATH on Windows exiting or being used as bash when the path isn't a bash/sh binary; it's now ignored with a warning
  • Fixed Vim mode: pressing ← on an empty prompt now returns to the agent view from NORMAL mode, not just INSERT
  • Fixed screen-reader mode rewriting the entire input line on every keystroke instead of echoing only the typed character
  • Improved the "Remote Control is only available via api.anthropic.com" error to name the specific setting that caused it
  • Improved claude --teleport to show which repo your current checkout points at when it doesn't match the session's repo
  • Changed dynamic workflows to default to a medium size guideline (aim for fewer than 15 agents); pick another size or unrestricted with Dynamic workflow size in /config
  • Changed managed MCP allowlist/denylist ${VAR} entries to resolve from the startup environment and managed-settings env instead of settings-file env
  • Changed the /model picker to highlight only the newest model's name, so the highlight marks the new release rather than an arbitrary subset of the list
  • Added the current default workflow size to the running-workflow status line, with a pointer to /config for changing it
  • Removed Opus 4.7 from fast mode; /fast now applies to Opus 5 and Opus 4.8
  • Updated the claude-api skill to default to Claude Opus 5, with a migration path from Opus 4.8
  • Subagents can now spawn nested subagents up to depth 3 by default (was 1); set CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=1 to disable nesting

You can’t perform that action at this time.