Claude Code 2.1.223
新功能 5 項
GitHub 組織的外掛市集可整批放行或封鎖
公司管理者不必再替 GitHub 組織底下每個外掛市集逐一開名單。現在受管設定能用 "owner/*" 這種萬用字元,owner 換成組織名稱,星號代表它底下所有市集。想只准公司核可的來源,可在 strictKnownMarketplaces 加入它;若整個組織都不能用,則放進 blockedMarketplaces。例如 {"strictKnownMarketplaces":["acme/*"]} 會承認 acme 組織所有市集。這像大樓門禁直接認一整棟公司的識別證,不必替每位員工各登一筆。
官方原文
Added owner wildcard entries ("owner/*") to the strictKnownMarketplaces and blockedMarketplaces managed settings for allowing or blocking all marketplace repos under a GitHub org
子代理模型受限時,會說明誰接手工作
你安排工作流程 agent(代理,能分頭處理工作的 AI 助手)、分叉的技能、斜線指令,或恢復背景代理時,可能替子代理指定某個模型;但組織政策若不准用它,原本很容易以為事情根本沒跑。現在 Claude 會跳出警告:子代理想要的模型受限,改由父代理模型執行。它沒有憑空換成別的任務,只是換了可用的腦袋。像劇團原定的演員臨時不能上台,舞台經理會明說由誰代演,觀眾不必對著陌生面孔猜半天。
官方原文
Added a warning when workflow agents, forked skills, slash commands, or resumed background agents' requested subagent model is restricted and the parent model runs instead
雲端工作做到一半,可帶回本機接著做
在雲端 session(工作階段,一次連續的對話與工作紀錄)裡做到一半,想回自己電腦處理檔案時,畫面現在會提示 /teleport。照提示輸入 claude --teleport <session id>,就能在本機繼續那個工作階段;<session id> 要換成畫面給你的識別碼。這不是複製一份新對話,而是把同一段工作從雲端接到眼前。像把做到一半的拼圖從客廳桌搬到書房桌,仍接著拼同一幅圖。
官方原文
Added a /teleport hint in cloud sessions showing how to continue locally with claude --teleport <session id>
長對話的自動壓縮,會更嚴守模型容量
工作階段越堆越長時,會啟用自動壓縮(auto-compaction,把前段內容濃縮以騰出空間)。它現在會更早守住模型的 context window(上下文視窗,模型一次能記住的內容容量)。CLAUDE_CODE_DISABLE_1M_CONTEXT 已改成:所有原生支援 1M 視窗的 Claude 模型都會透過壓縮維持在 200K,並在沒守住時於啟動時警告。遇到不認得的模型 ID,也會假定一個容量並在超限前壓縮,不再任它長過頭。若你要恢復後一項的舊行為,請在啟動 Claude 的環境變數加入 CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1。像行李箱裝滿前先整理衣物,而不是等拉鍊裂開才發現放不下。
官方原文
Changed CLAUDE_CODE_DISABLE_1M_CONTEXT to hold every Claude model with a native 1M window to 200K via auto-compaction, not just a fixed list; a startup warning now appears when auto-compaction isn't holding the session to 200K
Changed auto-compact to keep sessions on unrecognized model IDs within the assumed context window instead of letting them grow past it; set CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1 to restore the previous behavior
程式碼審查指令統一,也會記住你上次要多仔細
準備送出改動或 PR(pull request,請人檢查並合併程式改動的請求)前,/review 現在就是 /code-review 的另一個名字。輸入 /code-review 可檢查目前 diff(差異,尚未合併的程式改動)或 PR;要指定深度可用 /code-review <level> <pr#>,例如 /code-review ultra 要求深入的雲端審查。第二次審查若不填 level,會沿用你上次選的程度;想改成 high,就輸入 /code-review high。像同一個洗衣店有兩個入口招牌,現在都通往同一張櫃台,店員還記得你上回選的是快洗還是精洗。
官方原文
Changed /review to be an alias of /code-review, which reviews the current diff or a PR (/code-review <level> <pr#>); use /code-review ultra for a deep cloud review
Changed /code-review with no effort level to reuse the level you typed last; type a level like /code-review high to change it
修正 5 項
權限檢查不再被藏起來的指令騙過
按下核准前,權限對話框現在會更可靠地露出命令全貌。有人若在 Bash 指令裡做手腳,用 tab 或看不見的 Unicode 字元遮住一段內容,檢查不再會漏看;工作流程 script 也不能靠動態 import() 從 workflow sandbox(工作流程沙盒,限制程式活動範圍的隔離區)外執行程式。另一個缺口也補上了:代理定義裡略過權限的 bypassPermissions 模式不得違反組織政策。這像工廠品管驗貨,不只看箱面標籤,還會拆開包材查隱藏內容;流水線只能在劃定工作區操作,公司訂下免檢禁令後,也不能被某張作業單推翻。
官方原文
Fixed a Bash permission bypass where a crafted command could hide parts of itself from permission checks
Fixed permission prompts so commands padded with tabs or invisible Unicode can no longer hide part of the command from the approval dialog
Fixed workflow scripts being able to use dynamic import() to run code outside the workflow sandbox
Fixed a permission gap where an agent definition's bypassPermissions mode ignored the org bypass-permissions disable policy
中斷後回來的工作階段,較不會卡死或空白
你在對話中用過 /cd 換資料夾,之後再恢復 session(工作階段,一次連續的對話與工作紀錄),不會莫名回到空白位置。分叉的背景 agent 若在恢復時重建父提示詞失敗,也不會整場對話都被鎖成「already resuming」;歷史裡壞掉的 diagnostics attachment(診斷附件,記錄除錯資訊的附檔)則不再害每一回合失敗或讓互動程式停在沒反應的錯誤畫面。這像接力賽交棒時有三個容易掉棒的關卡:換跑道、找回前一棒的說明、檢查破損的紀錄;現在其中一關出錯,不會讓整隊永遠停在原地。
官方原文
Fixed resuming a session after a mid-session /cd coming back empty
Fixed forked background agents getting stuck "already resuming" for the rest of the session when rebuilding the fork's parent prompt failed during resume
Fixed a resumed session failing every turn, or leaving the interactive app on an unresponsive error screen, when its history held a malformed diagnostics attachment
不同來源標記的 Claude 模型,不再認錯名字
透過 gateway(閘道,替不同 AI 服務轉接請求的入口)找模型時,名稱前面帶供應商標記的 Claude 以前可能直接消失。例如 vertex_ai/claude-* 與 bedrock/anthropic.claude-* 現在都能被發現。同時,modelOverrides 裡不是 Anthropic 模型 ID 的鍵,不會再被誤當成這個 session 的正式模型 ID;文件說未知鍵應忽略,現在照做。像同名乘客在車票前多印了旅行社名稱:查票員會認出人,卻不會把旅行社名稱誤寫進護照欄位。
官方原文
Fixed gateway model discovery hiding Claude models registered under provider-prefixed IDs such as vertex_ai/claude-* or bedrock/anthropic.claude-*
Fixed modelOverrides keys that aren't Anthropic model IDs being treated as the session's canonical model ID; unknown keys are now ignored as documented
管理端與本機的環境變數,現在會合併保留
公司從伺服器發下 managed settings(受管設定,由管理者統一控制的設定)時,本機 managed-settings.json 或 MDM 裝置管理設定檔裡的 env 區塊以前可能整個失效。現在管理端的環境變數會按鍵名合併,本機設定不會因為收到另一份設定就被整段蓋掉。兩份名單都寫了不同開關時會並列保留。像總公司寄來新的值班表,不再把分店牆上原有、沒有衝突的聯絡電話全數撕掉。
官方原文
Fixed managed settings: server-delivered settings no longer disable the env block of a machine-local managed-settings.json or MDM profile; admin env now merges per key
Linux 沙盒與罕見 Git 輸出,不再讓指令卡住
在 Linux 把工作資料夾列入 sandbox.filesystem.denyWrite(沙盒禁止寫入的路徑清單)後,沙盒指令以前可能連啟動都失敗,現在能正常啟動。另一個少見但惱人的停滯也修掉了:解析某些不尋常的 git push 輸出時,不再偶爾掛住。像倉庫的輸送線:標示禁止封箱的貨仍可上線運送;遇到格式罕見的出貨單,站員也能繼續處理,不會讓整條線停住。禁止寫入照舊,指令與 Git 則能把工作做完。
官方原文
Fixed sandboxed commands failing to start on Linux when sandbox.filesystem.denyWrite covers the working directory
Fixed a rare hang when parsing unusual git push output