usage

Claude Code 2.1.246

工具與目錄
在這頁

新功能 7 項

01

自動模式新增權限分頁,長對話安全審查放寬時限

⟦這就像工廠的自動化安全檢驗台,管理員能在控制面板直接調整檢驗標準,而且遇到大批貨物進站時,輸送帶會自動延長檢查時間,不再因為排隊太長就直接退件。⟧ 你現在能更輕鬆查看並調整自動模式(auto mode,讓 Claude 不逐一詢問就自主執行的模式)的運作邊界了。在終端機輸入 /permissions,即可切換至新增的 Auto mode 分頁,直接檢視與編輯分類器的判定規則。同時,在處理內容極長的大型工作階段(session)時,工具呼叫不再動輒遭到拒絕。系統以前會將超長對話判定為暫時無法使用;現在安全審查的逾時時限會隨提示詞長度動態調整。

官方原文

Added an Auto mode tab to /permissions for viewing and editing auto mode classifier rules

Fixed auto mode tool calls being denied as "temporarily unavailable" on very large sessions by scaling the safety-check deadline with prompt size

02

Bash 放行規則防範萬用字元漏洞,加速快照函式執行

撰寫 Bash 指令的自動放行規則時,安全性與防護機制有了更嚴謹的把關。若你在規則中的子指令前方加上萬用字元(例如 Bash(git * main)),啟動時會跳出警告,提醒該規則可能會意外放行插入在子指令前的其他參數。若指令語法不完整且末尾懸空帶有 && 或 || 運算子,權限檢查一律會強制要求手動確認,不再放行未完成的指令。此外,在 bash 環境下執行 Bash 工具時,重放快照函式不再為每個函式額外啟動 base64 子 shell,大幅降低指令執行的等待延遲。⟦這宛如大樓警衛室加強了訪客名冊的核對,不但會提醒有漏洞的登記格式並擋下寫一半的通行條,還簡化了例行公務的蓋章流程。⟧

官方原文

Added a startup warning for Bash allow rules with a wildcard before the subcommand (e.g. Bash(git * main)), since they also match options inserted before the subcommand

Fixed Bash permission checks to always require approval for malformed commands with a dangling && or || operator

Improved Bash tool latency on bash shells by replaying snapshot functions without a base64 subshell per function

03

工作流保護已完成子代理,/goal 閒置最多確認三次

⟦這好比專案主管指派多位助理分頭調查,不僅不會因為誤按返回鍵就把已經交卷的助理叫回來重做,還會在助理工時用盡時清楚標記未完進度,並限制主管在閒置時最多只能敲門關心 3 次。⟧ 動態工作流與子代理的控制變得更加聰明。在工作流進行中按下向左鍵或執行 /background 時,系統不再直接重啟已完成的子代理,而是會先詢問並清楚列出有多少個子代理會被重啟。當子代理達到 maxTurns 回合上限時,回傳的結果會明確標示為部分完成,並附上透過 SendMessage 繼續執行的提示。而在 /goal 任務閒置期間,針對長程背景工作最多只會發起 3 次進度確認,待你送出下一則訊息後才會再允許 3 次。

官方原文

Fixed pressing ← or running /background during a dynamic workflow restarting its finished subagents; it now asks first and says how many subagents would restart

Improved subagent results: a subagent that stops at its maxTurns limit now returns its output marked as partial, with a hint to continue it via SendMessage, instead of appearing finished

/goal: Changed idle sessions to start at most three check-ins on long-running background work per goal; your next message allows three more

04

回合標記完成時間點,截斷超長單行 diff 防畫面卡死

長時間觀看終端機的對話進度與輸出結果,畫面呈現更清楚且不再卡頓。每回合結束的耗時提示行現在會明確標記完成的時間點(例如 ✻ Sautéed for 23s · done 6:05 PM)。當程式碼 diff 差異中包含極長的單行文字(例如 base64 編碼字串)時,系統會自動截斷並加上標記,防止畫面嚴重卡死。訊息排版也獲得修復,不再因為前 500 個字元沒有格式標記就誤把整則訊息的 Markdown 渲染關閉,並完整支援 + 與 N) 符號清單及底線標題。若指令執行到一半被中途切斷,狀態列會如實呈現中斷標示,不再顯示彷彿正常跑完的訊息。⟦如同烹飪計時器在煮好時蓋上完成時間章,遇到超長菜單時適度摺疊摘要,並在烤箱提前斷電時清楚亮起未完紅燈。⟧

官方原文

Added the turn's completion time to the end-of-turn duration line, e.g. ✻ Sautéed for 23s · done 6:05 PM

Fixed a severe transcript slowdown when a diff contained a very long single line (e.g. a base64 string); such lines now render truncated with a marker

Fixed markdown rendering being disabled for a whole message when its first 500 characters contained no markdown, and for +/N) lists and setext headings

Fixed a command interrupted mid-run showing as "Ran 1 shell command" with no sign it was cut

05

/cd 即時載入新目錄元件,維持分叉歷史與計畫模式

在同一個對話中切換工作目錄,相關設定與模式銜接更加完整。使用 /cd 切換至新目錄後,該專案的專案設定、掛鉤(hook,特定事件發生時被觸發的小程式)、需確認授權的 .mcp.json 伺服器、技能與代理等元件,現在會立刻生效,不再需要透過 --resume 重新載入。針對已經分叉或背景化的工作階段(session),輸入 /fork 派生新對話時不會再出現空無一物的空白歷史。此外,若先前是在計畫模式結束對話,在 VS Code 擴充套件或使用 claude -p --continue 接續執行且未指定權限模式時,系統能正確維持原有的計畫模式。⟦這好比帶著文件走進新會議室時所有周邊設備即刻連線,從舊會議分流討論不會遺失議程記錄,暫停的企劃也能按部就班繼續推展。⟧

官方原文

Fixed /fork from an already-forked or backgrounded session starting the new session with an empty conversation

Fixed sessions that ended in plan mode resuming outside plan mode in the VS Code extension, and in claude -p --continue/--resume with a permission prompt tool, when no permission mode was set

Improved /cd: the new directory's project settings, hooks, .mcp.json servers (behind the usual approval prompt), skills, and agents now take effect right after the move instead of on --resume

06

短期 JWT 自動更新快取,支援多平台自主程式碼審查

企業環境透過自訂指令取得短效憑證時,驗證流程更加順暢。若透過 apiKeyHelper 取得短期的 JWT 授權令牌(token,用來驗證身分的授權令牌),在閒置過期後送出第一則訊息時,系統會在發送前自動更新快取,並在遭遇 401 或 403 驗證錯誤時於背景自動重試,不再彈出錯誤畫面。工作負載身分同盟、啟動期間以及登入過期後的用量數據,現在也能更精準歸屬至所屬組織。此外,在 Bedrock、Vertex AI、Foundry、Claude 應用程式閘道或停用非必要流量的環境下,Claude 現在也能自主發起 /code-review 進行程式碼審查。⟦就像門禁感應卡在過期時由閘門後台自動感應續卡,出入紀錄精準歸入所屬部門,值班警衛也能在特定權限下自主啟動安全巡檢。⟧

官方原文

Fixed a visible API error on the first prompt after idle when apiKeyHelper returns short-lived JWTs: an expired cached token is now refreshed before sending, and 401/403 auth errors retry quietly

Improved attribution of usage telemetry to your organization for workload identity federation sessions, events sent while apiKeyHelper runs at startup, and after a login token expired while idle

Changed /code-review so Claude can also start it on its own on Bedrock, Vertex AI, and Foundry, through the Claude apps gateway, and when telemetry or non-essential traffic is disabled

07

雲端任務精準計數與隔離,非互動對話斷線自動續接

讓雲端環境或背景工作自動修復程式碼,多任務協同與斷線復原能力更上一層樓。從同一個專案的多個工作樹同時啟動 /ultrareview 或雲端工作階段(session)時,不再混入另一次啟動的未提交變更。背景雲端任務(例如 /autofix-pr)的進度計數不會再漏算任務數量。在遠端控制(Remote Control)中,自動產生的對話標題在第一則提示詞後就會立即更新至網頁版與 App。自託管執行器若收到格式錯誤的輪詢回應(例如中繼代理回傳的 HTML 頁面),會自動重試而非直接退出。而在非互動模式下若因伺服器錯誤或網路斷線導致輸出中斷,系統會自動接續生成。⟦這好比雲端流水線精準隔離各產線的未成品,即時更新進度看板與專案標籤,遇到線路不順時也會自動重連與續接。⟧

官方原文

Fixed /ultrareview runs and cloud sessions launched at the same time from one repository (e.g. from several worktrees) sometimes starting with another launch's uncommitted changes

Fixed the task progress count (e.g. 3/5) shown for background cloud sessions such as /autofix-pr occasionally missing a task

Fixed Remote Control sessions keeping their placeholder name in claude.ai and the Claude app until the second prompt; the auto-generated title now appears after the first prompt

Fixed the self-hosted runner ending its live sessions or exiting when a work-poll response is malformed (e.g. an intercepting proxy's HTML page); it now retries the poll

Improved non-interactive sessions (-p, SDK, cloud sessions) to automatically continue a response cut off mid-stream by a server error, connection loss, or stall instead of ending with an error

修正 11 項

08

背景工作階段開機更穩健,解決睡眠與安裝衝突

⟦這就像派出去出差的後勤專車,即使出發點剛好拆遷、駕駛打了個瞌睡或車庫正在換零件,發車系統也能耐心等待而不是在 45 秒後直接報廢。⟧ 背景工作階段(session)在各種極端環境下的啟動穩定度大幅提升。以往當啟動目錄被刪除、電腦進入睡眠或主機啟動程序較慢時,背景任務常在 45 秒後開啟失敗;現在已能妥善處理這些延遲。當另一個執行個體剛好在重新安裝 npm 套件時,也不會再因權限衝突拋出 EACCES 錯誤而無法啟動。在 Windows 等系統上,若你在工作行程剛開機時立刻於 claude agents 點開,任務不會再因重新生成途中被誤判停止。

官方原文

Fixed background sessions failing to open after 45 seconds when Claude Code's starting directory had been deleted, the machine had slept, or the host is slow to start processes

Fixed background sessions failing to open with "Couldn't start the background service … EACCES" when another Claude Code process was re-installing the npm package at that moment

Fixed opening a just-started session in claude agents while its worker was still booting (common on Windows) stopping it with "was stopped while the respawn was in flight"

09

重複背景工作自動編號,清理機制不誤刪自訂工作樹

在終端機同時管理多個背景任務,清單顯示與檔案清理現在更加井然有序。使用 claude agents 查看清單時,若將同一個命名對話再次轉入背景,清單不再重複列出兩筆相同名稱,而是會為新列自動加上流水號(例如 my-session (2))。背景清理機制也不會再誤刪你自己手動建立在 .claude/worktrees/ 底下的工作樹(worktree,Git 讓同一專案平行開多份副本的功能)。此外,在 Windows 與 macOS 環境下,無頭模式(headless,沒有終端機視覺介面的執行模式)會主動清理異常結束時殘留在 ~/.claude/sessions 的過期紀錄。⟦這好比倉庫管理員妥善替重複進倉的貨物貼上編號,清理雜物時絕不碰員工自備的儲物箱,並在下班時掃淨廢棄的單據。⟧

官方原文

Fixed claude agents listing a backgrounded named session twice; backgrounding the same conversation again now numbers the new row (e.g. my-session (2))

Fixed the background retention sweep removing git worktrees under .claude/worktrees/ that you created yourself when an old background-session record pointed at them

Windows/macOS: Fixed headless sessions not cleaning up stale entries in ~/.claude/sessions left by sessions that exited uncleanly

10

MCP 工具明確回傳中斷錯誤,修正空架構參數型別

透過 MCP(Model Context Protocol,讓 AI 連接外部工具的協定)擴充功能時,工具呼叫與授權判定更加準確。在無頭模式或遠端工作階段中,若工具呼叫被新訊息中斷,系統會回傳明確的中斷錯誤,不再誤報為「已完成但無輸出」。當工具參數的結構定義為空物件 {} 時,傳遞的引數會維持其真實型別,不再強制轉為 JSON 字串。使用 --strict-mcp-config 啟動時,不會再針對根本不會載入的 .mcp.json 伺服器跳出核准確認,避免背景任務卡在啟動階段。此外,針對標記為 requiresUserInteraction 的互動式工具,授權提示不再提供「一律放行且不再詢問」的無效選項。⟦如同外接設備通訊協定修正了中斷信號與參數格式,並過濾掉用不到的配對請求。⟧

官方原文

Fixed MCP tool calls interrupted by an incoming message in headless/remote sessions being reported to the model as "completed with no output" instead of an explicit interrupted error

Fixed MCP tool arguments being sent as JSON strings when the parameter's schema is empty ({}), instead of their real type

Fixed --strict-mcp-config sessions prompting to approve .mcp.json servers they would never load, which left background sessions waiting at startup

Fixed MCP tools marked requiresUserInteraction still offering "Yes, and don't ask again" in their permission prompt; the option wrote an allow rule the tool then ignored

11

全螢幕捲動縮放不再白屏,大幅減輕逐字稿記憶體負擔

⟦這如同翻閱長篇歷史檔案時換上一款輕便的電子閱讀器,不論縮放視窗或回翻舊章節都不再跳頁白屏,滑鼠點回視窗也不會誤觸內頁按鈕,且翻到幾千頁後記憶體依舊輕巧。⟧ 終端機全螢幕模式與逐字稿檢視的體驗大幅改善。在全螢幕下調整視窗大小時,畫面不會再變成一片空白或強制跳到底部卡住。當你捲動到較早的歷史訊息時,捲動操作與跳至底部的動作更加順暢,不再停留在半途。當你點擊終端機視窗使其重獲焦點時,鍵盤焦點不會再被游標下方的控制元件搶走。此外,在全螢幕與 Ctrl+O 檢視長對話時,每個訊息列不再複製全域工具查找表,徹底解決記憶體隨工作階段(session)膨脹的問題。

官方原文

Fixed fullscreen mode showing a blank transcript after resizing the terminal and jumping to the bottom until the next keypress

Fixed erratic fullscreen scrolling when positioned at an earlier message, including jump-to-bottom getting stuck mid-transcript

Fixed fullscreen mode moving keyboard focus onto the control under the pointer when you clicked the terminal window only to bring it back into focus

Fixed memory growing with session length in the fullscreen and Ctrl+O transcript views: each rendered message row no longer retains a full copy of the transcript-wide tool lookups

12

註解提示詞不誤判指令,優化檔案挑選與空字元補全

⟦這就像輸入法選字框,在打錯拼音時會自動收起候選字,在遇到特殊符號註解時不會誤當成系統指令,讀取含有特殊字元的資料夾時也能順暢提示完整路徑。⟧ 終端機在接收提示詞與處理檔案路徑時變得更穩定。當你輸入以 /-- 開頭的文字(例如 Lean 語言的說明文件註解)時,系統會正常將內容發送給 Claude,不再誤判定為未知的斜線指令。使用 @ 挑選檔案時,若輸入的文字已經無法匹配任何現有路徑,檔案挑選器選單會自動關閉。此外,當補全字詞或當前工作目錄中包含空字元(null byte)時,路徑自動補全功能也不會再發生錯誤而失效。

官方原文

Fixed prompts beginning with /-- (e.g. Lean doc comments) being rejected as an unknown slash command instead of being sent to Claude

Fixed the @ file picker staying open after the typed text stopped matching a real path

Fixed path completion failing when the completion token or working directory contained a null byte

13

對話重新命名保留主題框色,自訂 diff 顏色與按鍵容錯

想為終端機換上個人專屬色彩與快捷鍵,視覺效果與設定容錯現在更加可靠。使用 /rename 為對話命名時,提示詞外框會保留當前主題的設定色彩(包含自訂主題的 promptBorder),不再強制被覆蓋成預設的青色。自訂主題中的 diffAdded、diffRemoved 及其淡化色彩設定,現在也能如實呈現在程式碼比對與 /theme 預覽畫面中。此外,若在 keybindings.json 設定檔中綁定了未知的動作名稱,系統會主動跳過該項錯誤設定以保留鍵盤按鍵原本的預設功能,並在 --debug 模式下記錄除錯警告,不再無聲讓該按鍵失效。⟦如同室內裝修更換門牌時不會洗掉牆壁油漆,自選色卡能精準上色,即使裝錯一個無效開關也不會導致全屋線路斷電。⟧

官方原文

Fixed /rename replacing the theme's prompt border color (including a custom theme's promptBorder) with the default cyan; the border now keeps your theme's color unless you pick one with /color

Fixed custom theme diff colors (diffAdded/diffRemoved and their dimmed variants) being ignored in diffs and the /theme preview

Fixed a keybindings.json binding with an unknown action name silently deadening that key; it is now skipped so the default binding keeps working, and a warning is logged under --debug

14

狀態列進出代理不歸零,/stats 熱圖校正東半球時區

⟦這有如精準的里程表與工作日誌,離開儀表板查看其他分頁後累積里程數不會突然歸零,跨時區記錄打卡數據時每週的格子也都能精確對齊。⟧ 終端機的統計數據與用量追蹤修復了多處顯示偏差。當你在主對話與代理檢視畫面之間切換移動時,狀態列(status line,終端機最底下那行即時資訊)記錄的累計費用與執行耗時不會再意外歸零。在台灣與日本等東半球時區使用 /stats 查看活動熱圖時,各天的使用次數不再發生向後偏移一格(將週日的次數錯放在週一底下)的時區計算錯誤,讓每日工作量真實呈現。

官方原文

Fixed /stats activity heatmap showing each day's activity one cell off (Sunday's count under Monday) in timezones east of UTC

Fixed the status line's cost and duration resetting to zero after navigating to the agents view and back

15

外掛支援簡稱更新與 BOM 檔頭,防止快取目錄重複

⟦這有如軟體應用程式商店強化了安裝包與快取機制,就算用簡稱更新、設定檔夾帶特殊編碼檔頭或市集清單損毀,都能給予清楚指引並避免重複佔用硬碟空間。⟧ 外掛 plugin 的安裝、更新與快取(把算過或查過的結果暫存起來直接用)管理修正了多處異常。執行 claude plugin update 時,現在可以直接傳入簡短的套件純名稱,不再強制要求完整命名空間。當外掛的 plugin.json 包含 UTF-8 BOM 檔頭時不再導致安裝失敗。若市集清單檔案 known_marketplaces.json 空白或損毀,執行安裝指令會明確回報錯誤,不再無聲退出或卡死。此外,外掛快取不會再為同一個外掛建立多個重複的 SHA 資料夾;同步自 claude.ai 的外掛在遙測中也能正確標記真實市集與管理員安裝來源。

官方原文

Fixed the plugin cache creating duplicate SHA-named directories for the same plugin

Fixed claude plugin update failing for an installed plugin given its bare name (only the fully-qualified name worked)

Fixed plugin installation failing when plugin.json was saved with a UTF-8 byte-order mark (BOM)

Fixed claude plugin install <name> exiting silently (or hanging in a terminal) instead of reporting an error when ~/.claude/plugins/known_marketplaces.json is empty or corrupted

Changed OpenTelemetry plugin events for plugins synced from claude.ai: plugin_id_hash now reflects the plugin's real marketplace, and enabled_via is admin-install for admin-installed plugins

16

外掛選單去除重複前綴,掛鉤錯誤解析完整本機路徑

開發或載入外掛技能與掛鉤(hook,特定事件發生時被觸發的小程式)時,名稱顯示與路徑解析更加精確。如果外掛技能在定義中已帶有 <plugin>: 前綴,斜線選單不會再出現重複的前綴字樣(例如 /plugin:plugin:skill)。針對採用 skills/*/SKILL.md 目錄結構的外掛,輸入 /reload-plugins 重新載入時能正確讀取所有技能,不再誤報為 0 個技能。此外,當掛鉤執行發生錯誤時,錯誤訊息會顯示解析後的完整本機路徑,不再印出未替換的原始文字 ${CLAUDE_PLUGIN_ROOT}。⟦宛如電話通訊錄修復了重複冠上國碼的錯誤,能夠精確辨識各子分機目錄並在故障時標明確切的房間分機號碼。⟧

官方原文

Fixed plugin skills whose frontmatter name already includes the <plugin>: prefix showing it doubled in the slash menu (e.g. /plugin:plugin:skill)

Fixed /reload-plugins reporting 0 skills for plugins that define skills under skills/*/SKILL.md

Fixed hook error messages showing a literal ${CLAUDE_PLUGIN_ROOT} instead of the resolved plugin path

17

第三方端點容錯工具區塊,遙測金鑰嚴格隔離主機

⟦這好比海關檢查站妥善區分各國護照與通行證,不僅能包容格式略有出入的第三方證明,而且屬於特殊口岸的私人通關憑證絕不會誤寄回總部信箱。⟧ 串接第三方相容 API 閘道時,穩定度與憑證安全性獲得全面提升。當自訂端點(ANTHROPIC_BASE_URL)串流傳回沒有 id 欄位的工具呼叫區塊時,介面不會再拋出渲染錯誤而中止。接續先前的歷史對話時,若紀錄中包含第三方代理伺服器寫入的特殊工具區塊,也不會再導致每次對話都觸發 400 錯誤。更重要的是,系統向 Anthropic 發送遙測與指標請求時,不再夾帶設定給第三方閘道的 API 金鑰,各主機的金鑰只會發送至各自對應的伺服器。

官方原文

Fixed the UI stopping with a render error on the first tool call when a third-party Anthropic-compatible endpoint (ANTHROPIC_BASE_URL) streams a tool_use block without an id

Fixed resumed sessions failing every turn with a 400 when the saved history contains tool blocks the Anthropic API does not accept (typically written by a third-party API proxy)

Fixed telemetry and metrics requests to Anthropic carrying the API key configured for a third-party gateway (ANTHROPIC_BASE_URL); a credential is now only sent to its own host

18

Write 工具覆寫大檔不卡頓,受管設定安裝同意遞延

覆寫超大型既有檔案或在沙盒執行指令,底層處理與安裝管理變得更穩定。使用 Write 工具覆寫龐大檔案後,即使寫入成功,以往常會長時間卡死或誤報記憶體不足,現在已能流暢返回。沙盒在等待「沙盒外網路請求」權限確認時,會正常觸發 Notification 掛鉤(hook,特定事件發生時被觸發的小程式)。指令沙盒的檔案系統設定能確實遵循 --setting-sources 參數。此外,企業受管設定用戶透過 curl 腳本安裝時不再報出 Raw mode 錯誤,執行 claude install 與 claude update 也會將受管設定同意提示遞延至下一次互動工作階段,不再中途打斷指令。⟦這有如文字編輯器能輕快儲存巨幅圖表,在安全防護區等待外網連線時敲響提示鈴,依指定來源劃定檔案存取邊界,透過管線直送安裝時不再因終端模式報錯,並將受管條款留到首次開機時再確認。⟧

官方原文

Fixed the Write tool reporting "Out of memory" or freezing for a long time after overwriting a very large existing file, even though the file had been written

Fixed the Notification hook not firing while the sandbox "Network request outside of sandbox" permission prompt is waiting

Fixed the command sandbox's filesystem configuration not respecting --setting-sources

Fixed curl -fsSL https://claude.ai/install.sh | bash failing with "Raw mode is not supported" for some Team/Enterprise users with server-managed settings

Changed claude install and claude update to defer a pending managed-settings consent prompt to the next interactive session instead of prompting mid-command