claude@cli:~/docs$ cat claude-code.md

Claude Code: Skills如何運作?

# Skills 為擴充 Claude Code 提供了截然不同的方式。對話需要時,Claude 會自行載入 skill,您也可以輸入 /skill-name 自行執行同一個 skill。 將領域專業知識寫入 skill 後,Claude 便會在需要時運用這些知識,無須您記得提出要求。 自訂指令已併入 skills:位於 .

author: words: 2628 read_time: 24m updated: 2026-11-29 08:10

Part 3 of New to Claude Code

Skills 為擴充 Claude Code 提供了截然不同的方式。對話需要時,Claude 會自行載入 skill,您也可以輸入 /skill-name 自行執行同一個 skill。 將領域專業知識寫入 skill 後,Claude 便會在需要時運用這些知識,無須您記得提出要求。 自訂指令已併入 skills:位於 .

最後更新: 2026-11-29 · 24 分鐘閱讀 · 2K+ words

$ less claude-code.md

Skills 為擴充 Claude Code 提供了截然不同的方式。對話需要時,Claude 會自行載入 skill,您也可以輸入 /skill-name 自行執行同一個 skill。336 將領域專業知識寫入 skill 後,Claude 便會在需要時運用這些知識,無須您記得提出要求。

自訂指令已併入 skills:位於 .claude/commands/deploy.md 的檔案與位於 .claude/skills/deploy/SKILL.md 的 skill 都會建立 /deploy,運作方式相同。現有的指令檔案仍可繼續使用。Skills 另外提供存放輔助檔案的目錄,以及可控制由您、Claude 或兩者呼叫的 frontmatter。336

為什麼skills能帶來根本改變:想想那些領域專業知識:付款處理規則、法規遵循要求,以及團隊多年來淬鍊出的架構模式。沒有skills,每次工作階段都得重新說明這些背景,或寄望Claude能從程式碼註解中推敲出來。有了skills,只需編寫一次。Claude會讀取skill定義,並在相關情境中自動運用這些專業知識。初階開發人員無須開口,就能獲得資深水準的指引。安全模式也能套用,不必記得主動呼叫。

關鍵在於由誰啟動。只有您能呼叫的 skill,是需要您記得使用的捷徑;Claude 能載入的 skill,則是 Claude 隨時可取用的知識。建立安全審查 skill,納入團隊特有的漏洞模式與法規遵循要求後,Claude 只要遇到相關程式碼,就會運用這些專業知識。無論是 PR 審查、重構,或任何涉及安全性的工作,都能適用。您不必輸入 /security-review(雖然仍可這麼做);Claude 會辨識情境,自動套用 skill。

Skills、指令與subagents的比較

了解各種擴充機制的適用時機,有助於避免重複建置,並發揮最大效益:

面向 指令檔案(.claude/commands/) Skills Subagents
呼叫方式 您(/name)或 Claude,與 skill 相同 您(/name)或 Claude,由 frontmatter 決定 明確或自動委派
觸發條件 您輸入名稱,或 Claude 辨識情境 Claude 辨識情境,或您輸入名稱 任務需要委派
結構 單一Markdown檔案 含有資源的目錄 含有前置中繼資料的Markdown
上下文 主要對話 主要對話 獨立的上下文視窗
複雜度 簡單提示 跨多個檔案的功能 完整的代理角色設定
最適用途 明確執行的動作 領域專業知識 複雜任務委派

設定 disable-model-invocation: true 的時機是只應由您啟動該 skill:/deploy、/commit,以及任何您想掌控執行時機、具有副作用的操作。Claude 不會自行載入它。

設定 user-invocable: false 的時機是該 skill 屬於只應由 Claude 載入的背景知識:Claude Code 會將它從 / 選單中隱藏,您輸入名稱時也不會執行它。若 skill 可由您或 Claude 任一方啟動(例如安全模式、程式碼風格規則或領域知識),兩個欄位都不要設定。336

使用subagents的時機是任務需要隔離:背景探索、平行分析,以及不應干擾主要對話的專業推理。

Skill結構與位置

Skills存放於專用目錄中,包含必要的SKILL.md檔案,以及選用的輔助資源:

個人skills(適用於您的所有專案):

~/.claude/skills/
├── code-reviewer/
│   ├── SKILL.md
│   ├── SECURITY_PATTERNS.md
│   └── PERFORMANCE_CHECKLIST.md
├── sql-analyst/
│   ├── SKILL.md
│   └── QUERY_PATTERNS.md
└── api-designer/
    └── SKILL.md

專案skills(透過git與團隊共用):

.claude/skills/
├── domain-expert/
│   ├── SKILL.md
│   ├── BUSINESS_RULES.md
│   └── DATA_MODELS.md
└── deployment/
    ├── SKILL.md
    └── RUNBOOKS.md

專案skills會提交至版本控制。團隊成員拉取更新時,就會自動取得您的skills,無須安裝或設定。自動分發讓整個團隊都能運用一致的專業知識。

v2.1.275新增了第三種來源:在claude.ai帳號上啟用的skills,會同步至使用該帳號登入的終端機工作階段,claude.ai上的plugins也會一併同步。若要停用,請設定syncClaudeAiSkills: false(plugins則使用syncClaudeAiPlugins: false)。同步的skills仍由帳號管理——編輯已同步帳號skills資料夾中的檔案,只會變更本機副本。Write/Edit結果會說明變更尚未儲存至帳號,以及如何儲存。215

第四種來源目前為公開測試版:MCP 伺服器可以提供 skills,這些 skills 會以 server:skill 的形式出現在 / 選單中(版本說明:v2.1.332;MCP 文件:v2.1.331 或更新版本)。關於核准、掃描與可使用的環境,請參閱 MCP 章節中的來自 MCP 伺服器的 skills。527533

anthropic-skills 名稱已保留(v2.1.282)。 同步的 skills 位於 anthropic-skills 命名空間,因此在 plugin 之外,名為 anthropic-skills 或 anthropic-skills:<name> 的 skill 資料夾、指令檔案或已儲存的工作流程不會載入,啟動通知會指出第一個需要重新命名的項目。同名 plugin 仍可載入,但若在 /anthropic-skills:<name> 下發生名稱衝突,會優先使用同步的 skill。同名的 MCP 伺服器仍保有其工具,但在重新命名前,不會列出任何 skills 或提示。Skill(anthropic-skills:*) 允許規則僅涵蓋從 claude.ai 同步的 skills。若要不經提示就核准某個同步的 skill,skills 文件給出的寫法是 Skill(anthropic-skills:pdf),核准所有同步的 skills 則是 Skill(anthropic-skills *)。433 claude-ai 這個名稱並未保留:使用該名稱的項目都會載入(v2.1.283+)。222223224

SKILL.md格式

Skill 就是一個 SKILL.md 檔案。YAML frontmatter 為選用,而 description 是唯一值得每次都撰寫的欄位:336

---
name: code-reviewer
description: Review code for security vulnerabilities, performance issues, and best practice violations. Use when examining code changes, reviewing PRs, analyzing code quality, or when asked to review or audit code.
allowed-tools: Bash(git diff *) Bash(git log *)
---

# Code Review Expertise

## Security Analysis

When reviewing code, check for:

### Input Validation
- All user input sanitized before use
- Parameterized queries for database operations
- Output encoding for rendered content

### Authentication & Authorization
- Session tokens properly validated
- Permission checks before sensitive operations
- No hardcoded credentials or API keys

### Data Exposure
- Sensitive data not logged
- PII properly masked in error messages
- API responses don't leak internal details

## Performance Patterns

### Database
- N+1 query detection
- Missing indexes on filtered columns
- Unbounded result sets

### Memory
- Large object lifecycle management
- Stream processing for big files
- Connection pool exhaustion risks

## Review Output Format

For each finding:
- **File**: path/to/file.ts:123
- **Severity**: Critical | High | Medium | Low
- **Category**: Security | Performance | Maintainability
- **Issue**: Clear description of the problem
- **Recommendation**: Specific fix with code example
- **Rationale**: Why this matters

See [SECURITY_PATTERNS.md](SECURITY_PATTERNS.md) for detailed vulnerability patterns.
See [PERFORMANCE_CHECKLIST.md](PERFORMANCE_CHECKLIST.md) for optimization guidelines.

前置中繼資料參考

欄位 必填 限制 用途
name 否 預設為目錄名稱 顯示在 / 選單中的指令名稱336
description 建議填寫 skill 清單會顯示 description 加上 when_to_use 的前 1,536 個字元 探索觸發條件:Claude 據此判斷何時套用 skill。若省略,會使用內文的第一個非空白行336
when_to_use 否 計入 1,536 個字元的上限 額外的觸發詞句或範例要求,在 skill 清單中附加於 description 之後
argument-hint 否 自由文字,例如 [issue-number] 自動完成時顯示的提示,說明 skill 預期的引數
arguments 否 以空格分隔的字串或 YAML 清單 具名的位置引數,用於 skill 內文中的 $name 替換
disable-model-invocation 否 true / false(預設 false) true 會阻止 Claude 自行載入 skill;由您以 /name 啟動
user-invocable 否 true / false(預設 true) false 會將 skill 從 / 選單中隱藏,只由 Claude 呼叫
allowed-tools 否 以空格或逗號分隔的字串,或 YAML 清單 在呼叫此 skill 的那個回合中,Claude 不必詢問即可使用的工具。它不會限制其他工具336
disallowed-tools 否 以空格或逗號分隔的字串,或 YAML 清單 skill 啟用期間從 Claude 可用工具中移除的工具;此限制會在您送出下一則訊息時解除336
context 否 fork 在 fork 出來的 subagent 上下文中執行 skill(v2.1.0+)。434 截至 v2.1.218,context: fork 的 skills 預設在背景執行;在 claude -p 與 Agent SDK 中,Claude Code 則會等待結果。192503
agent 否 subagent 類型 設定 context: fork 時,由哪種 subagent 類型執行 skill
background 否 true / false 讓context: fork的skill停用背景執行:background: false會讓它持續在前景執行。僅在設定context: fork時有效,該模式預設在背景執行(v2.1.218+)。192
model 否 模型別名或 ID,或 inherit 您以 /name 自行執行 skill 時,該回合使用的模型;inherit 會沿用目前的模型。由 Claude 執行 skill 時,工作階段會維持原本的模型;當您的組織封鎖該值、規劃模式的升級正在作用中,或 auto mode 的分類器已開啟但不支援該值時,也是如此。搭配 context: fork 時,該值即為 fork 出來的 subagent 的模型。在互動式工作階段中生效(v2.1.259+)208548
effort 否 low / medium / high / xhigh / max 以指定的 effort 等級執行 skill 的回合(v2.1.80+)。在預設 effort 固定的模型(Opus 4.7、Opus 4.8、Fable 5)上也會遵循此設定,自訂指令與 subagents 亦同(v2.1.267+)213
hooks 否 Hooks 設定 呼叫 skill 時由 Claude Code 註冊,並在工作階段其餘時間保留的 hooks
paths 否 以逗號分隔的字串,或 glob 模式的 YAML 清單 只有在處理相符的檔案時,Claude 才會自動載入此 skill
shell 否 bash(預設)或 powershell 執行 skill 內嵌 shell 指令的 shell

每個欄位都是選用的,Claude Code 會忽略無法辨識的欄位,且不會回報錯誤。它也接受 metadata、license 與 compatibility,但不會據以採取任何動作。上傳至 claude.ai 或透過 Skills API 傳送的 skills 只接受 name、description、license、compatibility、metadata 與 allowed-tools;任何其他欄位都會讓上傳失敗,並出現 unexpected-key 錯誤。336

字串替換(v2.1.9+):Skills可使用${CLAUDE_SESSION_ID}替換值來存取工作階段上下文。適合用於記錄日誌、追蹤,或產生特定工作階段的輸出。43

描述欄位至關重要。Claude會比對您的要求與skill描述,以探索適用的skills。描述模糊,Claude就無法辨識使用時機。描述具體且觸發條件明確,才能可靠地啟用。

不佳的描述:

description: Helps with code

有效的描述:

description: Review code for security vulnerabilities, performance issues, and best practice violations. Use when examining code changes, reviewing PRs, analyzing code quality, or when asked to review, audit, or check code.

有效的描述包含: - skill的功能(審查程式碼中的特定問題) - 使用時機(檢視變更、PR、品質分析) - 觸發詞句(審查、稽核、檢查)

預先核准與移除工具

allowed-tools 會針對呼叫 skill 的那個回合預先核准所列的工具,讓 Claude 不必詢問就能使用。這項授權會在您送出下一則訊息時解除。它不會限制任何東西:其他所有工具仍可呼叫,您未列出的工具仍由您的權限設定管轄。此欄位不受工作區信任把關,因此在儲存庫中執行 Claude Code 之前,請先檢查其中已簽入的 skills 的 allowed-tools。336

若要在 skill 啟用期間拿走某些工具,請將它們列在 disallowed-tools 中:

---
name: security-auditor
description: Audit code for security vulnerabilities without making changes
disallowed-tools: Edit, Write, NotebookEdit, Bash
---

採用此設定後,skill 啟用期間 Claude 無法呼叫檔案編輯工具或 Bash。您未列出的工具仍可使用,且此限制會在您送出下一則訊息時解除,因此它保護的是單一 skill 的回合,而非整個工作階段。若要在所有 skills 與提示中封鎖某個工具,請在權限設定中新增拒絕規則。336

意圖 設定位置 範例
不必詢問就執行這些工具 allowed-tools Bash(git log *) Bash(git diff *)
skill 啟用期間絕不使用這些工具 disallowed-tools Edit, Write, NotebookEdit, Bash
在所有 skills 與提示中移除某個工具 權限設定中指名該工具的拒絕規則 WebFetch
在所有 skills 與提示中拒絕特定寫法的指令 權限設定中帶有 Bash 模式的拒絕規則 Bash(git push *)

指名工具的拒絕規則會將該工具從 Claude 的上下文中移除。Bash 模式則是比對指令文字:Bash(git push *) 會拒絕以 git push 開頭的指令,但不會比對以其他方式寫成的推送(例如 git -C <dir> push),因此它並非針對 git 的安全邊界。504

輔助檔案

Skills可以包含多個檔案。Claude會在啟用時讀取主要的SKILL.md,再視需要存取輔助檔案,透過逐步揭露資訊來有效管理上下文。

結構模式:

my-skill/
├── SKILL.md           # Required: overview + quick reference
├── DETAILED_GUIDE.md  # Deep documentation
├── EXAMPLES.md        # Concrete examples
├── PATTERNS.md        # Reference patterns
├── templates/         # Reusable templates
│   └── component.tsx
└── scripts/           # Helper utilities
    └── validate.py

從SKILL.md參照輔助檔案:

For detailed security patterns, see [SECURITY_PATTERNS.md](SECURITY_PATTERNS.md).

Use this template for new components:
[templates/component.tsx](templates/component.tsx)

Validate configurations with:
```bash
python ${CLAUDE_SKILL_DIR}/scripts/validate.py config.json
```

來自 skill 的指令會在工作階段的工作目錄中執行,而不是在 skill 資料夾中。${CLAUDE_SKILL_DIR} 會展開為存放 SKILL.md 的目錄,因此無論 skill 安裝在何處,隨附的指令碼都能正確解析路徑。503

專家建議:將必要資訊直接放在SKILL.md中,輔助檔案則留給深入的參考資料。Claude會立即讀取SKILL.md,但只在需要時存取輔助檔案。若將關鍵資訊藏在輔助檔案中,Claude可能找不到。

完整範例:領域專家Skill

以下是適用於金融科技應用程式、具備正式環境品質的skill:

目錄結構:

.claude/skills/payments-domain/
├── SKILL.md
├── BUSINESS_RULES.md
├── COMPLIANCE.md
└── DATA_MODELS.md

SKILL.md:

---
name: payments-domain
description: Expert knowledge of payment processing domain including transaction flows, compliance requirements, and business rules. Use when working with payment code, transaction handling, refunds, disputes, or financial calculations.
---

# Payments Domain Expertise

## Core Concepts

### Transaction States
```
PENDING → AUTHORIZED → CAPTURED → SETTLED
                    ↘ VOIDED
         AUTHORIZED → DECLINED
CAPTURED → REFUNDED (partial or full)
SETTLED → CHARGEBACK → REPRESENTED
```

### Money Handling Rules
- ALL monetary values stored as integers (cents, not dollars)
- Currency always explicitly tracked (never assume USD)
- Rounding: HALF_EVEN for calculations, HALF_UP for display
- Never use floating point for money

### Idempotency Requirements
Every payment operation MUST be idempotent:
```typescript
// Required pattern
async function processPayment(idempotencyKey: string, amount: number) {
  const existing = await findByIdempotencyKey(idempotencyKey);
  if (existing) return existing; // Return cached result

  const result = await executePayment(amount);
  await storeWithIdempotencyKey(idempotencyKey, result);
  return result;
}
```

## Quick Reference

### Fee Calculations
- Interchange: 1.5% + $0.10 (debit), 2.1% + $0.10 (credit)
- Platform fee: 2.9% + $0.30 (standard), 2.2% + $0.30 (enterprise)
- International: +1% cross-border fee
- Currency conversion: mid-market rate + 1%

### Compliance Thresholds
- $3,000: Enhanced due diligence trigger
- $10,000: CTR filing required
- $25,000: Additional verification required

### Refund Windows
- Full refund: 120 days from capture
- Partial refund: 180 days from capture
- Chargeback window: 120 days (Visa), 180 days (Mastercard)

## Key Files

- `src/payments/processor.ts` - Core payment logic
- `src/payments/refunds.ts` - Refund handling
- `src/compliance/aml.ts` - AML checks
- `src/models/transaction.ts` - Transaction model

See `BUSINESS_RULES.md` for detailed business logic.
See `COMPLIANCE.md` for regulatory requirements.
See `DATA_MODELS.md` for schema documentation.

設定此skill後,當您處理交易程式碼、詢問退款邏輯,或對付款流程進行除錯時,Claude就會自動運用付款領域的專業知識。無須呼叫任何功能,專業知識隨時可用。

建立有效的Skills

從描述開始。先撰寫描述,再依照描述建立skill內容。描述決定了Claude何時使用skill,因此務必寫得精準:

  1. 說明skill提供的功能
  2. 列出具體的觸發條件
  3. 納入相關關鍵字與詞句

讓skills保持聚焦。一個skill只涵蓋一個領域或一項能力:

良好(聚焦) 不佳(過於廣泛)
security-auditor code-helper
react-patterns frontend-stuff
postgres-optimization database-expert
api-documentation docs-generator

如果skill試圖涵蓋太多內容,描述就會變得模糊,Claude也無法可靠地辨識使用時機。

採用逐步揭露。將最重要的資訊直接放在SKILL.md中,並參照輔助檔案提供深入內容:

## Quick Reference
[Essential patterns here - Claude sees this immediately]

## Deep Dive
For full coverage, see [DETAILED_GUIDE.md](DETAILED_GUIDE.md).

納入具體範例。具體模式比抽象描述更實用:

## Input Validation

### Pattern
```typescript
// Good: Explicit validation with typed errors
const validated = PaymentSchema.safeParse(input);
if (!validated.success) {
  throw new ValidationError(validated.error.issues);
}

// Bad: Implicit coercion
const amount = Number(input.amount); // Silent NaN on invalid input
```

以實際情境的要求測試。建立skill後,測試Claude是否會啟用它:

> Review this payment processing code for issues
# Should activate payments-domain skill

> How should I handle refunds?
# Should activate payments-domain skill

> What's the weather like?
# Should NOT activate payments-domain skill

若Claude未如預期啟用skill,請修改描述,納入您實際使用的觸發詞句。

團隊共用策略

透過Git共用(建議用於專案skills):

# Add skill to project
mkdir -p .claude/skills/team-standard
# Create SKILL.md and supporting files

# Commit
git add .claude/skills/
git commit -m "Add team coding standards skill"
git push

# Teammates get it automatically
git pull
claude  # Skill now available

透過符號連結跨專案共用:

# Create canonical skill location
mkdir -p ~/shared-skills/security-reviewer
# Create SKILL.md

# Symlink into projects
ln -s ~/shared-skills/security-reviewer ~/.claude/skills/security-reviewer
# Now available in all your projects

透過plugin分發: 若要擴大分發範圍,可將skills封裝為plugins:

my-plugin/
├── .claude-plugin/
│   └── plugin.json
└── skills/
    └── my-skill/
        └── SKILL.md

使用者安裝plugin後,即可使用其中隨附的skills。

Skills 維護調整(v2.1.304-309)。 上下文壓縮完成後會再次將 skill 清單傳送給 Claude,而 /reload-skills 只會傳送新增或變更的 skills。同一來源的 skills,無論來源是儲存庫、您自己的資料夾或 plugin,每個工作階段最多可註冊 1,024 個 hooks,且比對條件的字元總數上限為 16,384。某個 skill 的 once hook 也不再移除另一個 skill 中相同的 hook。當政策僅允許來自 plugins 的 hooks 時,若在主對話中使用的 skill 的 hooks 遭排除,該 skill 也不再取得其 allowed-tools(以上皆為 v2.1.304)。若 --add-dir 資料夾中的 skill 名稱已被另一個 skill 使用,會以 <folder>:<name> 的名稱提供(v2.1.309)。275276

Skills 變更(v2.1.323 至 v2.1.332)。 排程任務與 /loop 在執行宣告了 allowed-tools 或 hooks 的 skill 之前會先詢問;若要在無人值守下執行,請將 Skill(name) 加入 permissions.allow(v2.1.325)。在 auto mode 與略過權限模式之外,skill 的內嵌 git 指令在 bare 儲存庫的 worktree 及類似資料夾中會停止執行,直到您允許為止(v2.1.323)。從 --plugin-dir plugins 上層目錄啟動的工作階段,不再載入這些 plugins 中的 .claude/skills 資料夾,因此請在 plugin 資料夾中啟動 Claude Code(v2.1.325)。Claude 執行帶有 model 設定的 skill 時(context: fork skill 除外),subagents、fork、壓縮與 /recap 都會維持使用工作階段的模型(v2.1.330)。在已開啟 computer use 的 Mac 上,computer-use 是保留的 skill 名稱:您自己同名的 skill 或指令會停止載入,啟動通知會提示您重新命名(v2.1.332)。若要記錄或拒絕 skill 在載入時執行的 shell 指令,請使用 PreSkillShellCommand hook 事件(v2.1.332;請參閱 Hook 輸入/輸出協定)。527529

Skills除錯

Skill未啟用:

1. 檢查描述是否符合您的要求:

# If you're saying "check this code" but description says "review"
description: Review OR check code for issues...

2. 確認檔案位置:

# Personal
ls ~/.claude/skills/my-skill/SKILL.md

# Project
ls .claude/skills/my-skill/SKILL.md

3. 驗證YAML前置中繼資料: - 第一行必須完全符合--- - Markdown內容前須有結尾的--- - YAML中不可使用定位字元(請使用空格) - 欄位名稱必須與參考資料完全一致;Claude Code 會忽略無法辨識的欄位,且不會回報錯誤

4. 以除錯模式執行並閱讀日誌。--debug 不會在終端機輸出任何內容;skill 的 frontmatter 格式錯誤時,剖析錯誤會記錄在日誌檔中:433

claude --debug
# Then read ~/.claude/debug/<session-id>.txt

5. 驗證 skills 資料夾(v2.1.233+),找出 frontmatter 無法剖析的 SKILL.md 檔案:433

claude plugin validate .claude/skills      # project skills
claude plugin validate ~/.claude/skills    # personal skills

Skill意外啟用:

縮小描述範圍。若skill在不該啟用時啟用,表示描述過於廣泛:

# Too broad - activates on any "code" mention
description: Help with code

# Specific - activates only for security contexts
description: Audit code for security vulnerabilities including injection attacks, authentication flaws, and data exposure. Use when specifically asked about security, vulnerabilities, or when reviewing code for security issues.

找不到輔助檔案:

  • 以相對於 skill 資料夾的路徑連結輔助檔案,例如 [reference.md](reference.md);在指令中,請透過 ${CLAUDE_SKILL_DIR} 存取隨附的指令碼,因為指令會在工作階段的工作目錄中執行503
  • 僅使用正斜線(即使在Windows上也是如此)435
  • 檢查檔案是否確實存在:ls .claude/skills/my-skill/REFERENCED.md

何時建立Skill

適合建立skill的情況: - Claude 應在任務需要時自行運用領域專業知識 - 多位團隊成員需要相同知識 - 您反覆說明相同的模式或規則 - 上下文應在您不必輸入指令的情況下載入 - 知識分散於多個檔案,需要整理

不適合建立skill的情況: - 任務需要獨立的上下文(使用subagent) - 只是一次性的提示(直接輸入即可)

想要明確控制呼叫時機,並不是避免使用 skill 的理由:保留為 skill,並設定 disable-model-invocation: true 即可。單一範本也可以做成 skill,而 .claude/commands/ 中的現有檔案仍可繼續使用。336

專家建議: 如果您發現自己每次處理驗證程式碼前,都會輸入 /security-review,不妨讓 Claude 自行載入它:撰寫一段點明其適用於哪些驗證相關工作的描述,並且不要設定 disable-model-invocation。讓專業知識隨時可用,無須明確呼叫。


參考資料


  1. Claude Code CHANGELOG,2.1.9 章節,擷取於2026年11月11日:「Added support for PreToolUse hooks to return additionalContext to the model」;「Added ${CLAUDE_SESSION_ID} string substitution for skills to access the current session ID」;「Added auto:N syntax for configuring the MCP tool search auto-enable threshold, where N is the context window percentage (0-100)」;「Added plansDirectory setting to customize where plan files are stored」。 ↩

  2. Claude Code CHANGELOG,v2.1.218 條目。2026年7月。v2.1.218: /code-review 改以背景子代理程式執行,審查工作不再佔據對話內容,堆疊的斜線指令仍是其審查目標;設定 context: fork 的 skills 預設在背景執行,可透過新的 background: false frontmatter 鍵逐一停用;危險 rm、背景 & 與可疑 Windows 路徑檢查不再開啟權限對話框,改由 auto 模式分類器裁決;在 auto 模式下的 plan 模式,對於靜態分析器無法證明為唯讀的 Bash 指令也不再提示;agent frontmatter hooks 須待 agent 檔案所在資料夾本身已接受工作區信任後才會執行;/deep-research 僅在手動呼叫時啟動。另有:左方向鍵捨棄確認,以及 Esc 從 agent 檢視返回;伺服器管理的無害功能/成本切換略過設定核准提示;拒絕含 : 的 agent 名稱;skill 與 plugin frontmatter 的布林值接受 yes/no/on/off/1/0;信任對話框會標明儲存庫根目錄;改善 IDE 互動的沙箱限制;Ctrl+B 背景 shell 上限;Bedrock ARN 支出計量;headless/SDK 工作階段在壓縮後保留 fork 工作階段的沿革;修正 Windows \u 路徑損壞;修正遠端工作階段的殭屍心跳。擷取於2026年7月24日,當時 v2.1.218(發布於 2026-07-22T21:24Z)為 npm latest。(歸屬更正,2026年7月25日:claude mcp list//mcp 顯示 HTTP 狀態與錯誤文字一項,以及 MCP 隱藏空白字元警告,原列於此處的 v2.1.218 之下;原始 changelog 將兩者皆置於 v2.1.219 條目。已移至 193。) ↩↩

  3. Claude Code CHANGELOG,v2.1.219 與 v2.1.220 條目。2026年7月。v2.1.219(7月24日): 新增 Claude Opus 5(claude-opus-5)作為新的預設 Opus 模型,具 1M 脈絡視窗,fast 模式定價為每 MTok $10/$50;新增 sandbox.network.strictAllowlist 設定,讓沙箱指令在不提示的情況下直接拒絕未列入允許清單的主機;新增 DirectoryAdded hook,在 /add-dir 或 SDK 的 register_repo_root 控制請求於工作階段中途登錄新工作目錄後觸發;在 headless stream-json 的 init 事件中新增 mcp_server_errors,列出因設定驗證而略過的 --mcp-config 項目(終端機執行時會印出啟動警告);新增 workflowSizeGuideline 設定鍵,讓建議性的 Dynamic workflow size 準則可由任一設定檔設定,設定後 /config 中對應的列會隱藏;stream-json 新增巢狀子代理程式轉送,設定 --forward-subagent-text 時,深度 2 以上產生的子代理程式也會出現,並以產生它們的 Agent tool_use id 作為鍵;動態工作流程改為預設採用中型規模準則(目標少於 15 個代理程式);將 Opus 4.7 自 fast 模式移除,/fast 現在適用於 Opus 5 與 Opus 4.8;子代理程式現在預設可產生最深達第 3 層的巢狀子代理程式(原為 1);設定 CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=1 可停用巢狀;更新 claude-api skill,預設改為 Claude Opus 5,並提供自 Opus 4.8 的遷移路徑;伺服器連線失敗時,claude mcp list 與 /mcp 會顯示 HTTP 狀態與錯誤文字,並對含隱藏前導或尾端空白字元的 MCP 設定值提出警告;

    受管理的 MCP 允許清單/拒絕清單中的 ${VAR} 項目改由啟動環境與受管理設定的 env 解析,不再使用設定檔的 env;在執行中工作流程的狀態列加入目前的預設工作流程規模;修正下列問題:claude -p 文字輸出在回合因串流中途的 API 錯誤而中止時遺失已產生的回答、Fable 列顯示過時的「Requires usage credits」標籤、/model 選擇器將合併後的 Opus 列顯示為單純的「Opus」而非「Opus (1M context)」、新版本醒目標示範圍超出最新模型名稱、GNU screen 選取即複製時印出 base64、Remote Control 用戶端在模型切換/重新連線/組織檢查失敗後仍保留過時的 fast 模式狀態、Windows 上的 CLAUDE_CODE_GIT_BASH_PATH 在路徑並非 bash/sh 二進位檔時直接結束或被當作 bash 使用(現在會忽略並顯示警告)、Vim 模式在空白提示下按 ← 無法從 NORMAL 模式返回 agent 檢視,以及螢幕閱讀器模式在每次按鍵時重寫整行輸入;改善「Remote Control is only available via api.anthropic.com」錯誤訊息,使其指出造成此情況的設定,並讓 claude --teleport 在不符時顯示目前 checkout 指向的儲存庫。v2.1.220(7月25日): 僅有錯誤修正與可靠性改善,沒有面向使用者的功能、設定、指令或定價變更。擷取於2026年7月25日。 

  4. Claude Code 版本說明 v2.1.257 與 v2.1.258(皆為2026年9月1日)及 v2.1.259(2026年9月2日),以及2026年9月3日的正式 CHANGELOG。當日的 npm dist-tags:latest 與 next 皆為 2.1.259,stable 為 2.1.236;npm 已發佈的版本從 2.1.252 直接跳到 2.1.257——2.1.253 至 2.1.256 從未發佈,CHANGELOG 中也沒有對應章節(與 2.1.244/2.1.249 的模式相同)——因此 2.1.258 說明中的「2.1.255 引入的回歸」指的是未發佈的內部建置,而 v2.1.257 是第一個可安裝且支援 Fable 5.1 的版本。v2.1.257 各項目的來源:Fable 5.1 支援及閘道警語(在 Claude apps 閘道工作階段中,fable 與 best 別名目前仍解析為 Fable 5,因為尚未針對 Fable 5.1 設定的閘道會拒絕它——請改在 /model 中選取);timeFormat/timeZone;自動模式的「Containment Escape」規則(雲端中繼資料憑證擷取、出口規避與跨租戶存取不會自動核准,除非環境將其標記為預期行為);CLAUDE_CODE_SUBAGENT_MODEL_FORCE;第一次讀取工作目錄之外的檔案前的一次性提示,加上 permissions.blockReadsOutsideWorkingDirectories;/effort s 與以工作階段為範圍的 --effort;專案/本機的 defaultMode: "bypassPermissions" 會被忽略;managedSourcesBehavior: "merge" 的細部調整(sandbox.credentials.awsPairs 與 sandbox.ripgrep 會整體從設定它們的最高層來源讀取);Bash Read()/Edit() 拒絕規則涵蓋 < file 輸入重新導向以及 tac、egrep 等讀取指令;以及 --add-dir、/add-dir 與 additionalDirectories 對網路路徑(UNC 共用、/net/<host> 自動掛載)的拒絕。

    v2.1.258 修正的來源:未發佈的 2.1.255 所引入的 macOS 12 啟動回歸,以及遠端/排程工作階段在需要非空內容的請求上失敗。v2.1.259 各項目的來源:managedMcpServers;allowedMcpServers 的範圍改為僅限使用者新增的伺服器;--permission-prompts none(任何原本會提示的操作都會自動拒絕,而目前的權限模式仍持續做決定);無法解析的受管設定會拒絕啟動並指出來源;自訂指令與 skills 的 frontmatter model: 在互動式工作階段中會被採用,而自動模式會保留工作階段模型,不會在不支援的 frontmatter 模型上執行回合;claude plugin validate --json;以及 Bash Read() 拒絕涵蓋範圍延伸至選項值/運算元(--ignore-revs-file=.env、-f.env、@file 引數、git diff/git grep 運算元、cd DIR && cat FILE 複合指令,以及對含有遭拒檔案的目錄執行 grep -r/cp -r 現在會詢問)。設定文件尚未記載 timeFormat/timeZone 或 managedMcpServers,CLI 參考也尚未列出 --permission-prompts;截至2026年9月3日,CHANGELOG 是這些項目的來源。 ↩

  5. Claude Code 版本說明 v2.1.266(2026年9月8日)、v2.1.267(9月9日)、v2.1.268(9月10日)、v2.1.269(9月11日)、v2.1.270(9月12日)、v2.1.271(9月14日)及 v2.1.272(npm 於9月14日發布,GitHub 版本於9月15日 00:42 UTC 發布),以及2026年9月15日的正式 CHANGELOG – 七個版本的說明內容與其 CHANGELOG 章節完全一致。9月15日(約 13:15 PT)的 npm dist-tags:latest 2.1.272、next 2.1.273、stable 2.1.236;2.1.273(9月15日 18:06 UTC 發布)沒有 GitHub 版本,也沒有 CHANGELOG 章節,因此其內容未收錄於此;2.1.263 仍只寫著「Bug fixes and reliability improvements」– 從未補上任何說明。以下內容的出處(引述處皆為原文):/output-style 的回歸(”Added /output-style [name] to list and switch output styles, including over Remote Control and in cloud and other headless sessions”,v2.1.269);claude plugin eval(”run a plugin’s eval suite against Claude Code and get scored, reproducible results (JSON + HTML report)”,v2.1.269);Claude Code Remote 工作階段中的 fast mode(”cloud and self-hosted runners: the host’s fast-mode setting or /fast typed in the session applies where your organization allows it”,v2.1.271)以及 /fast off 的修正;

    maxEffortLevel 設定(”top-level or per model under modelSettings: caps the effort level on every provider, including Bedrock, Vertex and Foundry; users can still pick a lower level”,v2.1.267);--system-prompt-snapshot off(v2.1.267);v2.1.267 的 prompt-cache 穩定性修正批次(恢復工作階段時的工具清單、工具描述與 MCP 宣告文字的改寫;/model 切換時重新傳送每一個工具定義,署名文字改為對話備註;--system-prompt/--append-system-prompt 工作階段只記錄一次提示詞與工具定義;工作階段中途加入的 MCP 與 plugin 工具改為延遲載入的定義);固定預設 effort 模型(Opus 4.7、Opus 4.8、Fable 5;v2.1.267)上 effort: frontmatter 的修正;marketplace 反斜線隔離修正(v2.1.267);任務追蹤工具的允許清單(「Changed the task-tracking tools (TaskCreate/Get/Update/List, TodoWrite) to be offered only on」Claude 3.x、Opus 4.0 至 4.7、Sonnet 4.0 至 4.6 與 Haiku 4.5,並附「set CLAUDE_CODE_ENABLE_TODO_TOOLS=1 elsewhere」,v2.1.268);符號連結目錄與 env -C/eval 拒絕規則的修正(v2.1.268);WebFetch 與 Artifact 規則的拆分(”Changed plain WebFetch deny and ask rules to no longer apply to Artifact tool reads and updates; use an Artifact rule (or WebFetch(domain:claude.ai)) to block or gate them”,v2.1.268);/plugin 變更於選單關閉時生效(v2.1.268);WebFetch 的 300 秒期限與 CLAUDE_CODE_WEBFETCH_DEADLINE_MS(v2.1.268);gatewayInternalNetworks、空白 allow_cidrs 的警告,以及 gateway pricing: 費率同步(v2.1.268),再加上 multiplier 可高於 1 並最高至 10(v2.1.271);

    ${VAR} 與 git URL 的機密防護修正(v2.1.268);claude auth status --json 中的 configDirectory(v2.1.268);第三方 ANTHROPIC_BASE_URL HTTP 400 迴歸問題的修正(v2.1.268);bashEditDiffEnabled(v2.1.269);署名提醒的修正(”Fixed the attribution reminder overriding a CLAUDE.md or memory rule against commit and pull request attribution; lines set by managed settings still apply”,v2.1.269);環境變數 OTEL_METRICS_INCLUDE_REPOSITORY、CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS(1-256)、CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS(預設 3 秒)及 CLAUDE_CODE_BG_TASKS_REPORT_RUNNING(v2.1.269);v2.1.247 鍵盤迴歸問題的修正,以及透過 SSH 的 kitty 查詢鍵盤支援(v2.1.269);Edit()/tee、Bash(tee:*) 與開頭 ! 的範圍判定修正(v2.1.269);啟用沙箱的 auto mode 下,Bash、PowerShell 與 Monitor 的逐命令 allowed_domains(v2.1.271);omitClaudeMd agent frontmatter 與 --agents JSON(v2.1.271);auto mode 的行內 ! 與 subagent 交還機制的變更(v2.1.271);claude plugin install/update 的 --accept-command <sha256>(v2.1.271);--resume 在不同模型系列間保留 [1m](v2.1.271);無法讀取的 managed-mcp.json 改為預設拒絕(v2.1.271);fmt/column、萬用字元展開、變數宣告旗標與 blockReadsOutsideWorkingDirectories 檢查器的修正(v2.1.271);以及 Markdown artifacts 改以具樣式的文件頁面呈現,artifact 監看數提高至 10(v2.1.271)。v2.1.266 只有一行(CLAUDE_CODE_USE_GATEWAY 迴歸問題的修正),v2.1.270 只有一行(v2.1.269 git 提示迴歸問題的修正),而 v2.1.272 僅寫著「Bug fixes and reliability improvements」。 ↩

  6. Claude Code 版本說明 v2.1.274(發布於 2026年9月17日 00:12 UTC,108 個項目)、v2.1.275(9月17日 22:33 UTC,96 個項目)與 v2.1.276(9月18日 02:12 UTC,一行),以及2026年9月17日的正式 CHANGELOG:三份版本說明內文與其 CHANGELOG 章節逐位元組相同。9月17日(約太平洋時間 22:08)的 npm dist-tags:latest 與 next 皆為 2.1.276,stable 為 2.1.267。以下項目的來源,引用處皆為原文:claude.ai 同步(”新增將您 claude.ai 帳號上啟用的 skills 與 plugins 同步至以該帳號登入的終端機工作階段;以 syncClaudeAiSkills: false 或 syncClaudeAiPlugins: false 選擇停用”,v2.1.275);立即送出鍵(”新增立即送出鍵(ctrl+enter,或 ctrl+x ctrl+s),可中斷目前回合並一次送出所有排隊中的訊息;已送出與排隊中的訊息會以灰色顯示,直到模型接收為止”,v2.1.275);/plugin install <plugin> --marketplace <source>(”會在安裝 plugin 前主動提議加入該 marketplace”,v2.1.275);npm plugin 來源強化(”變更從 npm 來源安裝的 plugins,改以 npm pack --ignore-scripts 取得並驗證完整性,因此套件的安裝指令碼不再執行”,v2.1.275);同步帳號 skills 的 Write/Edit 結果(”現在會說明變更未儲存至您的帳號,以及如何儲存”,v2.1.275);分頁圖示變更(”變更 Artifact 工具,首次發布時改為要求一個單字的分頁圖示,而非 emoji favicon”,v2.1.275);

    CLAUDE_CODE_MCP_STARTUP_WAIT_MS(”用於限制第一個非互動式回合等待 MCP 伺服器連線的時間(0 = 不等待)”,v2.1.274);MCP 用戶端預設值(”變更 Bedrock、Vertex、Foundry 與停用遙測的安裝,預設改用 v2 MCP 用戶端,並與直接 HTTP 伺服器採用 MCP 2026-07-28 協商,與其他安裝一致(選擇停用:MCP_SDK_GENERATION=v1 或 MCP_PROTOCOL_NEGOTIATION=legacy)”,v2.1.274);舊版 HTTP+SSE 4xx 修正(”修正了設定為 http 且僅支援舊版 HTTP+SSE 的 MCP 伺服器,在以 422 或其他 4xx 錯誤回應第一個請求時無法連線的問題”,v2.1.274);"type": "sdk" 略過(”變更 .mcp.json、設定、plugins 與 agent 檔案中的 "type": "sdk" MCP 項目,改為略過並顯示警告:只有 SDK 宿主應用程式才能註冊行程內伺服器”,v2.1.274);命名變更(”變更 /status 的 GitHub 行文字為 "Cloud sessions",並將 /web-setup、/ultrareview 與 teleport 訊息改為顯示 "cloud session" 而非 "Claude Code on the web"“,v2.1.274);artifact 監看(”變更本機工作階段中的 artifact 監看:在其他地方發布的新版本不再啟動回合;Claude 會從之後的 Artifact 工具結果得知”,v2.1.274);以及 v2.1.276 的回歸修正(”修正了當 ANTHROPIC_BASE_URL 指向 proxy 或閘道時,每個請求都以 400 … Input tag 'advisor_20260301' 失敗的問題(2.1.275 回歸)”)。 ↩

  7. Claude Code v2.1.282 版本說明(npm 於2026年9月24日 15:56 UTC 發布;GitHub 發布版本為 18:38 UTC;86 個條目,與正式 CHANGELOG 的 2.1.282 章節完全一致,擷取於2026年9月26日)。本指南中每一項 v2.1.282 內容的資料來源。關鍵引文:「Changed auto mode to use the server-side classifier by default on a direct Anthropic API connection when telemetry is off (CLAUDE_CODE_AUTO_MODE_SERVER=0 opts out)」;「Changed project and local settings to ignore OpenTelemetry variables that turn on export, set its endpoint, or capture content, like CLAUDE_CODE_ENABLE_TELEMETRY and OTEL_LOG_*」;「Added a maxProseWidth setting that caps the width of Claude’s prose in wide terminals」;「Added the allowClaudeInChromeWithManagedMcp managed setting to let claude --chrome run alongside an exclusive managed-mcp.json」;「Changed sandbox.excludedCommands to ignore project and local settings entries when managed settings or --settings set allowUnsandboxedCommands: false, or managed allowManagedDomainsOnly: true」;「Changed skill folders, command files and workflow commands in the anthropic-skills or claude-ai namespace to no longer load」。 ↩

  8. Claude Code v2.1.283 版本說明(npm 於 2026年9月25日 18:46 UTC 發布;GitHub 發行於 21:50 UTC;共 94 條項目,與正式 CHANGELOG 的 2.1.283 章節完全一致,2026年9月26日擷取,該紀錄從 2.1.281 到 2.1.283 連續無缺漏)。本指南中所有 v2.1.283 項目的來源。9月26日的 npm dist-tags:latest 與 next 為 2.1.283,stable 為 2.1.274。重點引文:”Changed interactive sessions on third-party providers or with telemetry off to start in auto mode when no permission mode is configured; permissions.defaultMode still overrides it”;”Added deniedModels managed setting to block specific models, even when availableModels allows them”;”Added /doctor prompt-audit (also /checkup prompt-audit) to audit your CLAUDE.md files, skills, agents and commands for prompting patterns written for older models”;”Added x-claude-code-prompt-id to the gateway hint headers”;”Changed the /model picker’s Opus row and the Default model’s name to drop ‘(1M context)’ where Opus already has a 1M context window”;”Reverted the 2.1.282 reservation of the claude-ai name”。 ↩

  9. Claude Code 文件,2026年9月26日擷取。權限模式:”With Claude Code v2.1.283 or later, auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions on every plan and provider”;claude -p 與 Agent SDK 以 default 模式啟動;”From v2.1.282, a session that doesn’t fetch feature flags, for example because you turned telemetry off, asks the server by default in any kind of session.” 自動模式分類器計費:”On a direct connection to the Anthropic API, the variable requires Claude Code v2.1.281 or later.” 設定參考:attribution “or false to hide all attribution. The false value requires Claude Code v2.1.281 or later”;maxProseWidth、deniedModels 與 availableModelsMatch 條目;「Variables Claude Code ignores in env」之下的 OpenTelemetry 群組。LLM 閘道協定:”Direct connection to the Anthropic API: sent by default”。Skills:保留的 anthropic-skills 名稱。設定參考現在也記載了 spinnerTipsOverride 的 tipsFile 與提示物件(”Tip objects, tipsFile, label, and the Scope line’s rule … require Claude Code v2.1.247 or later”),以及 timeFormat 與 timeZone 鍵。 ↩

  10. Claude Code 正式 CHANGELOG,2.1.303 至 2.1.310 各節,擷取日期為2026年10月23日(太平洋時間17:20),以及同時讀取的 @anthropic-ai/claude-code npm 登錄檔中繼資料:2.1.303 於10月18日 21:15 UTC 發布,2.1.304 於10月19日 19:47 UTC,2.1.305 於10月20日 19:29 UTC,2.1.306 於10月21日 02:28 UTC,2.1.307 於10月21日 20:47 UTC,2.1.308 於10月22日 04:19 UTC,2.1.309 於10月22日 20:34 UTC,2.1.310 於10月23日 21:20 UTC;dist-tags 為 latest 2.1.310、next 2.1.310、stable 2.1.308。GitHub 各版本分別包含 1、76、38、2、43、1、79 與 26 個條目,與 CHANGELOG 一致。本指南中所有 v2.1.303 至 v2.1.310 項目的來源。

    重要引文,2.1.304:「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」;「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 a warning on Pro and Max plans when resuming an inactive conversation would use a noticeable share of your 5-hour usage limit」;「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」;「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」;「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」。

    2.1.305:「Added sandbox.allowNestedUserNamespaces so sandboxed commands on Linux can create user namespaces (Chromium, rootless podman); this lets them get around the sandbox’s file protections」;「Added CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS so unattended retry mode (CLAUDE_CODE_RETRY_WATCHDOG) notices a usage limit that was lifted before its reset」;「Fixed every request failing on Vertex, Bedrock and other providers when the endpoint or a gateway rejects tool search, and behind gateways with ToolSearch disallowed or left out of --tools (a 2.1.304 regression): Claude Code now retries without it」;「Improved /usage: each warning is now a one-line fix that names its source, and f applies the fixes; the same fixes appear in VS Code and /doctor」;「Changed allowedMcpServers to stop filtering managed-mcp.json stdio servers that use ${VAR} only in env: one your allowlist left out now loads on upgrade; use deniedMcpServers to keep it off」。

    2.1.307:「Added /claude-api api-version to move Claude API code to API version 2026-10-21」;「Added the claude_code.safety_event OpenTelemetry event for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back」;「Improved fork subagents launched together: each is now told which launch is its own, so forks are much less likely to try to start each other’s work」;「[Code Review] Added @claude review stop (also off and pause) to Code Review, ending an @claude review always subscription on a pull request without starting a new review」。2.1.309:「Fixed sandboxed Bash commands on macOS and Linux running the shell’s startup files outside the sandbox before each command」;「Changed sed -i to get the standard Bash prompt and run as written, not a simulated file-edit preview; like other Bash edits, it is no longer restored by /rewind」;「Changed claude ultrareview to require workspace trust: it asks on a terminal, else refuses; scripts pass --trust-workspace, which takes no value (put a PR number or base branch before it), or set CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK=1」;「Fixed sessions compacting repeatedly after reading files under a very large nested CLAUDE.md; a nested CLAUDE.md over the size limit now loads only its start」;「Changed worktree creation and reuse so git no longer fetches objects on demand, in ordinary clones and in partial clones with a Bash sandbox configured; such a partial clone fetches them first」。

    2.1.310:「Added the Monitor tool and plugin monitors on Bedrock, Vertex, and Foundry, and when telemetry or nonessential traffic is disabled; long foreground sleeps are now blocked there too」;「Fixed requests failing behind some gateways and compatible servers that reject the effort-2025-11-24 beta value or mid-conversation system messages; Claude Code now retries without them」;「Linux: Improved /sandbox and the sandbox startup warning to name Ubuntu’s AppArmor restriction on user namespaces, and how to lift it, when it keeps bubblewrap from starting the sandbox」。 ↩

  11. Claude Code 文件,擷取於2026年10月23日。現已正式記載:環境變數列出 CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS、CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK(「請在啟動 Claude Code 的環境中設定,而非設定檔的 env」)、CLAUDE_CODE_AUTO_COMPACT_WINDOW(「200k 這類帶後綴的值需要 v2.1.304 或更新版本」)以及 CLAUDE_CODE_AUTO_MODE_MODEL(「請使用完整的模型 ID」),並改稱 CLAUDE_CODE_FORK_SUBAGENT「控制 fork 模式,該模式預設開啟」;設定參考列出 sandbox.allowNestedUserNamespaces(「使用者或受管」);auto mode 設定頁面寫有「使用 /auto-mode-setup 產生環境項目」;費用頁面:「當 /usage 頁尾顯示 f to fix 2 of 3 這類提示時,按下 f 即可讓 Claude Code 執行它能處理的建議。f 快捷鍵需要 Claude Code v2.1.305 或更新版本」;斜線指令列出 /claude-api api-version(「v2.1.307 或更新版本」)與 managed-agents-secure [<agent-id>];監控列出 safety_event 與 classifier_verdict(「需要 Claude Code v2.1.301 或更新版本」);

    ultrareview頁面記載了 --trust-workspace(「不接受任何值:請將 PR 編號或基底分支放在它前面」)以及 Error: Workspace not trusted 的結束狀態;程式碼審查頁面列出 Quick、Standard 與 Deep 三個層級;hooks載有 1,024 個 hook 與 16,384 字元的上限;mods 參考將 e.isReadOnly 標註為「v2.1.304 或更新版本」;沙箱頁面載有 Ubuntu AppArmor 設定檔;而權限模式表格現在寫為「claude -p 或 Agent SDK | default」,與 v2.1.302 一致。仍僅見於發行說明的有:decider: "person"、settings.read 層級、@claude review stop、sed -i 的變更、自訂 base URL 下的工具搜尋預設行為、Pro 與 Max 方案的工作階段恢復警告、--checkout-hook-timeout-min、multiagent_20261001、CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS、Claude Design 的結束日期,以及 mod 新增的 $.env.set、virtualText、$.ui.view 與 prompt.change;advisor頁面仍寫著該工具「無法在 Amazon Bedrock、AWS 上的 Claude Platform、Google Cloud 的 Agent Platform 或 Microsoft Foundry 使用」。 ↩

  12. 使用 skills 擴充 Claude,Claude Code 文件,擷取於2026年11月10日:「Claude 會在相關時使用 skills,您也可以用 /skill-name 直接呼叫」;「自訂指令已併入 skills。您現有的 .claude/commands/ 檔案仍可繼續使用。」以及術語表中的「位於 .claude/commands/deploy.md 的檔案與位於 .claude/skills/deploy/SKILL.md 的檔案都會建立 /deploy,運作方式相同;現有的指令檔案仍可繼續使用。」;「所有欄位皆為選用。僅建議填寫 description」;「在 skill 清單中,description 與 when_to_use 合併後的文字會在 1,536 個字元處截斷」;「allowed-tools 欄位會在呼叫該 skill 的回合中,授予所列工具的權限,因此 Claude 可以使用這些工具,而不必詢問您是否核准」;「它不會限制哪些工具可用:每個工具都仍可呼叫,未列出的工具仍受您的權限設定管控」;「若要在 skill 啟用期間將工具從 Claude 的可用工具中移除,請將它們列在 skill frontmatter 的 disallowed-tools 中」;frontmatter 參考表格(20 個欄位,皆非必填),以及「在 Claude Code 以外使用 skill frontmatter」表格,該表格將 claude.ai 上傳與 Skills API 限定為 name、description、license、compatibility、metadata 與 allowed-tools。2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。 ↩↩↩↩↩↩↩↩↩↩↩↩

  13. 使用 skills 擴充 Claude,Claude Code 文件,擷取於2026年11月11日:「Skill(anthropic-skills:pdf) 會核准同步的 pdf skill」;「Skill(anthropic-skills *) 會核准所有同步的 skills」;「使用 --debug 執行即可檢視剖析錯誤」;「專案 skills 使用 claude plugin validate .claude/skills,個人 skills 使用 claude plugin validate ~/.claude/skills。需要 Claude Code v2.1.233 或更新版本。」Hooks 參考,同日:「執行 claude --debug 並讀取位於 ~/.claude/debug/<session-id>.txt 的日誌。--debug 旗標不會輸出到終端機。」 ↩↩↩

  14. Claude Code CHANGELOG,2.1.0 章節,擷取於2026年11月11日:「Added support for running skills and slash commands in a forked sub-agent context using context: fork in skill frontmatter」。使用 skills 擴充 Claude,Claude Code 文件,同日,frontmatter 參考:「設為 fork 即可在 fork 出來的 subagent 上下文中執行。」 ↩

  15. Skill 撰寫最佳實務,Claude API 文件,擷取於2026年11月11日:「即使在 Windows 上,檔案路徑也一律使用正斜線」。 ↩

  16. 使用 skills 擴充 Claude,Claude Code 文件,擷取於2026年11月11日。關於 ${CLAUDE_SKILL_DIR}:「包含該 skill 之 SKILL.md 檔案的目錄」;「在 bash 注入指令中使用它來參照與 skill 一同打包的指令碼或檔案,不受目前工作目錄影響」;「指令碼路徑使用 ${CLAUDE_SKILL_DIR},因此無論 skill 安裝在個人、專案或 plugin 層級,都能正確解析」,出自一個執行 python3 ${CLAUDE_SKILL_DIR}/scripts/visualize.py . 的範例。關於指令:「Claude Code 會在工作階段 shell 的目前工作目錄中執行每道指令」。關於輔助檔案:「從 SKILL.md 參照輔助檔案,讓 Claude 知道每個檔案包含什麼內容以及何時載入」,連結寫成 [reference.md](reference.md)。關於 context: fork:「在下列這類情況下,即使 skill 沒有設定 background: false,Claude Code 也會等待結果」,其中第一種是「在非互動模式中,使用 -p 旗標或 Agent SDK 時」。 ↩↩↩

  17. 設定權限,Claude Code 文件,擷取於2026年11月11日:「像 Bash 這樣的裸工具名稱會將該工具從 Claude 的上下文中完全移除,因此 Claude 根本看不到它」;「像 Bash(rm *) 這樣有範圍的規則會讓工具保持可用,並在 Claude 嘗試相符的呼叫時加以封鎖」;關於裸 WebFetch 拒絕規則:「Claude Code 會移除 WebFetch 工具,因此 Claude 完全無法擷取」;「會拒絕以 git push 開頭的指令。以其他方式撰寫的推送,例如 git -C . push,不會被比對到」;「它不會比對以其他形式呼叫的同一個程式,因此拒絕或詢問規則涵蓋的是 Claude 通常產生的呼叫方式,並非針對該程式的安全邊界。」設定 auto mode,同日:「Claude 以其他方式撰寫的推送,例如 git -C <dir> push 或 git -c <key>=<value> push,不會符合該規則」。使用 skills 擴充 Claude,同日:「若要在所有 skills 與提示中封鎖工具,請在權限設定中加入拒絕規則。」 ↩

  18. Claude Code CHANGELOG,v2.1.323 至 v2.1.332,擷取於2026年11月25日(2.1.323、2.1.325、2.1.326、2.1.327、2.1.328、2.1.329、2.1.330、2.1.331 與 2.1.332 分別有 294、139、367、173、144、130、142、135 與 150 條最上層項目;沒有 2.1.324 章節),以及 GitHub 發行版本 v2.1.323(2026-11-12T22:12:13Z)、v2.1.325(11-13T20:40:01Z)、v2.1.326(11-16T22:11:05Z)、v2.1.327(11-17T23:17:45Z)、v2.1.328(11-19T01:14:04Z)、v2.1.329(11-19T22:14:41Z)、v2.1.330(11-20T22:32:56Z)、v2.1.331(11-23T21:34:41Z)與 v2.1.332(11-25T01:32:14Z);不存在 v2.1.324 發行版本。npm 發布時間取自 npm view @anthropic-ai/claude-code time:2.1.323 為 2026-11-12T20:29:28Z、2.1.324 為 11-13T18:42:36Z、2.1.325 為 11-13T20:07:25Z、2.1.326 為 11-16T18:43:39Z、2.1.327 為 11-17T20:33:19Z、2.1.328 為 11-18T23:09:39Z、2.1.329 為 11-19T18:40:25Z、2.1.330 為 11-20T19:16:01Z、2.1.331 為 11-23T18:36:26Z、2.1.332 為 11-24T22:06:38Z;2026-11-25 當日的 dist-tags:latest 2.1.332、next 2.1.332、stable 2.1.326。2.1.332 原文:「Changed the default model on Microsoft Foundry to Sonnet 5.5: deploy claude-sonnet-5-5, or set ANTHROPIC_DEFAULT_SONNET_MODEL to a model you have deployed」;「Changed the sonnet model alias on Google Cloud’s Agent Platform and Microsoft Foundry to Sonnet 5.5, and Foundry’s opus alias to Opus 5.5; sonnet on Amazon Bedrock stays at Sonnet 4.5」;「Added a PreSkillShellCommand hook event that can refuse a skill or command’s inline shell commands as it loads; on 2.1.331 and older, a settings file naming it opens a dialog at start」;「Added skills from MCP servers (beta). They show as server:skill in the / menu; other skills keep their names」;「Changed /schedule, permission prompts and /loop’s cloud offer to say “cloud scheduled task” instead of “routine” or “cloud schedule”; /routines still works」。2.1.330:「Changed recurring scheduled tasks and /loop to run up to 30 days instead of 7 while their session keeps running, and say when they end; tasks made before this release still end at 7 days」。2.1.328:「Added auto mode for Claude Opus 4.6 and Sonnet 4.6 on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry and Claude apps gateway; interactive sessions with no permission mode start in it」。2.1.325:「Changed sandboxed Bash commands to follow the normal permission flow by default; set sandbox.autoAllowBashIfSandboxed: true to keep running them without prompts」。2.1.323:「Added Code Mode, an experimental opt-in in which Claude writes JavaScript to call its tools」;「Removed the subagentStatusLine setting: subagent rows always use the default look, and settings files that still hold the key load as before」;「Changed the context window assumed for a model ID that Claude Code doesn’t recognize from 200K to 1M; use /autocompact to compact earlier, or CLAUDE_CODE_DISABLE_1M_CONTEXT=1 to keep 200K」;「Changed MCP_SDK_GENERATION=v1 to run the v2 MCP client in a compatibility mode (earlier handshake, relaxed OAuth sign-in checks), because the v1 MCP client is removed」。 ↩↩

  19. Hooks 參考,Claude Code 文件,擷取於2026年11月25日(事件表格中有 34 列)。PreSkillShellCommand:「在注入指令(即 skill 或 /security-review 等指令載入時執行的 shell 指令)之前執行。PreToolUse hooks 不會對注入指令觸發。」;「需要 Claude Code v2.1.332 或更新版本,在桌面應用程式與 VS Code 擴充功能中亦同。」;「v2.1.331 等較早版本會在每個互動式終端機工作階段開啟時顯示警告對話框:Unknown hook event "PreSkillShellCommand" was ignored」;「若您在此事件上設定 prompt 或 agent hook,Claude Code 無法執行它,並會封鎖該 hook 比對到的每道指令。」;「您的指令碼會在注入指令的權限檢查之後執行,因此會收到通過檢查的指令。它在 bypassPermissions 模式下也會執行。」;「您可以從此 hook 封鎖指令,但無法核准或變更指令。」失敗時:「在 command、http 或 mcp_tool hook 上設定 "onFailure": "block"。需要 Claude Code v2.1.295 或更新版本。在 mcp_tool hooks 上,onFailure 需要 v2.1.328 或更新版本。」重複使用指令碼:「您可以重複使用『Hook 的解析方式』中的封鎖指令碼。」;「若要在兩個事件上使用同一個指令碼,請將 hookEventName 保留為 PreToolUse。」;「Hook 的解析方式」一節中印出的指令碼儲存為 .claude/hooks/block-rm.sh,該頁面並補充「安裝 jq,並確認它位於您的 PATH 上」。 ↩

  20. 透過 MCP 將 Claude Code 連接至工具與環境變數,Claude Code 文件,擷取於2026年11月25日。MCP skills:「MCP skills 目前為公開測試版,需要 Claude Code v2.1.331 或更新版本。」;「skill 的名稱為 <server>:<skill>。」;「在 auto mode(預設)中,Claude 載入 MCP skill 時您不會看到提示。由分類器決定是否載入該 skill,且不會讀取其內容。」;「在 Pro、Max 或 Ultra 方案上以 /login 登入時,MCP skills 為開啟。在 Team 或 Enterprise 方案上以 /login 登入時,則在您的組織開啟之前維持關閉。」;「Anthropic 不會掃描來自其他連接器或伺服器的 skills,包括以 claude mcp add 新增的 Directory 伺服器。」;「Skills 可以指示 Claude 執行程式碼。伺服器隨時可以變更 skills。請只新增您信任的伺服器。」關於 add-json:「若要以管線傳入 JSON,請在其位置傳入 -:cat server.json | claude mcp add-json <name> -。請在 Claude Code 工作階段之外執行此指令。需要 Claude Code v2.1.327 或更新版本。」環境變數,MCP_SDK_GENERATION:「固定此程序用來連接 MCP 伺服器的 MCP 用戶端執行環境:v1,建構於 MCP TypeScript SDK 1.x;或 v2」。 ↩

  21. 使用 skills 擴充 Claude,Claude Code 文件,擷取於2026年11月25日,frontmatter 參考,model:「接受 /model 的值,或以 inherit 表示使用中的模型。當 Claude 執行該 skill 時,工作階段會保留其模型。」;「搭配 context: fork 時,此值為 fork 出來的 subagent 在每次呼叫時使用的模型。」 ↩