usage

Claude Code 2.1.301

工具與目錄
在這頁

新功能 6 項

01

無人值守重試模式支援自訂額度等待上限

當你放著 Claude 在背景通宵跑大量任務時,最怕半夜遇到額度限制而卡住空轉。以前開啟無人值守重試模式(CLAUDE_CODE_RETRY_WATCHDOG,遇到錯誤時自動重試的背景守護機制)後,只要撞上額度上限,即使重設時間遠在好幾個小時後,程式也會一直停在那裡乾等。現在新增了環境變數 CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS,只要重設等待時間超出你設定的毫秒上限,就會果斷結束該次請求。⟦像排隊等候叫號,要是櫃檯告示牌寫著下一梯次得等好幾個小時,就先收隊離開而不是傻站在大門口枯等過夜。⟧

官方原文

Added CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS so unattended retry mode (CLAUDE_CODE_RETRY_WATCHDOG) ends a request at a usage limit that resets too far away instead of waiting

02

Vim 模式支援括號跳躍與按鍵狀態切換

習慣在終端機用快捷鍵飛速跳轉程式碼的 Vim 族群,這版操作手感更貼近原生編輯器。Vim 模式新增了 % 移動指令,能跳到配對括號,也能搭配 d、c、y 執行刪除、修改或複製。以前在負載沉重的機器上按 Esc 鍵,有時會卡在 INSERT(插入模式,打字輸入內文的狀態)而無法切換。回答提問輸入框時,自由文字欄位現在支援 NORMAL(一般模式,用來執行移動與指令的瀏覽狀態)。按 Esc 只會先退回一般模式,只有在一般模式下再按 Esc 才會取消,不會直接抹掉你辛苦打好的回答。⟦跟操作傳統手排檔桿一樣,以前離合器踩下偶爾卡在空檔,現在跳檔定位精準俐落,退檔時也不會誤把轉速歸零。⟧

官方原文

Added the % motion to vim mode: jump to the matching bracket, alone or with d/c/y

Fixed vim mode sometimes staying in INSERT after Escape on a slow or busy machine

Fixed Esc discarding a typed AskUserQuestion answer in vim mode: the free-text field now supports vim NORMAL mode, and Esc cancels only from NORMAL

03

OpenTelemetry 追蹤指引與工具決策事件屬性擴充

想在企業儀表板掌握 Claude 呼叫工具的原因,觀測日誌現在記錄得更詳盡。在 claude-api 技能中加入 OpenTelemetry(跨系統追蹤運作軌跡的開源標準)的設定指引,包含如何使用 ant 工具配置追蹤目的地。工具決策事件 tool_decision 新增 classifier_verdict 與 permission_mode 欄位,讓管理員分清自動模式(auto mode,讓 Claude 自主執行的模式)分類器的決策與既有權限規則。啟用 OTEL_LOG_TOOL_DETAILS=1 時,分類器阻擋操作的 tool_decision 事件還會以 classifier_category 記錄命中的內建規則名稱。⟦就像翻開檢驗報告,以前只標記陰陽性,現在能分清儀器判讀與人工複核,異常時還附上項目名稱。⟧

官方原文

Added OpenTelemetry tracing guidance to the claude-api skill, including setting up trace destinations with the ant CLI

Added classifier_verdict and permission_mode to OpenTelemetry tool_decision events, so auto mode classifier decisions can be told apart from permission rules

Added classifier_category to OpenTelemetry tool_decision events, naming the built-in rule a classifier block matched, when OTEL_LOG_TOOL_DETAILS=1

04

Mod 擴充模組支援多行輸入與狀態回傳規範

編寫 Mod(擴充 Claude 功能的模組)時,介面與流程控制更精準。Input 元件新增 rows 屬性,終端機能多行輸入,Enter 送出、Shift+Enter 或反斜線換行。修復在 claude -p 或雲端工作階段,首次回覆未完成就呼叫 $.model.fork 報錯 nothing-to-fork。提問樹狀清單在桌面端、行動端與 VS Code 支援 Markdown 且最多 48 行,終端機維持 12 行。掛鉤(hook,特定事件觸發的小程式)的 .catch 改為只在拋出例外或逾時時執行,內部呼叫產生的事件不再轉給自身。設定或取消設定環境變數的方法 $.env.set,完成操作時回傳 {};未執行寫入時,回傳附帶原因的 { deny }。

官方原文

Added rows to a mod's Input: a text field of several lines in the terminal, where Enter submits and Shift+Enter or a backslash before Enter starts a new line

Fixed a mod's $.model.fork returning nothing-to-fork when called before the first response of a new Claude Code process had finished, as in claude -p runs and cloud sessions

Improved mods: in VS Code and the desktop and mobile apps, a tree drawn above the question dialog can now hold Markdown and up to 48 rows; the terminal keeps 12 plain rows

Changed a mod hook's .catch handler to run only when the hook throws or times out; events raised beneath the hook's own calls now skip that hook without asking its .catch

Changed a mod's $.env.set to resolve with {} once the variable is set or unset, or with { deny } saying why when the write is not made

05

模型切換流程與長對話自動摘要優化

聊到一半想切換到上下文視窗較小的模型,長對話轉移現在處理得更順暢。上下文視窗是模型一次能讀取的最大文字量;若對話太長,會先請原模型精簡摘要,以前未經詢問就扣額度摘要的問題已修復。透過 Anthropic API 使用 fable 或 best 別名時,若組織尚未開放最新版 Fable,會自動退回前一版重試一次。非 Bedrock 的自訂模型名稱即便包含 application-inference-profile,也不會誤跑 awsAuthRefresh 耽擱掛鉤。透過閘道器連線時,伺服器回傳不同模型名稱,也不會再反覆用不是你選的模型壓縮對話。⟦猶如搭長途客運轉乘小型接駁車,以前未經同意就收費整理行李,現在先徵得同意,再由原班司機精簡包裹;轉運站也不會搞錯車號讓你反覆轉乘。⟧

官方原文

Fixed the fable (and best) model alias erroring on the Anthropic API when the newest Fable model is not available to your organization: Claude Code now retries once on the previous Fable model

Fixed switching to a model whose name contains application-inference-profile running your awsAuthRefresh command and delaying model-switch hooks when the provider is not Bedrock

Fixed a case where switching to a model with a smaller context window could spend usage credits on a summary by the previous model without asking first

Fixed conversations being compacted over and over, on a model you didn't pick, behind an LLM gateway whose responses name a different model than the one requested

Improved switching to a model with a smaller context window: a conversation too long for the new model is now summarized by the previous model first

06

工作階段對話壓縮、提示與子代理進度更新優化

進行長時間對話或派發子任務時,畫面不再因資料繁重而短暫凍結。在全螢幕模式下執行 /compact 或自動壓縮時,過去因重建可見對話紀錄會造成介面短暫卡頓,現在已修復。在長時間運作的子代理人(subagent,負責獨立執行特定子任務的代理人)工作時,進度歷程改為增量更新,不再每次渲染都整條重算。重新接續先前的工作階段時,壓縮提示列不再提供無法載入歷史紀錄的 Ctrl+O 捷徑,而是清楚說明先前訊息儲存在哪個路徑,且此提示在全螢幕下也能正常顯示。當你中途打斷回覆時,過去會立刻冒出建議輸入 /clear 清除對話省 token(AI 處理與計費的文字單位)的提示,現在不會再立刻跳出來干擾。⟦比方翻閱長篇連載小說,以前每翻一頁就重新把前幾章裝訂一次導致卡死,現在只順暢翻到最新一頁,換卷時也清楚標記上一冊收在何處。⟧

官方原文

Fixed the compaction row in a resumed session offering ctrl+o for history that is not loaded; it now says where the earlier messages are saved, and also shows in fullscreen

Fixed the "new task? /clear to save tokens" hint coming back right after you interrupt a response

Fullscreen mode: Fixed /compact and auto-compact briefly freezing the UI while the visible transcript is rebuilt

Improved rendering performance while a long-running subagent works: its progress trail now updates incrementally instead of being reprocessed in full on every render

修正 8 項

07

技能參數填入效能與外掛權限來源顯示修復

在專案中安裝大量自訂技能或外掛工具時,指令呼叫與權限確認現在更俐落透明。過去技能(擴充特定領域知識與指令的手冊)與命令若包含過多或過長的參數名稱,呼叫時會卡頓數秒。現在限制僅填入前 64 個名稱且每個最多 64 個字元。修復了技能、命令與掛鉤在填入大量佔位符時耗用大量記憶體的問題。修復 /rewind 回退對話後技能清單在模型中消失的問題,並更正了 /claude-api 技能誤稱 AWS 上 Claude 平台不支援 CMEK 外部金鑰端點的說明。外掛或技能掛鉤若觸發 ask 詢問決策,彈出的權限確認提示現在會明確標示該掛鉤來自哪一個外掛或技能。⟦類似翻閱零件庫存的規格清冊,以前填寫欄位太多會整疊卡在夾板上動彈不得,現在規格索引限制在精簡欄位內,調用工具時也清楚貼上所屬工具箱的產權標籤。⟧

官方原文

Fixed skills and commands with very many or very long argument names stalling for seconds when invoked; only the first 64 names, each up to 64 characters, are now filled in

Fixed skills, commands and hooks using very large amounts of memory when their arguments fill many placeholders

Fixed the /claude-api skill saying CMEK external-key endpoints aren't available on Claude Platform on AWS

Fixed skills no longer being listed to the model after using /rewind

Fixed the permission prompt for a plugin or skill hook's ask decision not showing which plugin or skill the hook comes from

08

帳號登入與憑證更新狀態修復

登入更新失敗時,錯誤提示更清楚;快速執行短指令後,也不會再因更新途中結束而意外登出。過去當硬碟空間被塞滿時,系統無法完成登入憑證更新,卻彈出讓人一頭霧水的「Please run /login」錯誤訊息。現在會具體指出是哪顆磁碟空間已滿,並明確提醒你刪除檔案釋放空間。當你執行 claude auth status 檢查認證或 claude plugin list 查詢外掛等耗時短暫的指令時,過去若指令在 token(驗證身分的授權令牌)更新途中結束,會引發更新逾時甚至意外登出。這種登入更新逾時與意外登出的問題已經修好。⟦正如到銀行櫃檯辦理印鑑更新,以前印泥乾掉卻謊稱印章作廢,快閃刷本子還會把帳戶直接凍結;現在印泥不夠會直接請你更換,查詢一下餘額也不再被誤踢出門。⟧

官方原文

Fixed a misleading "Please run /login" error when a full disk keeps the login from being refreshed; the error now names the disk and says to delete files

Fixed sign-in refresh timeouts and unexpected sign-outs after a short command such as claude auth status or claude plugin list exited in the middle of a token refresh

09

成品發布更新機制與行動版版面繪製修正

請 Claude 產出獨立網頁或文件成品(artifacts)時,更新內容與手機預覽現在都更穩定。在設定了攔截編輯或寫入的 PreToolUse 掛鉤環境下,過去更新成品時常會被直接拒絕。現在 Claude 會先正常編輯檔案再重新發布,而不是試圖在發布呼叫中直接修改檔案。在行動端應用程式中,Claude 產出的網頁以前捲動時文字會穿透到置頂標題上方。現在上方色帶會確實著色覆蓋,捲動內容不再穿幫破圖。⟦彷彿為展覽海報加裝固定展示框,以前更換內容非得當場塗改版面而遭警衛攔阻,現在先取下內頁修潤再重新入框,走動時頂部邊框也能確實遮擋後方紙張。⟧

官方原文

Fixed artifact updates being refused where a PreToolUse hook covers Edit or Write; Claude now edits the file and then republishes instead of changing it in the publish call

Improved artifacts: pages Claude writes now paint the band above a sticky header, so scrolled text no longer shows there in the mobile apps

10

檔案讀取、搜尋工具與 Git 操作修復

盤點專案原始碼或比對版本差異時,底層檢查工具的回報比以往更誠實安全。Grep 與 Glob 等搜尋工具過去在搜尋程式意外崩潰時,會回傳查無結果;現在會老實拋出錯誤告知搜尋失敗。Read 讀取工具不再將 .xlsm、.parquet、.epub 與 .heic 等二進位檔案誤當成純文字讀入。使用 WorktreeCreate 掛鉤建立的 Git 工作樹(worktree,讓同一專案平行開多份副本的功能),若裡面還有尚未推送的提交,退出 Claude Code 時不會再不問一聲就悄悄刪除。在採用 reftable 格式的 Git 存放庫中,若底層檢查逾時或失敗,/diff 指令不再漏掉發生衝突的揀選或復原操作。⟦如同替檔案室裝上嚴格的清點規範,儀器當機不再謊報查無資料,翻閱圖冊不再當成純文字硬讀,搬移未歸檔的文件箱離場時也必定當面確認。⟧

官方原文

Fixed quitting removing a worktree made by a WorktreeCreate hook without asking when it may hold unpushed commits

Fixed Grep and Glob reporting no matches when the search program failed unexpectedly before returning any results; they now return an error saying the search failed

Fixed the Read tool reading binary files such as .xlsm, .parquet, .epub and .heic as text

Fixed /diff not noticing a conflicted cherry-pick or revert in reftable repositories when one of its git checks timed out or failed

11

工作流程自動化與背景指令執行修復

安排多代理人或腳本排程自動處理專案時,背景步驟與權限控管更為穩定。工作流程代理人過去讀到任務說明未附帶使用者授權的框架備註後,有時會擅自略過自己的步驟卻仍回報執行成功,這個問題已經修復。在同一個工作階段中執行 Bash cd 切換目錄後,讀取、編輯或重跑工作流程腳本不再莫名彈出權限確認或直接被拒絕。工具呼叫若在權限檢查期間被回合中途傳入的訊息中斷,現在不會再向模型誤報為使用者拒絕。在 Windows 環境下,被終止的背景 PowerShell 命令輸出檔過去會漏掉結尾的 [killed] 標記,現在均已正常補上。⟦恰似工廠的自動化輸送帶,以前看到便箋誤以為沒有權限就偷跳步驟還回報良品,切換站別就拒絕作業;現在每個工序確實執行,中途停機也確實蓋上停止印戳。⟧

官方原文

Fixed workflow agents sometimes skipping their step, and the run still reporting success, after reading the harness note that their task text carries no user authority

Fixed a tool call cut off by a message sent mid-turn during its permission check being reported to the model as rejected by the user

Fixed workflow scripts asking for permission or being refused when read, edited or re-run after a Bash cd in the same session

Windows: Fixed stopped background PowerShell commands missing the closing [killed] line in their output file

12

終端機文字雜訊、表格排版與暗色色彩修正

開啟終端機執行指令時,螢幕畫面上的字元邊界與色彩層次變得更加乾淨易讀。在 RHEL 8 的 MATE 終端機等使用舊版 VTE(終端機模擬器核心元件,版本低於 0.53)的環境中,修復了 >0q 遮擋資料夾信任提示以及退出時出現 >4m 雜訊的問題。修復特定版本 iTerm2 啟動時提示字元前方出現殘留 GOK 字樣的問題。只有標題列的 Markdown 表格若寬度超出終端機,過去會完全無法顯示(包含出現在計畫核准卡片中的表格),現在均能正常繪製。在暗色 ANSI 主題與 16 色終端機下,填滿方框內的文字維持淡化,但在選取與搜尋醒目提示下不再淡化,清單說明文字也正確比照次要文字淡化處理。⟦就像老舊顯示螢幕完成校正,以前開機常跳出訊號雜訊、寬表格直接破圖消失,現在所有字樣清楚對齊,在暗色背景下也層次分明。⟧

官方原文

Fixed stray characters such as >0q covering the folder trust prompt, and >4m before the shell prompt at exit, in terminals built on VTE older than 0.53 such as MATE Terminal on RHEL 8

Fixed stray GOK text appearing in the prompt at startup in some versions of iTerm2

Fixed a Markdown table with only a header row drawing nothing when too wide for the terminal, including in plans on the plan approval card

Fixed dim text on the dark ANSI theme and 16-color terminals: faint inside filled boxes, not faint under selection and search highlights, and list descriptions dimmed like other secondary text

13

自架執行器工作階段重試與存放庫連結修復

串接團隊通訊軟體並使用自託管 Runner 時,工作階段的啟動與釋放更值得信賴。修復從 Slack 啟動的工作階段在受管設定限制 MCP(Model Context Protocol,讓 AI 連接外部工具的協定)伺服器時,無法找到或掛載存放庫的問題。若需停用特定工具,可在設定中配置 deniedMcpServers。修復無關的環境設定或工作階段失敗訊息引用 Git 遺失參照字眼時,工作階段被誤判為來源分支已刪除、因而不再重試的問題。即將結束的工作階段若在釋放資源時失敗或遭拒,日誌不再承諾重試;重複失敗時會顯示失敗次數。⟦形同無人調度車隊的基地閘門,以前防護限制一開就找不到車位,報修時引用特定代碼就被誤判為整輛車報廢,現在入庫停妥順暢,收工異常時也會確實記錄次數。⟧

官方原文

Self-hosted runner: Fixed sessions started from Slack being unable to find or attach a repository when managed settings restrict MCP servers; use deniedMcpServers to keep those tools off

Self-hosted runner: Fixed sessions being reported as having a deleted source branch, and not retried, when an unrelated setup or session failure quoted git's missing-ref wording

Self-hosted runner: Fixed the log promising a retry of a failed or declined session release for a session that is ending; repeated failures now show a count

14

VS Code 擴充功能支援數學公式渲染與面板效能修復

在 VS Code 面板與 Claude 討論題目時,公式呈現更漂亮且對話操作更滑順。Claude 的回覆支援 LaTeX 數學公式,包含獨立段落的 $$、多行 \[ … \] 與行內 $…$、\(…\) 語法。VS Code 與 JetBrains 面板中,Pro 與 Max 方案的用量上限橫幅新增「Get more usage」連結。修復對話造成面板當機或凍結後,每次重新載入視窗又強制重開該對話的惡性循環。修復長時間思考時面板變慢的問題,不再每次更新都重新解析整段思考文字。部分語言伺服器回報問題時不再顯示 [object Object],而是正確顯示規則代號(例如 MD013)。非 claude.ai 登入或遠端視窗等未提供聽寫的環境,不再載入原生音訊模組檢查麥克風權限。⟦就像把黑板搬進編輯器,方程式排版工整漂亮,推導再久也不會卡死在惡性循環裡。⟧

官方原文

[VSCode] Added LaTeX math rendering in Claude's responses, including $$ and multi-line \[ … \] blocks and inline $…$ and \(…\) math

[VSCode] Added a "Get more usage" link to the usage-limit banner for Pro and Max plans in the VS Code and JetBrains panels

[VSCode] Fixed a conversation that crashes or freezes the panel being reopened on every reload

[VSCode] Fixed the chat panel slowing down during long thinking: it no longer re-parses the whole thinking text on every update

[VSCode] Fixed diagnostics showing "[object Object]" instead of the rule code (e.g. MD013) for some language servers

[VSCode] Fixed the native dictation audio module being loaded, to check microphone permission, where dictation is not offered (non-claude.ai sign-ins, remote windows)