官方更新 Claude Code Releases 2026-07-14T01:10 正文 ok 1012 words

Claude Code v2.1.208 发布:新增屏幕阅读器模式、Vim 映射及多项修复与优化

英文标题:Claude Code v2.1.208

Claude Code v2.1.208 为屏幕阅读器用户新增纯文本渲染模式,并添加 vim 插入模式键位映射配置。该版本引入企业包装器支持,统一管理后台进程,同时修复了包括内存泄漏、性能卡顿、后台会话崩溃、AWS SSO 认证失败等数十项缺陷。通过工具缓存、大表格限制和文件历史剪裁等手段显著降低资源占用,提升了长会话和 Headless 模式下的稳定性与响应速度,对开发者日常使用和自动化工作流都有重要价值。
打开原文相关 10.8 · 机会 2
media1.3 KB media52.1 KB

中文

更新内容

  • 新增屏幕阅读器模式:为屏幕阅读器用户提供可选纯文本渲染。运行 claude --ax-screen-reader,设置 CLAUDE_AX_SCREEN_READER=1,或在设置中添加 "axScreenReader": true。
  • 新增 vimInsertModeRemaps 设置:可在 vim 模式下将两键插入模式序列(如 jj)映射为 Escape。
  • 新增 CLAUDE_CODE_PROCESS_WRAPPER:Agent 视图和后台服务现在会通过必需的包装器可执行文件启动每个 Claude Code 自生成进程,以兼容企业启动器。
  • 新增全屏模式中多选菜单和“Other”输入行的鼠标点击支持。
  • 修复切换回支持 fast 模式的模型后,该模式未能自动恢复的问题——当在设置中启用 fast 模式后,现在会自动恢复。
  • 修复向后台 Agent 发送消息失败时回复内容丢失的问题——文本现在会被保存,并在会话重启时发送。
  • 修复更新替换二进制文件后,正在运行的 claude agents 进程导致后台会话永久无法附着(“无法启动后台守护进程”)的问题。
  • 修复 CLI 自动更新后上下文窗口(及自动压缩指示器)短暂重置为 200k,导致恢复长上下文会话时显示虚假的“100% 上下文已用”问题。
  • 修复当服务器使用 HTTP/2 GOAWAY 关闭连接且请求仍在进行时,受监管会话和后台会话崩溃的问题。
  • 修复通过 claude -p 管道传输大响应时,stream-json/JSON 输出被截断且丢失结果消息的问题。
  • 修复 CLAUDE_CODE_MAX_OUTPUT_TOKENS 等环境变量静默使用科学记数法值的尾数(如 1e6 被当成 1)的问题。
  • 修复非常大的 Markdown 表格导致渲染停滞或占用过多内存的问题;超过 200 行的表格现在只显示前 200 行,并显示“... 还有 N 行”提示。
  • 修复 Edit 工具在文件读取后已被修改但目标文本仍唯一匹配时操作失败的问题。
  • 修复 Read 工具对空文件报告“小于偏移量”、Grep 工具对无效正则表达式模式静默返回“未找到文件”、Grep 计数模式分页时总数偏低、以及当模式、路径或工作目录包含空字节时 Glob 工具崩溃且错误信息不清的问题。
  • 修复 apiKeyHelper 脚本失败后经历约 10 次静默重试仅显示通用 401 错误的问题;现在会在 3 次尝试内显示脚本自身错误。
  • 修复 Bedrock 流式请求在网关转换响应时失败并显示误导性“Truncated event message received”的问题——现在错误信息会指明 content-type 并提示代理问题。
  • 修复 /upgrade 在浏览器打开失败时显示登录流程而非升级链接的问题。
  • 修复 Windows 风格 SDK 主机发来的空白 CRLF 或纯空格行导致 stream-json 输入会话被杀死的问题。
  • 修复 headless stream-json 会话在 control_request 携带非字符串 set_model 载荷时永久挂起的问题;CLI 现在会回复错误响应。
  • 修复会话恢复时反复出现“未找到完成记录”提示的问题——孤立的后台任务现在合并为一条摘要。
  • 修复 Remote Control 客户端附着到终端托管会话后,在任务启动或停止前看不到后台 agent 和工作流进度的问题。
  • 修复子 Agent 的 tools 列表解析为空时,Agent 工具在无工具状态下启动的问题——现在会返回明确错误,列出未识别的条目。
  • 修复 /usage 在较新数据上显示过时缓存条形图的问题,以及 /mcp 在配置编辑后未重新归类占位服务器的问题。
  • 修复 SDK 主机(如 Claude Desktop)在空闲但存在后台任务时,“更改目录”操作失败并提示“回合正在进行中”的问题。
  • 修复工作流保存对话框显示 ~/.claude/workflows/ 而非用户级 CLAUDE_CONFIG_DIR 路径的问题。
  • 修复 /release-notes 将已查看说明注入模型上下文的问题——“显示全部”过去会将整个更新日志注入后续每个请求。
  • 修复 Agent 视图中,发送速览回复后粘贴的图像在屏幕生命周期内一直保留的内存泄漏问题。
  • 修复在客户端附着前,插件刷新导致通过初始化请求定义的 agents 丢失的问题。
  • 修复长时间会话中的多项内存泄漏:MCP stdio 服务器 stderr 每服务器累积至 64 MB、LSP 文档无限期保持打开(现采用 LRU 机制,上限 50 个文档)、异步 hook 输出在后台后仍被保留、以及 headless/SDK 会话中大工具结果载荷导致无限增长的问题。
  • 修复使用 offset/limit 读取包含极长单行文件时内存爆炸的问题——现在返回清晰错误,不再加载整行。
  • 修复存在大量 deny/ask 权限规则时,每轮对话出现数秒级减速的问题——规则匹配器现在编译一次并缓存。
  • 改进 agent 任务列表更新时的输入响应——任务更新不再重新渲染整个 UI。
  • 通过缓存工具池组装,降低 print/SDK 会话中大量 MCP 工具时的单次工具调用 CPU 开销(高工具数下工具调用轮次最高提速 7 倍)。
  • 将文件编辑读取缓存限制为 16 MB,避免钉住多达 1,000 个完整文件,从而减少内存使用。
  • 通过剪裁已覆盖的文件历史备份,降低会话记录大小(编辑密集型会话最高减少 79 倍),并限制检查点磁盘使用量。
  • 恢复包含后台 agents 或衍生分支的大型会话时,减少内存使用。
  • 已完成的后台 agents 现在会保留在 /tasks 列表中直至清理,而不是完成后立即消失。
  • 附着到已停止的后台 agent 时,现在会在会话预热时立即显示其会话记录,而不是空白“会话正在启动”屏幕。
  • 后台会话:较旧版本的守护进程不再静默将较新版本生成的工作器重启到旧二进制文件上。
  • Agent 视图:Ctrl+X 现在会删除已重命名分支的工作树,但绝不会销毁未推送的提交;保留工作树时保留会话行;重用工作树名称会重置为当前基准。
  • 命令中包含 $(…)/反引号/<(…) 的灾难性移除操作(如 rm -rf ~)现在在 --dangerously-skip-permissions 和 auto 模式中也会提示,与普通形式保持一致。
  • /install-github-app 和 /mcp 设置菜单不再在后台会话中打开。
  • 以空 URL 配置的 MCP 服务器现在在 /mcp 中显示为“未配置”而非配置错误。
  • /usage 现在在使用量接口被限速时显示最后已知的使用量条形图和“截至”注释,而不是错误屏幕。
  • 修复 Bedrock 认证在 sso_region 与 Bedrock 区域不同的 AWS SSO 配置文件上失败并提示“未找到或无效的会话令牌”的问题(2.1.207 回归故障)。

English / 原文

  1. Releases
  2. v2.1.208

Compare

Sorry, something went wrong.

No results found

What's changed

  • Added screen reader mode: opt-in plain-text rendering for screen reader users. Run claude --ax-screen-reader, set CLAUDE_AX_SCREEN_READER=1, or add "axScreenReader": true to settings.
  • Added vimInsertModeRemaps setting: map two-key insert-mode sequences like jj to Escape in vim mode
  • Added CLAUDE_CODE_PROCESS_WRAPPER: agent view and the background service now honor a corporate launcher by running every Claude Code self-spawn through a required wrapper executable
  • Added mouse-click support for multi-select menus and "Other" input rows in fullscreen mode
  • Fixed fast mode staying off after switching back to a model that supports it — it now restores automatically when enabled in settings
  • Fixed replies typed to a background agent being lost when delivery fails — the text is now saved and delivered when the session restarts
  • Fixed background-session attach failing permanently ("Couldn't start the background daemon") after an update replaced the binary a running claude agents process was launched from
  • Fixed the context window (and auto-compact indicator) briefly resetting to 200k after the CLI auto-updates, causing a false "100% context used" when resuming long-context sessions
  • Fixed supervised and background sessions crashing when a server closed an HTTP/2 connection with a GOAWAY while requests were in flight
  • Fixed truncated stream-json/JSON output and missing result message when piping large responses from claude -p
  • Fixed CLAUDE_CODE_MAX_OUTPUT_TOKENS and similar env vars silently using the mantissa of scientific-notation values (1e6 became 1)
  • Fixed very large markdown tables stalling rendering or using excessive memory; tables over 200 rows show the first 200 with a "… N more rows" notice
  • Fixed the Edit tool failing on files modified after reading when the target text still matches uniquely
  • Fixed Read reporting empty files as "shorter than offset", Grep silently returning "No files found" for invalid regex patterns, Grep count mode under-reporting totals when paginated, and Glob crashing with an unclear error when the pattern, path, or working directory contained a null byte
  • Fixed apiKeyHelper script failures being hidden behind a generic 401 after ~10 silent retries; the script's own error is now shown within 3 attempts
  • Fixed Bedrock streaming requests failing with a misleading "Truncated event message received" when a gateway transforms the response — the error now names the content-type and points at the proxy
  • Fixed /upgrade showing a login flow instead of the upgrade URL when the browser fails to open
  • Fixed stream-json input killing the session on blank CRLF or whitespace-only lines from Windows-style SDK hosts
  • Fixed headless stream-json sessions hanging permanently when a control_request carried a non-string set_model payload; the CLI now answers with an error response
  • Fixed repeated "No completion record was found" notices on session resume — orphaned background tasks now collapse into a single summary
  • Fixed Remote Control clients attaching to a terminal-hosted session not seeing background agents and workflow progress until a task started or stopped
  • Fixed the Agent tool launching with no tools when a subagent's tools list resolves to nothing — it now returns a clear error naming the unrecognized entries
  • Fixed /usage showing stale cached bars over fresher data, and /mcp not reclassifying placeholder servers after config edits
  • Fixed "Change directory" in SDK hosts (e.g. Claude Desktop) failing with "A turn is in progress" on idle sessions that have a running background task
  • Fixed the workflow save dialog showing ~/.claude/workflows/ instead of the CLAUDE_CONFIG_DIR location for user-scope saves
  • Fixed /release-notes adding the viewed notes to the model's context — "Show all" previously injected the entire changelog into every subsequent request
  • Fixed a memory leak in the agent view where pasted images were retained for the screen's lifetime after sending peek replies
  • Fixed SDK sessions losing agents defined via the initialize request when a plugin refresh ran before the client attached
  • Fixed several memory leaks in long sessions: MCP stdio server stderr accumulating up to 64 MB per server, LSP documents staying open indefinitely (now LRU with 50-doc cap), async hook output retained after backgrounding, and unbounded growth in headless/SDK sessions from large tool-result payloads
  • Fixed a memory blowup when reading files with extremely long single lines using offset/limit — the read now returns a clean error instead of loading the whole line
  • Fixed multi-second per-turn slowdowns in sessions with many permission deny/ask rules — rule matchers are now compiled once and cached
  • Improved input responsiveness while agent task lists update — task updates no longer re-render the entire UI
  • Reduced per-tool-call CPU overhead in print/SDK sessions with many MCP tools by caching tool-pool assembly (up to 7x faster tool rounds at high tool counts)
  • Reduced memory usage by bounding the file edit read cache to 16 MB instead of pinning up to 1,000 full files
  • Reduced session transcript size (up to 79x in edit-heavy sessions) and bounded checkpoint disk usage by pruning superseded file-history backups
  • Reduced memory usage when resuming sessions with background agents or forks spawned from large conversations
  • Completed background agents now stay listed in /tasks until cleanup instead of vanishing the moment they finish
  • Attaching to a stopped background agent now shows its transcript immediately while the session warms up, instead of a blank "Session is starting" screen
  • Background sessions: an older daemon no longer silently restarts workers spawned by a newer version onto the older binary
  • Agent view: Ctrl+X now deletes renamed-branch worktrees, never destroys unpushed commits, keeps the session row when a worktree is kept, and reused worktree names reset to the current base
  • Catastrophic removals (e.g. rm -rf ~) in commands containing $(…)/backticks/<(…) now prompt in --dangerously-skip-permissions and auto mode, matching the plain form
  • /install-github-app and the /mcp settings menu no longer open in background sessions
  • MCP servers configured with an empty URL now show as "not configured" in /mcp instead of a config error
  • /usage now shows your last-known usage bars with an "as of" note when the usage endpoint is rate-limited, instead of an error screen
  • Fixed Bedrock auth failing with "Session token not found or invalid" for AWS SSO profiles whose sso_region differs from the Bedrock region (2.1.207 regression)

You can’t perform that action at this time.