usage

Claude Code 2.1.222

工具與目錄
在這頁

新功能 2 項

01

代理各做各的,安全界線不再被繞過

你讓 Claude 在工作樹(Git 讓同一專案平行開多份副本的功能)裡處理另一件事時,最怕它回頭動到主工作副本。現在不論哪種工作階段,隔離都同時管住檔案編輯和 Bash 指令,子代理也不能對主工作副本下破壞性 Git 指令。背景任務裡的 PreToolUse 掛鉤(特定事件發生時被觸發的小程式)原本能自動放行而繞過工具限制,這個缺口也補上了。代理要用 SendMessage 傳話給另一個工作階段,訊息會先交給權限分類器檢查;若某個 skill 標了 disable-model-invocation,Claude 會請你親自執行,不會照著猜流程重做一遍。像把分工的人各留在自己的房間,門禁和鑰匙都還在。

官方原文

Fixed worktree-isolated sessions and their subagents being able to run destructive git commands against the main checkout; isolation now applies to file edits and Bash in every session type

Fixed PreToolUse auto-allow hooks bypassing tool restrictions in background agent tasks (summaries, compaction, renames)

Improved auto mode safety: messages sent to other agent sessions via SendMessage are now evaluated by the permission classifier before dispatch

Improved the refusal when Claude tries to invoke a skill with disable-model-invocation: Claude is now told to ask you to run the skill instead of replicating its workflow

02

分支、差異與遠端遙控,回到你真正的設定

你先推送分支、之後才建立 pull request 時,Claude Code 現在也能把工作階段連到那張 PR,包括透過 GitHub REST API 建立的 PR。查看 /diff、Remote Control 工作區差異或網頁版編輯差異時,它會直接讀 Git blob 的原始內容,不再受專案自訂 diff driver 或 textconv 影響;同一份變更不會被不同顯示規則扭曲。Remote Control 則收緊了啟動權:專案裡的 .claude/settings.json 與 .claude/settings.local.json 只能把它關掉,不能偷偷開啟;要開請在使用者範圍輸入 /config。像共用專案能貼告示說「今天不營業」,卻不能替每位同事擅自開門。

官方原文

Fixed sessions not linking to pull requests created after the branch was pushed, including through the GitHub REST API

Improved the /diff view, the Remote Control workspace diff, and file-edit diffs in Claude Code on the web sessions to use raw git blob content, ignoring workspace-configured diff drivers and textconv

Changed Remote Control auto-start so repo-local settings (.claude/settings.json or .claude/settings.local.json) can no longer turn it on (they can still turn it off); enable it at user scope via /config

修正 5 項

03

被駁回過的額度申請,現在能重新送出

你在 Team 或 Enterprise 方案替成員申請 /usage-credits,先前那次若被駁回,本來該能再送一次。舊版卻把被駁回的申請誤當成還在處理,跳出「你已送出用量點數申請」並把人擋在門外。現在這扇門會在申請被駁回後重新打開:成員可以提出新的用量點數申請,不必因為上一張失敗的申請一直卡住。這就像申請通道在上一份申請被駁回後重新開放,讓你再送一份新申請。

官方原文

Fixed /usage-credits on Team and Enterprise showing "you've already sent a usage credit request" for members whose earlier request was dismissed, blocking them from sending a new one

04

代理伺服器後的連線,不再假斷線或卡到失敗

公司網路走 HTTPS proxy(替你轉送加密網路連線的中介站)時,Claude Code 啟動前的連線檢查曾會卡住,最後才失敗。它現在改用和 API 請求相同、認得 proxy 的連線方式,逾時也會說清楚原因。回覆其實已經完整送達,卻被標成「回覆中途關閉」的誤報也修好了。若你把 ANTHROPIC_BASE_URL 指到自訂 gateway,伺服器明明持續送 keep-alive ping,閒置逾時器以前仍會響;現在會把這些 ping 算進去。像快遞車隔著轉運站仍持續回報位置,收件人不會再被通知包裹半路遺失。

官方原文

Fixed the startup connectivity check hanging and then failing behind an HTTPS proxy; it now uses the same proxy-aware transport as API requests and times out with a clear message

Fixed "Connection closed mid-response" errors being reported on responses that had actually completed

Fixed stream idle timeout firing on custom ANTHROPIC_BASE_URL gateways despite server keep-alive pings arriving on the wire

05

用量、登入與錯誤訊息,終於各自說對話

你查 /usage 時,MCP(Model Context Protocol,讓 AI 連接外部工具的協定)伺服器的用量不會再被算得太多:只有實際消耗到它回傳工具結果的請求,才會歸到它名下。claude.ai connector 的工作階段 token(登入驗證用的令牌)失效時,畫面不會假稱還要授權,而會提示你用 /login 登入。若你剛移除一台 MCP 伺服器,原本看不到的工具錯誤也會顯示出來;SendMessage 遇到太長的摘要則會截短後送出,不會撞上字數上限直接失敗。把它想成客服中心的案件流程:只有案件確實採用了某櫃台提供的資料,該櫃台才計入用量;通行證失效就附上 /login 指示;撤掉櫃台後,舊案件的錯誤紀錄仍可查看;交接摘要太長,先裁到收件欄上限再送出。

官方原文

Fixed /usage overattributing usage to MCP servers: a server's share now reflects only the requests that actually consumed its tool results, instead of every turn after any call to it

Fixed claude.ai connectors being falsely marked as needing authorization when the session token is invalid — they now show a /login hint instead

Fixed tool errors not being displayed for tools no longer available locally, for example after an MCP server is removed

Fixed SendMessage rejecting a long summary — it now truncates instead, so sends no longer fail on a character limit

06

代理選模與進度顯示更準,UltraPlan 功能下架

組織限制某個模型家族時,子代理或隊友指定 model: opus 這類別名,先前可能錯退回父代理的模型。現在它會在同一家族裡往下改選組織允許的最新模型,選擇和限制終於對得上。子代理逐字稿的 spinner(畫面上轉圈的等待動畫)標籤改了。它會顯示子代理自己的 effort:(思考力道/投入程度的設定),不再顯示整個工作階段的等級。若主機用 CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST 管理模型,主機的選模鍵會壓過磁碟裡過期的 managed-settings.json。另外,UltraPlan 功能已移除。像派工板終於標出每個人的實際班別,總部的最新規則也不再被檔案櫃裡的舊紙條蓋過。

官方原文

Fixed org-restricted model: opus-style subagent and teammate family aliases dropping to the parent model instead of stepping down to the newest org-allowed model in the family

Fixed the spinner's effort label in a subagent's transcript view showing the session's effort level instead of the subagent's own effort: setting

Fixed host model-selection keys not taking precedence over a stale on-disk managed-settings.json when CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST is set

Removed ultraplan feature

07

檔案監看更穩,螢幕閱讀器不再重念整行

你正在輸入問題又按了退格鍵,使用 --ax-screen-reader 模式的螢幕閱讀器以前會把整行輸入內容重新念一遍;現在刪除行尾文字時只回應剛刪掉的字元,耳朵不用反覆聽同一句。另一個少見但惱人的中斷也補好了:檔案監看器碰到檔案系統錯誤,或正在結束監看時,Claude Code 可能會當掉。現在這兩種時刻不再引發罕見崩潰。像校對員擦掉句尾一個字,只念那個被擦掉的字;門口的值班員遇到小狀況,也不會整間辦公室關燈離開。

官方原文

Fixed rare crashes when a file watcher hit a filesystem error or during file-watcher teardown

Fixed screen readers re-reading the whole input line on every backspace in --ax-screen-reader mode — end-of-line deletions now echo just the deleted characters