Claude Code 2.1.304
新功能 16 項
自動模式新增引導設定,工作階段記錄不再重複堆積分類脈絡
若想放手讓 Claude 自動執行任務,卻擔心它摸不清專案架構,現在有新工具能先幫它建立背景認知。輸入 /auto-mode-setup 指令,能讀取當前專案與近期工作階段(session,對話互動的生命週期),引導你教導自動模式熟悉執行環境。這項功能也支援 Bedrock、Vertex、Foundry、Claude 應用閘道,以及停用遙測的工作階段。在自動模式運作時,安全分類器的上下文不再隨每次請求反覆寫入,有效縮減了記錄檔體積。⟦像新進助理報到時先詳讀交接手冊,之後每次跑公文就不必把厚厚整本規章重複釘在每張簽呈後面。⟧
官方原文
Added /auto-mode-setup: a guided setup that reads your project and recent sessions to teach auto mode about your environment, now also available on Bedrock, Vertex, Foundry, Claude apps gateway and telemetry-disabled sessions
Improved session file size in auto mode: the safety classifier's context is no longer stored with every request
/claude-api 新增代理人安全比對,AWS 環境優先使用專屬命令列
在雲端管理自主代理人時,往往需要確認現有配置是否符合官方的安全規範。現在輸入 /claude-api managed-agents-secure 指令,能直接將託管代理人的設定與 Anthropic 公布的安全指南逐項對照,過程中完全不改動任何現有設定。在 AWS 平台的 Claude Platform 環境中,/claude-api 技能也會直接調用 ant 命令列工具,不再退回使用軟體套件或傳輸指令。⟦好比拿著官方消防清單巡視機房,逐條核對逃生門與滅火設備卻不任意更動擺設,通報時也直接使用專線對講機。⟧
官方原文
Added /claude-api managed-agents-secure, which compares a Managed Agents agent's settings with Anthropic's published security guide, without changing anything
Updated the /claude-api skill to use the ant CLI on Claude Platform on AWS instead of falling back to the SDK or curl
成品支援各分頁獨立連結,刪除確認改用數字鍵防誤按
請 Claude 產出包含多種檢視的成品時,常需要精準掌握各個畫面的位置與連結。現在索取成品連結時,Claude 會明確列出每個分頁檢視的完整連結,並特別提醒切換不同視圖時瀏覽器網址列不會改變。使用 /artifacts 刪除成品時,確認提示改為編號選單:按 1 或 Enter 會保留成品,按 2 則確定刪除,原本熟悉的 y、n 與 Esc 鍵也依然相容。⟦如同翻閱附有各章節書籤的展覽手冊,內頁清楚標明每個展示廳的對應代碼,撕下頁面時還需核對號碼牌防範失誤。⟧
官方原文
Improved artifacts with several views: when you ask for links to them, Claude now writes out each view's link and explains that the address bar stays the same as you switch views
Changed the /artifacts delete confirmation to show numbered choices: 1 or Enter keeps the artifact, 2 deletes it, and y, n and Esc still work
恢復長對話前提示用量佔比,用量查詢明確標示冷卻結束時間
打算接續過往暫停的冗長對話時,往往難以拿捏載入歷史脈絡會吃掉多少配額。Pro 與 Max 方案現在新增用量警示:當恢復非活躍對話會佔用 5 小時用量上限的顯著比例時,終端機會跳出確認提示。你可以選擇直接恢復,或者開啟乾淨的新對話,後續只要提及前次內容,Claude 就會主動回頭查閱。查詢 /usage 遇到資料頻率限制時,介面會清楚列出限制結束的時間點;Opus 5.5 在 /fast 視窗標題中的研究預覽標籤也已正式移除。⟦彷彿重新發動車輛前儀表板先提醒這段路將耗損多數油料,油槍跳停時也會亮出倒數計時告示。⟧
官方原文
Added a warning on Pro and Max plans when resuming an inactive conversation would use a noticeable share of your 5-hour usage limit: resume anyway, or start a new conversation and Claude can look up the previous one if you refer to it
Improved /usage to say when a rate limit on usage data ends instead of "try again in a moment"
Removed the "(research preview)" label from the /fast dialog title on Opus 5.5
擴充模組支援嚴格人工授權,唯讀判定與設定層級控制更精準
自己撰寫擴充模組攔截工具呼叫時,最需要掌控敏感操作的授權邊界。模組在 tool.check 中新增 decider: "person" 屬性,限定只有權限確認對話框或宿主回呼可以核准請求;在無人可詢問的環境下,會依照模組理由直接拒絕。事件參數也新增 e.isReadOnly 標記工具是否為唯讀。若有先執行的外掛跳過你的模組掛鉤(hook,特定事件發生時被觸發的小程式),記錄檔會明確寫出該外掛與事件名稱。模組的 settings.read 掛鉤現已能讀取每一層設定並覆寫合併值,將組織設定設為不可踰越的上限。外掛驗證指令也不再印出猜測掛鉤位置的文字。⟦類似機密門禁安裝雙重防線,危險操作非得由保全人員親自核章,各級主管的授權天花板也層層防堵。⟧
官方原文
Added a transcript line when a plugin that runs first skips one of your mod's hooks, naming the event and the plugin
Added decider: "person" to a mod's tool.check answer: only the permission dialog or a host's callback can approve the ask, and it is refused with the mod's reason where nobody can be asked
Added e.isReadOnly to a mod's tool.check event, set when the tool call is read-only
Changed mods' settings.read hooks to receive each settings layer and rewrite the merged settings, so a managed mod can make an organization's setting a ceiling, including the cleanupPeriodDays the retention sweep uses
Removed the notes from claude plugin validate that predicted where a mod's hooks would run
模組重載失敗不再丟失舊版工具,同名按鈕點擊精準識別
在對話過程中調整自訂模組時,程式若出現語法錯誤常會打斷原本的工作流程。以前模組重新載入失敗時,會誤把原本正常載入的舊版工具與指令清空;現在載入失敗會完整保留既有版本,終端機也會清楚顯示載入狀態。畫面上標籤相同且未指定 key 的多顆按鈕,重新繪製後點擊事件不再無故遺失。在企業或受管制的設備上,plugin-authoring 技能分享模組時不會再卡在機密掃描。啟用工作階段中模組的提示改為純文字,換輪時保持可見,啟用當下也會清楚告知載入內容。⟦跟樂團更換曲譜一樣,新譜印錯時樂手繼續照著舊譜演奏而不中斷旋律,按鍵重複時也能確實聽見回饋。⟧
官方原文
Fixed a failed mod reload removing the tools and commands of the version that stays loaded, and its messages being wrong or silent about whether the previous version is still loaded
Fixed a click on a mod's button being lost when buttons with the same label and no key were redrawn unchanged
Fixed mod sharing in the built-in plugin-authoring skill stopping at the secret scan on machines with managed settings and on Team and Enterprise plans
Improved the lines shown when a mod written in the session loads, reloads or fails to load
Changed the question that turns on the mods Claude writes in a session to plain text with no link or session id; it stays up when a new turn starts, and Claude tells you what loaded when you turn them on
技能重新整理只傳送異動項目,單一來源掛鉤設定數量上限
專案掛載了大量自訂技能時,頻繁更新容易讓對話上下文被重複的說明文字佔滿。以前每次外掛重載都會把整份技能清單重複送出;現在執行 /reload-skills 只會傳送新增或異動的項目,對話壓縮後則會確實補送一次最新總表。為避免外掛無限擴充,單一來源在每個工作階段(session,對話互動的生命週期)最多能註冊 1,024 個掛鉤與 16,384 個匹配字元。技能的單次掛鉤觸發後不再誤刪其他技能的同名掛鉤;若政策禁止本機技能掛鉤,該技能也無法取得預設的授權工具。⟦宛如圖書館更新借閱目錄,館方只印出新進書目的補充清單,每個民間贊助單位能擺設的立牌總量也受到限制。⟧
官方原文
Fixed resumed and cloud sessions sending Claude the whole skill list again each time plugins reloaded at startup
Fixed a skill's once hook also removing another skill's identical hook after it ran
Changed compaction to send Claude the skill list again afterwards; /reload-skills now sends only new or changed skills
Changed skill hooks: the skills of one source (a repo, your own folder, or a plugin) can register at most 1,024 hooks and 16,384 matcher characters per session
Changed skills under a policy that allows hooks from plugins only: a skill used in the main conversation whose hooks are kept out no longer gets its allowed-tools
多個子代理並行運作更流暢,結束任務立即發送訊息不再失憶
調派多個子代理分頭處理大型專案時,代理人之間的資訊傳遞十分關鍵。多個子代理同時執行時的反應靈敏度與處理吞吐量現已獲得顯著提升。以前子代理剛結束任務時,若立刻向它發送訊息或恢復執行,有時會遺忘上一刻的處理成果;這項暫存遺失的問題已經修好。在無頭模式(headless,沒有終端機畫面與視窗的執行模式)下,外掛也無法再藉由生成子代理來突破輪次上限或停機指令。代理人團隊在主工作階段核准關閉請求時,不會再誤把整個工具程式關掉;工具攔截逾時也不再覆蓋既有的拒絕理由。⟦正如接力賽跑的多位選手在各自跑道上全力衝刺,交棒瞬間接獲新任務能清楚銜接上一棒進度,裁判登記抵達時也不會吹哨中止整場賽事。⟧
官方原文
Fixed a plugin keeping a headless run going past --max-turns, Stop, or ended input by spawning subagents or re-running a finished one
Fixed subagents sometimes forgetting their most recent work when they were messaged or resumed right after finishing
Fixed a PreToolUse hook's deny reason being replaced by a timeout error when an Agent SDK callback hook on the same tool call timed out
Fixed agent teams: approving a shutdown request from the main session no longer exits the whole CLI
Improved responsiveness and throughput when many subagents are running at the same time
對話壓縮摘要列出過往工具名稱,磁碟空間不足不再遺失對話
對話長度超過模型負荷而觸發自動壓縮時,清晰的摘要能幫助快速掌握先前的決策流程。按下 Ctrl+O 檢視對話記錄時,壓縮摘要現在會清楚列出先前呼叫過的所有工具名稱。環境變數 CLAUDE_CODE_AUTO_COMPACT_WINDOW 正式支援 k 與 M 單位後綴,數值超出範圍或被忽略時會主動發出警示。以前硬碟空間不足時,本機記錄清理程序在修剪檔案過程會弄丟對話,這項問題已經排除。在模型拒絕過長對話並進行壓縮的途中強制中斷,不會再噴出提示過長的錯誤,記錄畫面中按快速鍵跳轉也不再漂移。⟦比方會議記錄員把冗長發言裝訂成精簡備忘錄,封套詳細列出先前展示過的所有簡報檔案,儲藏櫃空間吃緊時也不會夾落任何一頁憑單。⟧
官方原文
Added the names of the tools called earlier to the compaction summary in the transcript view (Ctrl+O)
Fixed CLAUDE_CODE_TRANSCRIPT_LOCAL_GC dropping messages from the saved transcript when the disk filled up while the file was being trimmed
Fixed a "Context limit reached" or "Prompt is too long" error after stopping a turn while Claude Code was compacting a conversation the API had rejected as too long
Fixed transcript mode's { and } landing the prompt on an inconsistent row, or off screen, instead of the transcript's first row
Fixed CLAUDE_CODE_AUTO_COMPACT_WINDOW=200k silently setting a 100K window: the variable now accepts k and M suffixes like --autocompact, and warns when a value is out of range or ignored
遠端控制解除帳號限制,自訂代理閘道連線自動相容重試
透過不同終端或自訂伺服器閘道連接 Claude 時,環境參數的些微差異容易導致通訊中斷。遠端控制(Remote Control,讓桌面端與終端機同步的連線機制)以往在終端機登入不同帳號時會永久扣留桌面版的歷史紀錄,現在這項限制已正式移除。即使在付費方案開啟停用遙測,桌面版遠端連線也能順暢啟動。當自訂語言模型閘道回報不支援脈絡管理欄位時,客戶端會自動剔除不相容欄位重新遞送;自訂 ANTHROPIC_BASE_URL 預設啟用工具搜尋,遇到協定拒絕時也會自動降級重試。登入後伺服器派發的遙測追蹤設定,在整個工作階段中不再被忽略。⟦猶如搭機跨國通訊時設備自動辨識當地頻寬,遇到格式不合便自動退回基礎封包重傳,切換臨時門號也不會反鎖漫遊紀錄。⟧
官方原文
Fixed Remote Control permanently withholding a desktop conversation's history when a different account was signed in to the terminal
Fixed Remote Control failing to start from Claude Desktop when DISABLE_TELEMETRY or DO_NOT_TRACK is set on a paid plan
Fixed context_management: Extra inputs are not permitted errors behind LLM gateways; Claude Code now resends the request without that field
Fixed OpenTelemetry settings delivered through server-managed settings being ignored for the whole session after signing in during first-run setup or the first start after /logout
Improved how a remote session recovers its status when the server refuses a status update that carried other session data
Changed tool search to be on by default behind a custom ANTHROPIC_BASE_URL; a 400 or 422 from the gateway is retried without it
模型切換與中斷不再排隊卡頓,一小時循環排程精準命中快取
急著在對話中切換模型或按下中斷鍵時,任何等待都會讓人感到拖泥帶水。在 SDK 與桌面版中,切換模型、傳送新訊息或送出中斷訊號,不再被擋在脈絡檢查後面苦候。讀取工具若卡在閒置管道或偽裝成圖片的裝置,按中斷鍵能立刻抽身。排定在一小時上限的 /loop 循環喚醒,修正了觸發時機,不再剛好錯過一小時快取(cache,把算過或查過的結果暫存起來直接用)期限,避免喚醒時重新花費時間全量讀取對話。恢復大型對話的首次回應速度顯著加快,記憶體消耗也獲得改善。⟦就像專業調音台上的切換推桿,按下靜音瞬時切斷訊號而不必等待後台自檢,自動定時回放也能直接調用已暖機的母帶。⟧
官方原文
Fixed model switches, messages and interrupts waiting behind a context usage check in SDK and desktop sessions
Fixed an interrupt not ending a Read that waits on an idle pipe or device named like an image
Fixed self-paced /loop wakeups scheduled at the 1-hour maximum firing just after the 1-hour prompt cache expired, so those wakeups no longer re-read the conversation uncached
Improved resume of large compacted sessions in SDK and headless mode: the first request after resuming is sent sooner
Improved memory use when sending requests in long or resumed conversations
啟動金鑰即時同步組織政策,桌面終端完整繼承設定檔環境變數
配置團隊金鑰或切換專案設定時,最新政策與系統變數若未能立即套用,常會引發權限錯誤。以前在啟動時輸入金鑰或在 /config 切換自訂憑證,組織政策非得等滿一小時例行檢查才會更新;現在這項同步改為即刻刷新。在桌面版 Code 分頁執行 Bash 指令時,macOS 與 Linux 系統能完整繼承 ~/.zshrc 等設定檔所匯出的環境變數。網路斷線後,/privacy-settings 不再提供不適用的隱私選項,使用者條款提醒也不會漏掉。使用 claude -p 載入設定時,警報也只聚焦阻礙啟動的關鍵錯誤。⟦形同換發新識別證後門禁閘門當場開通所有樓層,走進辦公區時個人置物櫃裡的專用工具也已全數備齊。⟧
官方原文
Fixed the organization policy not refreshing until the hourly check after approving an ANTHROPIC_API_KEY at startup or switching "Use custom API key" in /config
Fixed unsandboxed Bash commands in Claude Desktop Code tab sessions on macOS and Linux not seeing environment variables exported in shell startup files such as ~/.zshrc
Fixed the Consumer Terms notice being skipped for a day or longer after a server error
Fixed /privacy-settings offering choices that may not apply to you after a network or server error
Improved the claude -p invalid-settings warning: a file that did not load lists only what stopped it, and long lists are capped per file
雲端排程免除無效網址等待,第一輪對話跳過本機工具啟動卡頓
把任務排入雲端無人值守的工作階段時,若遇到需人工授權的流程往往會造成嚴重卡滯。在 Cowork 排程雲端工作階段中,子代理抓取網址若無人核准,現在不會再為每個代理人重複苦等五分鐘。開新對話的第一輪交流時,除非特別宣告必載,否則不再等待由網頁同步下來的本機標準輸入 MCP(Model Context Protocol,讓 AI 連接外部工具的協定)伺服器,啟動更迅速。從斜線選單點選目錄外掛的技能,現已能順利當作指令執行,對話輸入框標記資料夾也不再遺失名稱。自架執行器若找不到儲存庫,也會明確提示專案名稱與聯絡窗口。⟦宛若夜間無人值守的氣象觀測站,收不到訊號的探針直接略過而不空轉乾等,儀器開機時也不必預先暖機未接通的感測器。⟧
官方原文
Fixed scheduled Cowork cloud sessions waiting five minutes again for each subagent whose WebFetch needed a URL approval that nobody was there to give
Fixed a claude.ai Directory plugin's skills not running as commands when picked from the "/" menu in Cowork cloud sessions
Improved cloud sessions: a new conversation's first turn no longer waits for the local (stdio) MCP servers of plugins synced from claude.ai, unless a server sets alwaysLoad: true
Self-hosted runner: Improved the error shown when the git host answers "not found" for a session's repository: it now names the repository and whom to ask
[Cloud sessions] Fixed folders in the composer's @ list showing no name in cloud sessions, where picking one added only a space instead of a mention
VSCode 背景代理改以狀態列精準呈現,啟動掛鉤時間不再計入逾時
在 VS Code 編輯器內與 Claude 協作時,大量背景任務的輸出常會淹沒重要的對話內容。現在背景子代理改在代理人卡片下方以一行進度文字呈現,不再把瑣碎步驟洗進聊天視窗,完整紀錄可至 /tasks 查閱。跨雲端平台與自訂閘道的對話面板,現在也支援模組的介面繪製。啟動時執行 SessionStart 指令掛鉤的時間不再計入一分鐘的逾時限制,最多放寬至 10 分鐘,有效避免子行程初始化逾時而啟動失敗。啟動中途關閉工作階段能即時結束行程,長時間開啟時模組繪圖不再消失,自訂封裝程序時過往對話也能正確列出。⟦比照劇場舞台的演出調度,後台換景的瑣碎走動只透過側邊燈號回報而不干擾主舞台,布幕拉下時排練行程也俐落收尾。⟧
官方原文
[VSCode] Added mod drawing in the chat panel for sessions on Amazon Bedrock, Google Vertex AI and Microsoft Foundry, behind an LLM gateway, or with telemetry turned off
[VSCode] Fixed one cause of sessions failing to start with "Subprocess initialization did not complete within 60000ms": time a SessionStart command hook spends running no longer counts toward the limit, up to 10 minutes in total
[VSCode] Fixed a session closed while it was starting keeping its Claude Code process running until the start ended
[VSCode] Fixed a mod's drawings disappearing from a long-open panel until the next turn on machines that also run an older Claude Code
[VSCode] Fixed Past conversations hiding sessions when claudeCode.claudeProcessWrapper is set
[VSCode] Changed background sub-agents to show as one status line under their Agent card instead of streaming every step into the chat; the full transcript stays in /tasks
頻道共享中途主動提示新對話,對話串外執行指令提供私密指引
在企業通訊軟體中標記 Claude 協同作業時,頻道屬性變動很容易打斷對話的進行。以前當頻道在任務執行途中變更為 Enterprise Grid 跨工作區共享時,Claude 會突然陷入沉默;現在它會主動留下一則提示,指引你在新對話串中重新標記並繼續工作。若有人在討論串外部直接輸入 @Claude !fork 分支指令,Claude 不再默不作聲,而是會發送一則私密訊息,清楚說明此指令只能在對話串內部執行。這讓跨群組溝通時的操作反饋始終透明可見。⟦恰如社區會議突然改為跨大樓聯合研討,主持人會立牌引導前往新會場發言,走廊上誤投的選票也會退還本人指引正確票匭。⟧
官方原文
[Claude Tag] Fixed Claude going silent in a thread when its channel becomes shared across Enterprise Grid workspaces mid-task; it now posts a one-time note to @-mention it in a new thread
[Claude Tag] Fixed @Claude !fork typed outside a thread getting no visible reply; Claude now shows you a private note saying to run it from inside a thread
程式碼審查新增三種深度等級,支援 GitHub 全組織自動涵蓋
推廣團隊自動化程式碼審查時,不同重要性的專案往往需要彈性的審查深度。程式碼審查功能現在推出分級機制:團隊擁有人可針對整個組織選擇快速、標準(預設)或深度檢查,也可以針對特定核心專案個別設定不同層級。管理後台新增了自動審查功能,能一次納管 GitHub 組織下的全部儲存庫,之後新建立的專案也會自動加入,省去逐一手動設定的負擔。如果剛開啟審查功能隨即收到程式合併請求,系統不會再悄悄漏掉,而是會自動重新排程並完成檢查。⟦好似品管中心為不同產線設立抽驗機制,日用品快速過磅、高精密儀器深度探傷,新進產線全數自動建檔,剛開工送檢的樣品也能及時補驗。⟧
官方原文
[Code Review] Added review levels to Code Review: Owners choose Quick, Standard (the default), or Deep for the organization, and can give individual repositories their own level
[Code Review] Added an option in Code Review admin settings to review every repository in a GitHub organization, including ones added later, without selecting them one by one
[Code Review] Fixed pull requests opened within a minute or two of an admin turning on Code Review being silently skipped; they are now retried and reviewed
修正 2 項
刪除外接磁碟新增安全確認提示,分離工作樹結束不再無預警刪除
整理檔案或測試專案分支時,操作邊界十分敏感。對 /Volumes、/media 或 WSL 的 /mnt/c 等外接磁碟或頂層目錄執行 rm -r 時,會比照系統目錄跳出安全確認提示。使用 claude --worktree 時,若處於分離狀態或不同分支,結束工作階段不會擅自刪除工作樹(worktree,Git 讓同一專案平行開多份副本的功能),確保未推送的提交安全無虞。修改工作目錄外檔案時,路徑改顯示 ~/ 或絕對路徑,不再出現冗長相對符號。Linux 沙盒路徑含中括號不再報錯,Windows 直接調用 git.exe 減少延遲。⟦恰似操作重型機具,倒車接近貨櫃時必響起蜂鳴器確認,卸下拖車時若有貨品也會鎖上插銷。⟧
官方原文
Fixed sandboxed commands failing to start on Linux when a sandbox.filesystem.denyRead glob contains brackets that are not a character class, such as a [user-id] route folder
Fixed rm -r of a mounted drive or a folder at its top level (/Volumes, /media, WSL's /mnt/c) not getting the safety prompt that rm -rf /Applications gets
Fixed Write results and rejected edits showing a file outside the working directory as ../../…; they now show ~/… or the full path
Fixed claude --worktree removing the worktree and its branch without asking at exit when HEAD was detached or on another branch, which could lose commits
Fixed Bash and PowerShell deleting a large command's output file when it could not be copied to the session's tool-results folder, unless the disk is full
Windows: Improved git command start-up with a standard Git for Windows install by running its git.exe directly instead of through its cmd launcher
說明文字對齊真實參數行為,終端機輸入附註不再被刪節號截斷
在文字終端機敲打指令與回覆選項時,介面顯示若與底層行為不一致會讓人無所適從。輸入 claude --help 查詢時,包含 --tools、--resume、--debug 等多項參數與更新指令的說明,已經重新校對以貼合真實運作。當環境變數設為自動或未指定時,/effort 與輸入框旁的思考力度指示不再自行顯示猜測的數值。寬度小於 100 欄的窄視窗中,在預覽選單輸入附註時文字不再被刪節號無故截斷。在代理人清單中,滑鼠還沒放開就按 Ctrl+C,選取的文字現在不會只被清掉卻沒複製。⟦譬如手持電子紙閱讀器查閱產品指南,章節標題與實機按鍵逐一對應,在小螢幕邊欄手寫筆記時邊角文字也不會被擠落。⟧
官方原文
Fixed claude --help text for --tools, --resume, --debug, --json-schema, --disable-slash-commands, --system-prompt-snapshot and claude update to match actual behavior
Fixed /effort status, /effort ultracode and the prompt's effort indicator showing a guessed effort level when CLAUDE_CODE_EFFORT_LEVEL is auto or unset and no level is sent
Fixed notes typed into a multiple-choice question with previews being cut off with "…" in terminals under about 100 columns, hiding what was typed (anthropics/claude-code#82768)
Fixed Ctrl+C in the agents view clearing a text selection without copying it when pressed before the mouse button was released