usage

Claude Code 2.1.273

工具與目錄
在這頁

新功能 12 項

01

閘道請求標頭登場,企業流量分流更精準

要讓企業閘道分辨每次模型呼叫的用途,現在可以讓請求自己帶上提示線索。⟦這好比在包裹外箱貼上分類標籤與配送備註,分檢站不用拆開箱子,光看外盒條碼就能將急件與大宗貨物分流處理。⟧Claude Code 現在支援在發送請求時附帶五組提示標頭,包含請求類別、代理類型、前次工具耗時、上下文壓縮狀態以及是否已完成壓縮,方便後端閘道進行流量分析與路由分配。若要在發送請求時啟用這組標頭,只需設定 CLAUDE_CODE_GATEWAY_HINT_HEADERS=1。當你在內部網路透過自建閘道控管模型呼叫時,這項設定能協助企業系統精確掌握每次呼叫的用途與狀態。

官方原文

Added x-claude-code-request-class, x-claude-code-agent-type, x-claude-code-prev-tool-durations, x-claude-code-compaction and x-claude-code-context-compacted request headers for LLM gateways; opt in with CLAUDE_CODE_GATEWAY_HINT_HEADERS=1

02

遠端操控支援分支,背景建立獨立工作階段

想在手機上測試另一種修改方向,現在能直接建立對話分支。⟦這如同在主線道路旁開闢一條獨立便道,車流可以隨時分流探索新路線,原車道的行駛完全不受影響。⟧透過 claude --remote-control 或 /remote-control 啟動遠端操控後,你可以直接在 Claude 應用程式中按下分支,電腦便會在背景自動開啟一個獨立的工作階段繼續執行。當你在外面用手機遠端除錯時,這正是保留當前進度並平行嘗試新解法的好時機。

官方原文

Added forking a session started with claude --remote-control or /remote-control from the Claude app; the fork runs as a background session on your computer

03

外部工具斷線主動通知,登入過期提示指令

對話進行到一半,外部工具突然斷線,你現在不會被蒙在鼓裡。使用 MCP(Model Context Protocol,讓 AI 連接外部工具的協定)時,若工具伺服器在對話中途斷線且自動重連放棄,終端機會主動跳出通知並提示執行 /mcp 指令檢查。同時,若 MCP 伺服器的登入憑證在工作階段中途過期,錯誤訊息也會清楚說明如何重新驗證。⟦這宛如辦公室的外接螢幕訊號線脫落,系統不會假裝正常運作,而是立刻跳出警示並提示你檢查連接埠。⟧

官方原文

Added a notification when an MCP server disconnects mid-session and automatic reconnection gives up, pointing at /mcp

Improved the error shown when an MCP server's sign-in expires mid-session to say how to re-authenticate (/mcp)

04

雲端平台自動模式預設本機分類,切換開關同步備妥

在雲端託管平台上執行自動模式,現在反應更直接。於 Bedrock、Vertex AI 與 Foundry 平台上,自動模式(auto mode,讓 Claude 自行判斷執行步驟的模式)目前改為預設採用本機分類器來辨識指令。若企業需要改用雲端平台端提供的伺服器端分類器,可以設定 CLAUDE_CODE_AUTO_MODE_SERVER=1。⟦這好似在工廠門口由本機感測器即時過濾零件,省去每次都將數據傳回遠端總部伺服器判斷的往返時間。⟧

官方原文

Changed auto mode on Bedrock, Vertex and Foundry to use the local classifier by default for now; set CLAUDE_CODE_AUTO_MODE_SERVER=1 to use the platform's server-side classifier

05

遙測指標補齊工具名稱,問題回報過濾隱私資料

查效能、登入外掛、回報問題三件事,這版把該留下與該遮掉的資料分清楚。開啟 OTEL_LOG_TOOL_DETAILS=1 記錄效能時,成本與 token(AI 處理與計費的文字單位)指標會更加完整。記錄中現在會一併標記代理、技能、外掛與 MCP(讓 AI 連接外部工具的協定)伺服器的真實名稱。以 Claude 帳號登入時,系統會一併請求存取你的 claude.ai 外掛功能。執行 /bug 與 /feedback 回報問題時,回報內容僅保留最後一次 API 請求的模型名稱、系統提示詞與工具清單等行為參數,自動排除請求中繼資料與 CLAUDE_CODE_EXTRA_BODY 欄位。⟦這套過濾機制就像填寫保固問卷時,系統自動幫你塗黑機密資料,只把故障代碼送回原廠。⟧

官方原文

Changed OTEL_LOG_TOOL_DETAILS=1 to also include real agent, skill, plugin and MCP server names on cost and token metrics

Changed sign-in with a Claude account to also request access to your claude.ai plugins

Changed /bug and /feedback reports to include only model-behavior params (model, system prompt, tools) from the last API request, omitting request metadata and CLAUDE_CODE_EXTRA_BODY fields

06

子代理狀態完整回傳,長對話排程運作更順暢

背景子代理跑到一半時,最重要的是結果別消失、排程別跑錯地方。⟦如同工廠產線上的子輸送帶,即使個別工件移到後方包裝區,整體的進度回報與清單交接依然條理分明。⟧串流回覆若缺少 token(AI 處理與計費的文字單位)用量或模型編號,子代理與背景代理不會再被判定為失敗而遺失結果。透過 SDK 或 --output-format stream-json 輸出時,即使子代理中途移至背景執行,後續訊息與最終報告也不會被丟棄。/tui 重啟時不會再因已結束的代理團隊成員而卡住。複製 .claude/scheduled_tasks.json 至新工作樹(worktree,Git 平行開多份副本的功能)時,排程任務不會在錯誤的工作階段執行。長時間對話中掛鉤進度與子代理更新也不再重新處理整段紀錄。

官方原文

Fixed sub-agents and background agents being reported as failed, with their result never delivered, when the final streamed reply omitted token usage or carried no model id

Fixed SDK and --output-format stream-json output dropping a subagent's remaining messages and final report after it is moved to the background mid-run (e.g. by CLAUDE_AUTO_BACKGROUND_TASKS)

Fixed /tui refusing to restart because of an agent-team teammate that had already finished its work and was no longer shown in the agents panel

Fixed saved scheduled tasks running in the wrong session after .claude/scheduled_tasks.json was copied into another folder, such as a new worktree

Improved responsiveness in long sessions: hook progress and sub-agent activity no longer re-process the whole conversation on every update

07

Artifacts 發布連線自動重送,資料庫支援單欄更新

Artifact 發布、頁面讀取與資料庫更新這幾條路,這版都減少了卡住後重做的機會。⟦這好比在雲端協作白板上貼便利貼,修改時只要撕掉特定欄位的小標籤,而不必整張白板擦掉重畫。⟧在雲端或遠端操控工作階段中,自動模式上傳對話附件時,Artifact 工具不會再無故暫停等待核准。更新資料庫時可單獨刪除單一欄位而無需重寫整份文件;發布請求若在抵達伺服器後斷線,系統會安全重送,避免發布失敗或產生重複版本。遇到不支援的檔案類型時,終端機會顯示簡潔單行提示並告知 Claude 支援的格式;讀取頁面時會清楚說明該頁面的資料庫規則與權限,且操作後不再誤跳外掛提示。

官方原文

Fixed auto mode stopping for approval when the Artifact tool uploads a file you attached to the chat in a cloud or Remote Control session

Fixed a false-positive spinner tip suggesting the frontend-design plugin after reading or publishing Artifacts

Improved the Artifact tool's error when a publish includes a file type artifacts don't serve: Claude is told which types are served and what to do instead, and the terminal shows one plain line

Improved the Artifact tool's page read to state the capabilities and database rules the artifact service holds for the page, for anyone who can publish to it

Improved artifact database writes: an update can now remove a single field instead of rewriting the whole document

Improved artifact publishing: a publish whose connection drops after reaching claude.ai is now re-sent safely instead of failing or creating a duplicate version

08

雲端閘道授權錯誤指引具體,憑證與代理診斷更清晰

遇到雲端平台與網路連線異常時,診斷訊息現在會指出具體原因。在 Bedrock、Vertex AI 與 Foundry 遇到 401/403,或 Claude 應用程式閘道遇到 403 時,訊息不再盲目要求執行 /login,而是明確點出需要重新整理哪一組憑證,或指引你聯絡閘道管理員。當雲端工作階段因登入過期或被撤銷而無法建立時,提示會正確引導執行 /login 登入。工作階段內的 SSL 憑證與代理伺服器連線錯誤,現在會列出錯誤代碼與修復方式,例如針對未受信任的企業憑證提示設定 NODE_EXTRA_CA_CERTS。⟦整體體驗好比公司大樓感應門禁卡失效時,螢幕清楚顯示是卡片消磁還是需要找管理員授權,而不是盲目叫所有人重新排隊抽號碼牌。⟧

官方原文

Fixed 401/403 errors on Bedrock, Vertex and Foundry, and Claude apps gateway 403s, telling you to run /login; the message now names the credential to refresh or points to your gateway administrator

Improved the error when a cloud session can't be created because your Claude login expired or was revoked: it now tells you to run /login

Improved the in-session SSL certificate and proxy connection errors to name the error code and what to fix, such as NODE_EXTRA_CA_CERTS for an untrusted corporate CA

09

GitHub 流程錯誤精準定位,拉取請求診斷更明確

只看到泛用錯誤碼的 GitHub 流程,最容易把你卡在登入、SAML 或 Webhook 問題外面。執行 /install-github-app 時,遇到 SAML 單一登入阻擋不會再被誤報為缺少管理員權限;雲端工作階段遇到 IP 白名單、應用程式停用或 SAML 限制時,會直接顯示具體成因。執行 /autofix-pr 時,若 gh pr view 失敗會呈現 GitHub 工具原生的登入或限流錯誤,Webhook 派送失敗也會具體說明原因。執行 /web-setup 遇到 GitHub token(授權令牌)被拒時會列出可能原因與解法,連線失敗也會明確指出代理伺服器或憑證問題。⟦這樣的診斷回報如同包裹在海關受阻時,查驗單上明確勾選是缺少身分切結書還是通關名額已滿,讓你一眼看懂該補哪份文件。⟧

官方原文

Fixed /install-github-app reporting a SAML single sign-on block as "admin permissions required"

Improved the cloud-session GitHub error for an IP allow list, a suspended app installation or SAML single sign-on to show the cause instead of a generic install hint

Improved /autofix-pr: when gh pr view fails it now shows gh's own error (sign-in, SAML, rate limit) instead of a generic exit-code line

Improved /autofix-pr to say why GitHub webhook delivery couldn't be set up for the PR (for example, no linked GitHub account) instead of a generic warning

Improved /web-setup errors: a refused GitHub token now lists the likely reasons and the fix, and a connection failure names a configured proxy or TLS certificate problem

10

VS Code 隱藏停用回饋,Windows 異常橫幅消除

VS Code 回饋入口該隱藏就隱藏,Windows 回合結束也不該冒出假錯誤。若企業組織已設定停用產品回饋,VS Code 介面中的「回報問題」選項以及 /bug 與 /feedback 指令都不會再開啟回報表單。在 Windows 平台下,每輪對話執行完成後,畫面頂端不會再無故彈出顯示錯誤碼 4294967295 的紅色行程結束橫幅。此外,透過 --add-dir 加入掛載的網路磁碟機時,系統也強化了通用命名規則(UNC)路徑的網路權限檢查。⟦整體表現好比在儀表板上隱藏停用的意見回饋箱,工作完成後安靜回到待命狀態,不再無故亮起刺眼的紅色故障警示燈。⟧

官方原文

[VSCode] Fixed "Report a problem" still appearing, and /bug / /feedback opening a report form, for organizations that have product feedback disabled

[VSCode] Fixed a red "Claude Code process exited with code 4294967295" banner appearing after completed turns on Windows

Windows: Improved the network-path permission check for UNC paths when a mapped network drive was added with --add-dir

11

網頁版排程管理更新,未儲存變更彈窗確認

例行排程頁面現在會先問清楚,才丟掉你輸入的名稱、提示詞與修改內容。⟦這好比在線上行事曆建立定期排程,離開編輯視窗時會主動提醒你確認是否捨棄草稿,並將手動執行按鈕與歷史紀錄整齊排列在同一個看板上。⟧管理員移除並重新加入組織連接器後,例行排程(routine)不會再失去連線權限或錯誤呼叫舊有的連接器。在新增例行排程頁面或編輯對話框中,若已輸入名稱、提示詞或修改內容,關閉前會跳出確認視窗詢問是否捨棄未儲存的變更。詳情頁面也重新規劃:導覽路徑支援選單與重新命名,頂部整合開關與立即執行按鈕,設定旁則並排顯示歷次執行紀錄。

官方原文

[Claude Code on the web] Fixed routines losing access to an organization connector, and still calling the old one, after an admin removed and re-added that connector

[Claude Code on the web] Added a "Discard unsaved changes?" confirmation before the New routine page or the Edit routine dialog throws away a routine name, prompt or edit you typed

[Claude Code on the web] Improved the routine detail page: menu and rename in the breadcrumb, the on/off switch and Run now at the top, and run history beside the routine's settings

12

網頁版環境建立更穩定,直接導向設定流程

新使用者進網頁版前,環境建立、隱私設定與初次引導都少走彎路。從組織設定建立自託管環境時,修復了伺服器錯誤導致殘留未完成環境的問題。管理員的「分享雲端工作階段」設定位置調整至「資料與隱私」分頁下方,方便資料與隱私管理員直接進行設定與控管。在 Mac 與 Windows 平台上尚未配置雲端環境的新使用者,進入網頁版時不再強制顯示滿版桌面應用程式下載畫面,而是直接引導進入設定流程。⟦新流程如同新進員工報到時跳過繁瑣的宣傳摺頁直接走進辦公室,管理員也能在隱私控制台統一管理所有對外連線的分享設定。⟧

官方原文

[Claude Code on the web] Fixed creating a self-hosted environment from organization settings occasionally failing with a server error and leaving a half-created environment behind

[Claude Code on the web] Changed the admin "Share cloud sessions" setting to live under Data and privacy instead of the Claude Code page, where Data and privacy admins can also manage it

[Claude Code on the web] Removed the full-page desktop-app download screen that new users without a cloud environment saw on Mac and Windows; they now go straight to setup

修正 7 項

13

停用技能移至回收區,企業管理規則優先套用

公司關掉技能或下發管理規則後,Claude Code 不該繼續沿用舊權限。企業在 claude.ai 關閉技能功能後,先前已同步的技能不會繼續留在對話中,而是直接移至可復原的垃圾桶。此外,透過行動裝置管理(MDM)或 managed-settings.json 設定的 allowManagedMcpServersOnly、deniedMcpServers 與 disableClaudeAiConnectors 規則,即使遇到伺服器端管理的設定並存,也不會再被忽略,確保資安控管如實生效。⟦整套權限收回機制好比公司收回特定軟體的使用權限時,電腦會立刻將程式移入資源回收筒,且總部管理規範永遠優先於個別部門的自訂設定。⟧

官方原文

Fixed skills synced from claude.ai staying available after your organization turns Skills off; they now move to the recoverable trash

Fixed allowManagedMcpServersOnly, deniedMcpServers and disableClaudeAiConnectors set via MDM or managed-settings.json being ignored when server-managed settings are also present

14

安全邊界防護補強,指令詢問與路徑存取更嚴格

看不懂的 Bash 指令、工作目錄外的記憶路徑與 macOS 檔案路徑,這版各自回到正確的權限處理。⟦這好比在園區出入口嚴格核對訪客證件,不管對方換穿哪種外套或走側門捷徑,都必須確認具有通行權限才予以放行。⟧啟用 permissions.blockReadsOutsideWorkingDirectories 時,檢查器無法完整分析的 Bash 指令不再跳過確認提示,同時修復了子殼層在旁路模式下隱藏危險 rm 指令的漏洞;專案設定指定的記憶目錄若位於工作目錄外,也不再載入提示詞、檢索、建立索引或用於記憶擷取。macOS 上拖入截圖或具有次要路徑的檔案,不再因符號連結(symlink,指向另一個位置的捷徑檔)解析問題而被拒絕讀取。先前針對無法分析指令的過度阻擋已還原,例如 time -p make build 恢復跳出詢問提示。

官方原文

Fixed Bash commands the permission checker cannot fully analyze skipping the prompt under permissions.blockReadsOutsideWorkingDirectories, and a subshell hiding a dangerous rm in bypass mode

Fixed permissions.blockReadsOutsideWorkingDirectories: a memory directory chosen by a repository's settings is no longer loaded into the prompt, recalled, indexed, or used by memory extraction

Fixed Read on macOS refusing a dragged-in screenshot, or any file the system reports under a second path, with "symlink resolution changed after permission was checked"

Reverted a 2.1.268 change that checked Read and Edit deny rules on Bash lines the permission checker can't analyze (eval, env -C); commands like time -p make build prompt again instead of being denied

15

思考歷程精準保留,上下文用量計算不超標

長對話裡,思考歷程與上下文用量都需要被精準保存。執行 /login、/upgrade 或 /extra-usage 時,系統不會再丟棄對話中先前的思考歷程,避免下次請求被迫全面重新寫入提示詞快取(cache,把算過的結果暫存起來直接用)。上下文計量器與自動壓縮不再將諮詢工具對話誤算為兩倍大小,解決了壓縮功能在視窗過半時就過早觸發的問題。遠端操控客戶端連線至 Claude Desktop、VS Code 或 JetBrains 工作階段時,查詢上下文用量不會再遭拒絕。壓縮狀態列上的旋轉圖示也不再出現重複的刪節號。⟦這種保護機制宛如隨身筆記本的頁數計量器,精確計算每一筆摘要的厚度,翻頁時也不會因為臨時查驗證件就把前面的草稿整頁撕掉。⟧

官方原文

Fixed /login, /upgrade, and /extra-usage discarding earlier thinking from the conversation, which forced a full prompt-cache rewrite on the next request

Fixed the context meter and auto-compact counting advisor-tool turns at roughly twice their real context size, which made auto-compact fire at about half the real window

Fixed Remote Control clients attached to a Claude Desktop, VS Code or JetBrains session being refused when they ask for the session's context window usage

Fixed the spinner showing a doubled ellipsis ("……") on compaction status lines such as "Running PreCompact hooks…"

16

Shell 模式驚嘆號正常輸入,版本庫排除檔不再殘留

你在 Shell 模式下想打 ! grep …,句首那個驚嘆號卻憑空消失——這個問題修好了。切換至 Shell 模式後,主提示列不會再吃掉句首輸入的 ! 驚嘆號符號,讓你能夠順利輸入包含否定邏輯的命令。另一個修好的是:在長時間運作的工作階段中,若專案版本庫的 .git 目錄已被刪除或移走,Claude Code 不會再無故於原地重新建立多餘的 .git/info/exclude 存根檔案。⟦兩個修復像同一個過度熱心的助理終於學乖:你寫的便條不會被他擦掉一個字,你搬走的資料夾也不會被他默默放回原位。⟧

官方原文

Fixed a long-running session recreating a stub .git/info/exclude after the repository's .git directory was removed or moved away

Fixed the main prompt dropping a ! typed at the start while already in shell mode, so negated commands like ! grep … can be typed

17

Slack 智慧監看公開頻道,討論串對話與記憶管理修復

Slack 裡的 Claude Tag 若沉默、重開任務或漏列記憶,團隊很難信任它接手協作。⟦如同團隊中敏銳的專案助理,主動關注突發狀況通報群組,並在個別討論串中專注跟進,絕不會因為旁人插話就打亂手邊剛寫好的草稿。⟧Claude 現在會主動監看與對話相依的公開頻道(例如重大事件頻道),無需手動呼叫;在舊討論串回覆時,也不會再導致正在進行的任務重新啟動而遺失未推送的工作進度。組織共用私密頻道中的排程任務能持續在原討論串中穩定運作。Enterprise Grid 斷線但其中一個工作區仍連線時,重新安裝應用程式後不再在幾分鐘內無故靜音,新增頻道管理員也支援 Enterprise Grid 共用頻道、尚未使用過 Claude 的頻道與歷史私密頻道。管理員記憶頁面現在會列出 Claude 自行建立的頻道記憶,方便管理員隨時檢視、編輯與刪除。

官方原文

[Claude Tag] Fixed Claude going silent minutes after reinstalling the app when an Enterprise Grid was disconnected but one of its workspaces stayed connected

[Claude Tag] Fixed scheduled tasks set up in an organization-shared private Slack channel silently never posting; they now keep running in the thread they were created in

[Claude Tag] Fixed replying in an older Slack thread while Claude is mid-task sometimes restarting it from scratch and losing work it had not pushed yet

[Claude Tag] Fixed adding a channel manager being refused on Enterprise Grid shared channels, on channels where Claude hasn't been used yet, and on legacy private channels

[Claude Tag] Changed Claude to start watching related public channels on its own, such as an incident channel a conversation depends on, instead of only when asked

[Claude Tag] Fixed the admin Memory page not listing Slack channels Claude set up on its own even when they had saved memory; admins can now open, edit and delete that memory

18

雲端服務連線強化,AWS 與身分驗證修復

帳號剛完成授權更新、AWS 端點沒有區域、第三方回傳小寫授權類型時,連線不該因此斷在半路。帳號 token(授權令牌)更新後,系統不會再誤跳找不到環境的通知而遺失訊息。AWS 連線全面支援 Budgets、Savings Plans、WAF Classic 與 Import/Export 等無需指定區域的端點,Global Accelerator 請求也能正確完成簽章;若連線因主機名稱未指定區域等原因無法完成簽章,系統會清楚說明成因與修復指引。OAuth 與 JWT 連線在第三方回傳小寫令牌類型時,請求現在會統一以標準格式發送。⟦此連線機制宛如跨國通訊轉接台,能正確辨識各式標準通訊協定,換發通行識別證時也不會漏掉手邊正在傳遞的電報。⟧

官方原文

[Claude Tag] Fixed Claude occasionally dropping a message with an incorrect "couldn't find a Claude Code environment" notice right after your account token refreshed

[Claude Tag] Fixed AWS connections refusing region-less endpoints such as Budgets, Savings Plans, WAF Classic and Import/Export; Global Accelerator requests now sign correctly

[Claude Tag] Improved AWS connection failures: when a request can't be signed, such as a hostname with no region, Claude is told why and how to fix it instead of a bare error

[Claude Tag] Fixed OAuth client-credentials and JWT-bearer connections failing with providers that return a lowercase token type; requests now send the standard Bearer scheme

19

程式碼審查更精準,相依性說明與留言機制修復

程式碼審查最怕小變更被重審一整輪,或留言重試後重複/漏發。⟦這好比資深審稿員在複審文件時,只專注核對新修訂的段落,並在批註中完整交代上下游影響,不會因為作者大小寫書寫習慣不同就整本退回重審。⟧將基礎分支合併至先前帶有「其他發現」的拉取請求時,系統會改跑輕量級的後續審查而非全量重審;擁有者或儲存庫名稱包含大寫字母的儲存庫遇到空推送或相同內容時也會自動略過。REVIEW.md 不會再因 @-mention、跨行程式碼或反引號 HTML 標籤而整份被忽略,只會扣下連到已變更檔案的行。修改建議現在會主動指明相依程式碼需維持運作的行為,受影響次要位置的留言改以完整句子呈現。執行 /ultrareview --post 重試時能確保留言恰好發布一次並標明提交版本。

官方原文

[Code Review] Fixed merging the base branch into a PR whose earlier review listed "Additional findings" triggering a full re-review; these pushes now get the lighter follow-up review

[Code Review] Fixed a whole REVIEW.md being ignored because of an @-mention, a code span wrapped across lines, or a backticked HTML tag; only lines linking to changed files are withheld

[Code Review] Improved suggested fixes to say what the fix must keep working when other code depends on the behavior being changed

[Code Review] Improved review comments that point to a second affected location to state that location's issue in a full sentence instead of a cut-off stub

[Code Review] Fixed /ultrareview --post so a retry after a GitHub error posts the findings comment exactly once instead of never or twice; the comment now names the reviewed commit

[Code Review] Fixed empty or content-identical pushes being re-reviewed on GitHub repositories whose owner or name contains a capital letter; these pushes are now skipped