Claude Code v2.1.234 发布:新增会话自动续接、GitLab MR 状态与多项安全修复
英文标题:Claude Code v2.1.234
Claude Code v2.1.234 新增 `CLAUDE_CODE_PROJECT_DIR_NAME` 环境变量、`selection:clear` 快捷键动作,以及 GitLab 合并请求状态徽标。claude.ai 使用额度重置后,Claude Code 现可自动继续此前会话,用户可在 `/config` 中关闭该功能。此次更新重点加强了 Windows NT 命名空间路径防护,以降低 NTLM 凭据泄露风险,并修复了 MCP 密钥泄露、权限预览脱敏、远程控制和跨会话消息等问题。版本还优化了长会话、Markdown 渲染、API 错误诊断、会话标题生成及内置 `claude-api` skill 的上下文开销,对开发者的稳定性、安全性和使用效率均有提升。
打开原文相关 10.8 · 机会 2
1.3 KB
51.5 KB
中文
更新内容
- 新增可选的
CLAUDE_CODE_PROJECT_DIR_NAME环境变量:为每个会话提供独立配置目录的宿主环境,可以为按项目存储的转录记录目录指定较短名称。 - 新增
selection:clear快捷键绑定动作,因此可将某个按键绑定为清除应用内文本选区;该功能同样适用于 agents 视图。 - 在页脚和状态栏中新增 GitLab 合并请求徽标:对于配置了 GitLab 远程仓库且已通过 glab CLI 身份验证的仓库,会显示带草稿、待处理或绿色状态的 MR !N。
- 当 claude.ai 使用额度限制重置后,Claude Code 现在会自动继续你的会话;可在
/config中关闭此功能(“在使用额度限制时自动继续”)。 - 现在会明确告知 Claude:你的账户邮箱仅用于识别你的身份,除非你提出要求,否则不得将其发送给无关服务。
- 安全性:远程文件读取、会话恢复、
CLAUDE.md包含文件、工作流脚本和文件上传现在都会拒绝 Windows NT 命名空间(\??\)路径,从而强化其余审批前文件访问的防护,降低 NTLM 凭据泄露攻击风险。 - 修复了在极长会话中、对话已被压缩后,自动模式反复重新检查并拒绝沙箱命令网络访问的问题。
- 修复了在响应后台子 Agent 工具权限提示时,会丢失会话范围内的权限回答(包括拒绝)的情况。
- 修复了非流式回退路径中的 API 响应(通常来自第三方网关)包含缺少
thinking字段的 thinking 块,或缺少text字段的文本块时导致崩溃的问题。 - 修复了某些包含异常 Unicode 序列的消息导致 Markdown 渲染速度极慢的问题。
- 修复了当会话名称达到 200 个字符上限或包含大量 emoji 时,
SendMessage会拒绝通过ListAgents复制的收件人的问题。 - 修复了仓库检测错误读取包含异常 userinfo 的 Git 远程仓库主机名,进而为错误主机生成链接及应用仓库专属行为的问题。
- 修复了 MCP 诊断信息输出已解析密钥的问题:作用域冲突警告现在会显示配置中的
${VAR}形式,连接失败详情则仅显示服务器源地址。 - 修复了
strictKnownMarketplaces允许列表接受 SCP 风格 Git marketplace 源、但其主机与 Git 实际连接主机不一致的问题。 - 修复了在全屏模式下复制
/loginOAuth URL 等模态框文本时丢失字符的问题。 - 修复了渲染后的 Markdown 中,
---水平分隔线与下一行文字粘连的问题。 - 修复了在待办事项或任务更新穿插于连续 shell 命令之间时,连续命令被拆分为多条“Ran 1 shell command”记录的问题。
- 修复了当
!shell 命令运行期间打开/permissions等对话框时,命令结束会导致对话框被关闭的问题。 - 修复了在按上箭头编辑排队输入后,已排队的
!shell 命令会作为纯文本发送给模型的问题。 - 修复了排队消息仍在队列中时重新出现在提示历史中的问题;选择排队消息时按 Esc 不再中断当前轮次;同时,
!模式不再会在轮次中途提交后持续启用。 - 修复了接受“Try the new fullscreen renderer?”提示后,会话重启时丢失权限模式(例如
--dangerously-skip-permissions)、工具允许/拒绝规则、模型或 effort 标志的问题。 - 修复了
/tui重启时丢失启动参数--allowed-tools/--disallowed-tools规则的问题;当会话包含无法通过重启继承的限制时,现在会拒绝切换并说明原因。 - 修复了当某目录在其中创建仓库前就已被访问时,信任提示遗漏“仓库范围”警告的问题。
- 修复了一种情况:在权限重新提示期间关闭 IDE diff 标签页,可能会用先前输入回答新提示。
- 修复:由 Claude Code Desktop 或 VS Code 托管的远程控制会话中,发送给用户的文件现在会被上传,因此可在手机和网页端打开,而不再显示为空卡片。
- 修复:在设置
CLAUDE_CODE_OAUTH_TOKEN的情况下执行/login后,过期令牌提醒不再泄漏到 Claude 自动恢复的轮次中——现在仅会显示给你。 - 修复:权限预览现在只会转发给通过入站信任门槛许可的频道服务器,并会遵守服务器明确声明的不支持权限功能的设置。
- 修复:转发权限预览时的凭据脱敏不再可能向审批者隐藏命令、路径或目标地址;过大的私钥块现在会采用完全强度的脱敏处理。
- 修复:在权限预览中需要脱敏的提供商 API token,即使其后直接跟随 shell 分隔符,现在也会被正确脱敏。
- 修复了当跨会话消息读取显示为禁用时,Claude Desktop 接收方会话静默丢弃跨会话消息的问题;该问题会使发送方查询长时间处于“thinking”状态。
- 远程控制:在此计算机上登录不同的 claude.ai 账户或组织后,现在会在数秒内停止正在运行的会话并说明原因,而不再会在数小时后返回误导性的 HTTP 404。
- 从 Claude Code Desktop 或 VS Code 启动的远程控制会话,现在会在会话权限模式发生变化时同步更新手机端和 claude.ai/code;同时也会向 claude.ai/code 同步模型信息。
- 远程控制:在手机端或 claude.ai/code 中选择的 effort 现在会应用于终端及 Desktop/VS Code 托管的会话,且会话会向已连接客户端发布其 effort 级别。
SendMessage和ListAgents现在会在你的账户会话列表过长、无法完整检查时予以说明,而不再将未看到的会话视为不存在。- 当已过期的 Anthropic profile 凭据遇到 claude.ai 登录优先级更高的情况时,现在会引导你前往
/login。 - 改进转录记录:你自己的提示现在也会像回复一样渲染 Markdown,包括高亮代码块、行内代码和列表。
- 改进“API returned an empty or malformed response”错误提示:现在会说明实际返回内容(内容类型、正文类型、大小、请求 ID),以及原始流式请求失败的原因。
- 改进自动生成的会话标题,使其成为简短、具体的名称(例如“Login button bug”),而不是重复陈述请求的句子(例如“Fix the login button on mobile”)。
- 通过按需加载参考文档,将加载内置
claude-apiskill 的上下文开销从约 20 万以上 token 降至约 2.5 万 token。 - 现在可在 Claude 工作期间打开
/permissions,规则变更会应用于当前轮次的剩余部分。 - 现在可在 Claude 工作期间使用
/add-dir <path>;在全屏 TUI 中,也可以在轮次中途打开/add-dir、/autocompact、/theme、/help、/config和/advisor对话框。 /goal现在会在某一轮因不可恢复错误(例如认证被撤销、信用余额耗尽或上下文溢出)而终止时,显示通知并自行清除,而不再保持待执行状态。/goal:当后台任务使目标等待超过 30 分钟时,Claude 现在会主动检查任务状态,而不再无限等待(可设置CLAUDE_CODE_GOAL_CHECKIN_MINUTES=0选择退出)。claude setup-token现在会拒绝意外的额外参数,而不再静默忽略。- 更改全屏模式下 Esc 的行为:它不再清除鼠标选中的文本,而是照常用于中断或关闭内容,文本选区将保持高亮。
- 移除了自动模式在每次 Agent 工具调用下方显示的冗余“Allowed by auto mode classifier”行。
- 从
/config中移除了“Default teammate model”设置;agent-team 的队友现在默认使用领导 Agent 的模型,除非在创建时明确指定模型。 - 调暗了正在运行工具标题中的已用时间计数器,使其不再与粗体计数信息争夺视觉注意力。
- 轮次之间送达的后台任务通知现在会在
<system-reminder>标签内发送给模型,与轮次中途的传递方式一致。 - Mantle:当已选定主循环模型时,启动时跳过管理员 PIN 可用性探测。
- Windows:当
~/.claude.json为只读时,启动过程不再因反复重命名重试而卡顿。
English / 原文
Compare
Sorry, something went wrong.
No results found
What's changed
- Added the optional
CLAUDE_CODE_PROJECT_DIR_NAMEenvironment variable: hosts that give each session its own config directory can choose a short name for the per-project transcript directory - Added the
selection:clearkeybinding action, so a key can be bound to clear an in-app text selection; also works in the agents view - Added a GitLab merge request badge to the footer and statusline: repos with a GitLab remote and an authenticated glab CLI show MR !N with draft/pending/green states
- Claude Code now continues your session automatically when a claude.ai usage limit resets; turn it off in
/config("Continue automatically at usage limit") - Claude is now told to use your account email only to identify you, and not to send it to unrelated services unless you ask
- Security: remote file reads, session restore, CLAUDE.md includes, workflow scripts and file uploads now reject Windows NT-namespace (
\??\) paths, hardening the remaining pre-approval file accesses against the NTLM credential-leak vector - Fixed auto mode in very long sessions repeatedly re-checking and denying sandboxed commands' network access after the conversation had been compacted
- Fixed session-scoped permission answers (including denies) being dropped when answering background subagent tool permission prompts
- Fixed a crash when an API response on the non-streaming fallback path (typically via third-party gateways) contained a thinking block missing its thinking field or a text block missing its text field
- Fixed markdown rendering becoming extremely slow for some messages containing unusual Unicode sequences
- Fixed
SendMessagerejecting a recipient copied fromListAgentswhen the session name is at the 200-character cap or emoji-heavy - Fixed repository detection mis-reading the host of git remotes with unusual userinfo, producing links and repo-specific behavior for the wrong host
- Fixed MCP diagnostics printing resolved secrets: scope-conflict warnings now show the configured
${VAR}form, and connection-failure details show only the server origin - Fixed
strictKnownMarketplacesallowlists accepting SCP-style git marketplace sources whose host differs from the one git would actually connect to - Fixed modal text such as the
/loginOAuth URL losing characters when copied in fullscreen - Fixed a
---horizontal rule in rendered markdown running into the line after it - Fixed consecutive shell commands splitting into multiple "Ran 1 shell command" rows when todo/task updates were interleaved between them
- Fixed dialogs like
/permissionsopened while a!shell command was running being dismissed when the command finished - Fixed a queued
!shell command being sent to the model as plain text after pressing up-arrow to edit the queued input - Fixed queued messages reappearing in the prompt history while still queued, Esc while selecting a queued message no longer interrupts the turn, and
!mode no longer sticks after a mid-turn submit - Fixed accepting the "Try the new fullscreen renderer?" prompt restarting the session without its permission mode (e.g.
--dangerously-skip-permissions), tool allow/deny rules, model or effort flags - Fixed
/tuidropping launch--allowed-tools/--disallowed-toolsrules when it restarts; it now declines to switch, with the reason, when the session has restrictions a restart can't carry over - Fixed trust prompts omitting the repository-wide scope warning when the directory was first seen before the repository existed there
- Fixed a case where an IDE diff tab closing during a permission re-prompt could answer the new prompt with the previous input
- Fixed: files sent to the user during Remote Control sessions hosted by Claude Code Desktop or VS Code now upload, so they open on phone and web instead of showing an empty card
- Fixed: after
/loginwhileCLAUDE_CODE_OAUTH_TOKENis set, the stale-token reminder no longer leaks into Claude's automatically resumed turn — it now appears only to you - Fixed: permission previews now relay only to channel servers admitted by the inbound trust gate, and a server's explicit permission-capability opt-out is honored
- Fixed: credential masking on relayed permission previews can no longer hide commands, paths, or destinations from the approver; oversized private-key blocks now redact under full-strength redaction
- Fixed: provider API tokens that mask on permission previews now mask even when directly followed by shell delimiters
- Fixed Claude Desktop inter-session messages being silently dropped by the recipient session when cross-session messaging read as disabled, which left the sender's query "thinking" for many minutes
- Remote Control: signing this computer in to a different claude.ai account or organization now stops the running session within seconds and says why, instead of a misleading HTTP 404 hours later
- Remote Control sessions started from Claude Code Desktop or VS Code now keep phones and claude.ai/code updated on the session's permission mode (and claude.ai/code on the model) as they change
- Remote Control: effort picks made on a phone or on claude.ai/code now apply to terminal- and Desktop/VS Code-hosted sessions, and the session publishes its effort level to connected clients
SendMessageandListAgentsnow say when your account's session list was too long to check completely, instead of treating unseen sessions as absent- Expired Anthropic profile credential now points you at
/loginwhen a claude.ai login would take precedence - Improved the transcript: your own prompts now render markdown (highlighted code blocks, inline code, lists) the same way replies do
- Improved the "API returned an empty or malformed response" error to say what came back (content type, body kind, size, request ID) and why the original streaming request failed
- Improved auto-generated session titles to read as short, specific names (e.g. "Login button bug") rather than sentences restating your request (e.g. "Fix the login button on mobile")
- Reduced the context cost of loading the built-in
claude-apiskill from ~200k+ tokens to ~25k by loading reference docs on demand /permissionscan now be opened while Claude is working — rule changes apply to the rest of the current turn/add-dir <path>can now be used while Claude is working;/add-dir,/autocompact,/theme,/help,/configand/advisordialogs open mid-turn in the fullscreen TUI/goalnow clears itself with a notice when a turn dies on an unrecoverable error (e.g. revoked auth, an exhausted credit balance, or a context overflow) instead of staying armed/goal: when background tasks keep a goal waiting for 30+ minutes, Claude now checks in on them instead of waiting indefinitely (setCLAUDE_CODE_GOAL_CHECKIN_MINUTES=0to opt out)claude setup-tokennow rejects unexpected extra arguments instead of silently ignoring them- Changed Esc in fullscreen mode to no longer clear a mouse text selection: it interrupts or dismisses as usual and the selection stays highlighted
- Removed the redundant "Allowed by auto mode classifier" line that auto mode showed under every Agent tool call
- Removed the "Default teammate model" setting from
/config; agent-team teammates now use the leader's model unless the spawn names one - Dimmed the elapsed-time counter on the running tool header so it no longer competes with the bold counts
- Background task notifications delivered between turns are now sent to the model inside
<system-reminder>tags, matching mid-turn delivery - Mantle: skip the admin-pin availability probe at startup when a main-loop model is already picked
- Windows: startup no longer stalls on repeated rename retries when
~/.claude.jsonis read-only
You can’t perform that action at this time.