Claude Code 2.1.259
新功能 9 項
企業統一派發 MCP 外部工具,管理設定檔損毀時拒絕啟動
企業管理者能透過 managedMcpServers 設定,統一派發 HTTP 或 SSE 的 MCP(Model Context Protocol,讓 AI 連接外部工具的協定)伺服器,格式同 .mcp.json 並略過本機指令:
``` { "managedMcpServers": { "company-docs": {"url": "https://mcp.internal.example.com/sse", "type": "sse"} } } ```
allowedMcpServers 改為僅管制使用者新增的伺服器;升級後若要封鎖 managed-mcp.json 伺服器,需改用 deniedMcpServers。若管理設定檔、drop-in 檔案、MDM plist 或 HKLM 值解析失敗,Claude Code 會拒絕啟動並指名來源。由 MDM 或管理設定檔設定的 policy helper 執行後,forceRemoteSettingsRefresh 強制重整也修復生效。⟦這好比總務處配發公用設備,清單破損缺頁警衛就在大門攔下核對,絕不含糊放行。⟧
官方原文
Added managedMcpServers managed setting: organizations can provide HTTP/SSE MCP servers to every user (same entry shape as .mcp.json); entries that name a command to run are skipped
Fixed managed forceRemoteSettingsRefresh being ignored at startup when a policy helper configured by MDM or the managed settings file had already run
Fixed managed settings silently going unenforced when the managed-settings file, a drop-in, the MDM plist, or the HKLM value cannot be parsed: Claude Code now refuses to start and names the source
Changed allowedMcpServers to govern only servers users add: a literal managed-mcp.json server your allowlist used to filter out now loads on upgrade; use deniedMcpServers to keep it off
無人主機新增授權旗標,需確認操作自動拒絕不卡死
⟦無人值守的自動收發室遇到需要本人親簽的掛號信時,會依規定直接退回拒收,其餘免簽包裹則正常放行,絕不讓窗口卡死乾等。⟧針對無人看管的無頭模式(headless,沒有終端機視窗的執行模式)伺服器,你可以透過完整指令執行:
``` claude --permission-prompts none ```
這項新旗標專門處理無人主機的自動化流程。只要遇到任何需要跳出對話框請求確認的操作,系統都會自動予以拒絕,而當前生效的權限模式(包含自動模式)則會持續在背後自主決策。當你在伺服器排程或 CI 流程中跑工作階段時,再也不用擔心某個未授權的操作讓整個流程無限期停擺。
官方原文
Added --permission-prompts none for unattended headless hosts: anything that would prompt is denied automatically while the active permission mode (including auto mode) keeps deciding
GitLab 合併請求即時標記,終端機狀態列徽章同步更新
當你在 GitLab 專案中透過命令列工具管理合併請求時,終端機現在能原生識別 glab mr create、merge、close、reopen、note 與 update 等操作。只要執行這些指令,摺疊的工具摘要就會以 MR !N 的格式清楚標記合併請求編號,並同步重新整理顯示在終端機最底下的狀態列徽章。這讓你在命令列追蹤程式碼審查與合併進度時,不必反覆切換瀏覽器頁面確認。⟦這就像快遞追蹤器升級了專用條碼辨識,一刷到特定貨號就印出專屬標籤,並即時更新在收件單最底部的狀態欄位。⟧
官方原文
Added recognition of glab mr create/merge/close/reopen/note/update so GitLab merge requests show as MR !N in the collapsed tool summary and refresh the footer MR badge
GitLab 專案誤用 GitHub 安裝指令時,主動指引替代文件
在 GitLab 儲存庫內執行 /install-github-app 指令時,終端機不會再默默發送無效請求或顯示不明錯誤。系統現在會主動向你說明該指令僅限 GitHub 專案使用,並直接附上 GitLab CI/CD 官方文件連結指引你如何設定自動化流程。這讓跨平台開發的團隊在摸索指令時,能第一時間獲得正確的替代方案與設定說明。⟦這好比在捷運售票機前詢問高鐵時刻表,系統會明確提醒此處僅販售捷運票券,並主動列出前往高鐵轉乘網頁的指引地圖。⟧
官方原文
Improved /install-github-app to explain it is GitHub-only and point to the GitLab CI/CD docs when run inside a GitLab repository
遠端遙控確實中止背景代理,工作流程結果彩色排版
在遠端遙控的工作階段中按下停止時,背景代理與工作流程現在會確實終止,已被中斷的任務在行程完全結束前會維持可見且允許再次停止;在前次中斷尚未結束前恢復工作流程,也不會再意外跑出重複的代理。當暫停中的遠端或排程工作階段核准了連接器工具的授權請求後,系統會正確接續運作。檢視 /workflows 的代理詳細資訊時,JSON 結果會以語法上色與換行整齊美化,過長內容亦會收合在展開按鈕後;巢狀背景子代理的成果也會保存於母代理紀錄中。⟦控制中心調度自動化車隊時,按下緊急煞車便能確實停下車輛且儀表持續監控,重新出發不會誤發兩輛相同班車,行車紀錄也用彩色列印整齊歸檔。⟧
官方原文
Fixed Stop not actually stopping background agents and workflows in remote-control sessions: killed tasks now stay visible and re-stoppable until their processes exit
Fixed resuming a workflow run while its previous stopped run was still exiting, which could run duplicate copies of its agents
Improved /workflows agent detail: JSON outcomes are pretty-printed with syntax colors and real line breaks, and long outcomes fold behind an expand toggle
Improved nested background subagent results to be saved in the parent subagent's transcript, so resumed subagents keep them and shared transcripts show the delivery
Fixed remote and scheduled sessions doing nothing after a connector-tool permission prompt was approved while the session was paused
MCP 伺服器離線即時報錯,連線就緒後啟動加速五十毫秒
啟動時若有 MCP(Model Context Protocol,讓 AI 連接外部工具的協定)伺服器在列出工具清單的過程中斷線,系統現在會明確回報錯誤訊息,不再顯示為已連線卻有零個工具。在 claude.ai 遠端工作階段中,若瀏覽器端託管的伺服器分頁已關閉,系統也不會再讓你在每輪對話開頭枯等 60 秒。同時,在無頭模式(headless,沒有終端機視窗的執行模式)與 SDK 工作階段啟動時,只要工具伺服器連線完畢,第一輪對話最多能提早 50 毫秒開始執行。⟦點餐系統連線外送廚房時,廚房若斷線會立刻通報故障而非顯示零道菜,離線分店也不會拖累點餐進度,連線就緒後出單速度更提升了 50 毫秒。⟧
官方原文
Fixed MCP servers that disconnect while their tools are being listed at startup showing as connected with no tools instead of reporting the error
Fixed remote (claude.ai) sessions taking 60 seconds to start a turn after a browser-hosted MCP server's page had gone away
Improved headless/SDK session start: the first turn begins up to 50 ms sooner when MCP servers finish connecting
全螢幕長對話不留白,終端機畫面量測重複利用加速渲染
⟦演講廳的大型投影幕升級了文字排版引擎,不管內容多長或窗格如何縮放,畫面都不會突然留白,最新字幕與修改細節都能完整映出。⟧當你在全螢幕模式下進行呼叫數百次工具的長篇對話時,畫面不會再發生顯示空白對話的異常;終端機在調整視窗大小或初次渲染長回覆時,也會重複利用文字量測數據以提升流暢度。執行 Shell 指令時的即時預覽,不再因為前段文字自動換行而遮蔽最新輸出的幾行。此外,檔案編輯授權對話框過去偶爾會在無任何提示下截斷變更內容的問題,現在也已修復並完整顯示變更行。
官方原文
Fixed fullscreen mode showing a blank conversation after a long turn with hundreds of tool calls
Fixed the live output preview of a running shell command hiding its newest lines when an earlier line wrapped
Fixed the file edit permission dialog sometimes showing a changed line cut short with no indication
Improved terminal resize and first-render performance for long responses by reusing text measurements
外掛檢驗支援結構化報告,補齊雲端指標遺漏的使用者屬性
在擴充套件與監控整合方面,執行 claude plugin validate --json 現在可產出供程式解析的結構化檢驗報告。在安裝擴充套件時,帶有結尾斜線或尾隨 ? 與 # 的 GitHub 市集網址,現在也能正確解析出可用的 .git 複製位址。從舊版本接續下來的工作階段發布 Artifact 產物時,不會再因「unexpected parameter note」錯誤而失敗一次。此外,雲端工作階段發出的 OpenTelemetry 指標與事件,也已補回過去遺漏的 user.email、organization.id 與 user.account_uuid 三項識別屬性。⟦這就像品管檢驗站引進了結構化資料匯出功能,無論貨物標籤帶有尾隨雜訊還是系統接續舊單,都能精準解析並附上完整的客戶與組織識別資訊。⟧
官方原文
Added --json to claude plugin validate for a machine-readable validation report
Fixed Artifact publishing failing once with an "unexpected parameter note" error in conversations continued from an older version
Fixed OpenTelemetry metrics and events from cloud sessions missing the user.email, organization.id, and user.account_uuid attributes
Fixed marketplace repo URLs on github.com with a trailing slash or dangling ?/# producing an unusable .git clone URL
[VSCode] 側邊欄新增快捷篩選,工作階段按狀態精準分類
⟦在收件匣頂端新增快捷分類標籤後,只要點選處理中或待回覆就能立刻過濾郵件,不必在落落長的清單中逐筆翻找。⟧VS Code 擴充套件的側邊欄工作階段(session,對話工作階段)清單迎來了篩選功能升級。側邊欄新增了 Active 快捷過濾按鈕,能快速篩出進行中的項目;同時加入了狀態篩選選單,提供等待使用者輸入的 Needs input、執行中的 Working 以及已完成的 Completed 等分類選項。這讓你在同時管理多個任務時,能迅速定位需要立即處理的對話。
官方原文
[VSCode] Added an Active quick filter and a status filter menu (Needs input, Working, Completed) to the session list sidebar
修正 6 項
Bash 讀取拒絕規則全面收緊,防堵隱藏檔案路徑漏洞
⟦大樓安檢門升級了深層透視,無論違禁品藏在夾層暗袋、寫在包裹參數裡,還是混在大箱貨物中整批搬運,警衛都能確實攔截並要求逐項檢查。⟧過去 Bash 的 Read() 檔案讀取拒絕規則存在安全漏洞。如果把敏感檔案放在參數值(例如 --ignore-revs-file=.env、-f.env 或 @file)、作為 git diff 與 git grep 的檔案操作對象,或是組裝成 cd DIR && cat FILE 複合指令,系統曾會漏抓;現在這些途徑全數納入攔截範圍。此外,當你對含有被拒檔案的資料夾執行 grep -r 或 cp -r 時,系統現在也會主動跳出授權詢問。
官方原文
Fixed Bash Read() deny rules not covering files given as option values (--ignore-revs-file=.env, -f.env, @file), git diff/git grep file operands, or cd DIR && cat FILE compounds; grep -r/cp -r over a directory holding a denied file now asks
自訂掛鉤建立工作樹時,相容非標準 Git 探測回傳訊息
在啟用工作樹(worktree,Git 讓同一專案平行開多份副本的功能)隔離環境時,由自動化流程建立的平行工作區現在相容性更佳。若你的專案透過掛鉤(hook,特定事件發生時被觸發的小程式)自動新增工作樹,過去在部分作業環境中,當底層 git rev-parse 探測指令回傳了「not a git repository」以外的自訂錯誤訊息時,系統會誤判而拒絕載入;現在這項異常判斷已修正,確保平行工作區能順暢運作。⟦這如同實驗室的隔離操作箱,只要安全閥是由合格管線自動帶起,即使檢驗儀表回傳了罕見的代碼,門禁系統也不會把合法的操作台鎖死在門外。⟧
官方原文
Fixed worktree isolation refusing hook-created worktrees on machines where git rev-parse fails with a message other than "not a git repository"
工作樹隔離放寬管線指令,未觸及主目錄操作不再遭拒
⟦這好比保稅倉庫裡理貨,只要貨物確認不會越界流入海關外的主倉庫,內部無論怎麼分裝、繞路搬運,都不會被拉起警報攔下。⟧在工作樹(worktree,Git 讓同一專案平行開多份副本的功能)隔離環境下執行命令時,檢查限制獲得了合理放寬。以往在隔離工作階段中執行常見的 Bash 迴圈、xargs 管線指令,或是透過啟動器包裝的命令時,系統容易過度防衛而直接拒絕執行;現在只要確認這些指令無法碰觸到主儲存庫目錄,系統便會允許正常執行,不再阻礙日常的批次自動化處理。
官方原文
Fixed worktree-isolated sessions refusing common Bash loops, xargs pipelines and launcher-wrapped commands that cannot reach the main checkout
多工作階段並行不覆蓋設定,重啟對話與專案辨識更穩定
同時開啟多個工作階段(session,對話工作階段)時,各視窗不再於背景悄悄還原彼此對全域設定檔 ~/.claude.json 的修改,工作區信任、MCP 與專案狀態再也不會因為並行運作而遺失。此外,若已儲存的紀錄中含有缺少酬載的附件資料,以前執行 --resume 會失敗且執行 --continue 會開啟空白對話,現在皆能順利接續;儲存庫辨識機制不再因短暫的 Git 探測失敗而丟失身分;claude.ai 使用者的背景 GitHub 連線檢查結果也會跨次啟動妥善記住。⟦這好比多位助理共用同一個公事包,每個人寫入自己的進度時不再覆蓋別人的紀錄,即便翻到空白便條或遇到網路瞬斷,也能迅速認出專案並接續辦公。⟧
官方原文
Fixed concurrent sessions silently reverting each other's ~/.claude.json changes — workspace trust no longer resets and MCP/project state is no longer lost when running many sessions at once
Fixed --resume failing (and --continue opening an empty conversation) when a saved session contains an attachment entry with no payload
Fixed repository detection dropping a known repo identity after a transient git probe failure
Fixed a background GitHub connection check that ran on every launch for claude.ai users; the result is now remembered across launches
自訂指令支援指定模型,Vertex 代碼正確套用長度上限
你在自訂指令與技能檔頭指定的 model: 設定,在互動式工作階段中現在會如實生效。在自動模式下若遇到不支援的模型,系統則會穩定保留當前工作階段的模型繼續執行,避免任務意外中斷。此外,針對帶有 @YYYYMMDD 日期後綴的 Vertex 格式模型代碼,即便屬於系統尚未內建識別的模型版本,環境變數 CLAUDE_CODE_MAX_CONTEXT_TOKENS 所設定的 token(AI 處理與計費的文字單位)上限如今也能正確生效。⟦這就像專業派工系統指派技師,手動點名特定專長時必定指派專人,遇到不支援的工法時則維持原班人馬,且對每位專家的工作備忘錄長度都嚴格設限。⟧
官方原文
Fixed auto mode running a turn on a model it doesn't support when a command or skill's frontmatter model: named one; the turn now keeps the session model
Fixed CLAUDE_CODE_MAX_CONTEXT_TOKENS being ignored for Vertex-style model IDs (@YYYYMMDD suffix) of model versions Claude Code doesn't recognize
Fixed frontmatter model: on custom commands and skills being ignored in interactive sessions
思考歷程不再重複被拒,提示快取遇權杖更新妥善留存
⟦考場草稿紙在更換識別證或被監考官暫停時,考生先前的推導算式與記憶紀錄依然完整保留,不會在下一題全部被迫重算。⟧在對話過程中若模型的思考歷程曾遭拒絕一次,後續輪次不會再陷入重複被拒的窘境。在關閉遙測的工作階段中,更新 OAuth 授權令牌時,也不會意外清除提示詞快取(cache,把算過的結果暫存起來直接用)。此外,觸發阻擋型 Stop 掛鉤(hook,特定事件發生時被觸發的小程式)後,下一輪對話依然能完整保留上一輪的思考推導脈絡,避免在特定模型上發生快取未命中而重複計算的情況。
官方原文
Fixed a conversation whose thinking was rejected once being rejected again on every later turn
Fixed the prompt cache being invalidated when the OAuth token refreshed in sessions with telemetry disabled
Fixed blocking Stop hooks causing the turn after a block to lose the model's reasoning from that turn and, on some models, miss the prompt cache