The New Stack:一個 Claude Code skill 開口前先吃掉 20 萬 token,官方如何降到 2.5 萬
A Claude Code skill was eating 200,000 tokens before answering a single question
摘要分析
The New Stack 2026-08-18 報導:Anthropic 自家的 /claude-api skill 在 Claude Code 2.1.201 把參考文件整包嵌進 skill 本體,使用者還沒提問就先耗掉約 20 萬 token。7 月 7 日開發者在 GitHub issue 揭露後,v2.1.234 改成按需載入,初始成本降到約 2.5 萬 token、省 85.7% 以上。文章同時說明 skills 的漸進式揭露原則:session 開始只讀 name 與 description,任務相符才載入全文。是最具體的「skill 寫法影響帳單」案例。
- skill 別把參考文件整包塞進 SKILL.md,改成需要時再讀檔
- 升級到 Claude Code v2.1.234 以上可享此修正
- 用 /context 檢查 session 開始時各 skill/MCP 佔多少 token
- 漸進式揭露:只有 name+description 常駐,其餘按需載入
- GitHub issue 是回報與追蹤這類問題的正式管道
Reported by The New Stack on 2026-08-18: Anthropic's own /claude-api skill, in Claude Code 2.1.201, embedded all of its shared reference files directly in the skill body, so roughly 200,000 tokens (about 120,000 of them reference material) were consumed before a user asked anything. A developer raised the issue on GitHub on July 7, and Anthropic's v2.1.234 fixed it by loading reference documentation on demand, bringing the initial cost down to about 25,000 tokens, an 85.7% or greater reduction. The article also explains the progressive-disclosure principle behind skills: at session start Claude reads only each skill's name and description (about 100 tokens) and loads the full instructions only when a task matches. It is the most concrete public example of how skill authoring directly affects the bill.
- Keep reference docs out of SKILL.md; load on demand
- Upgrade to Claude Code v2.1.234+
- Use /context to inspect per-skill token cost
- Progressive disclosure: only name and description are resident
- GitHub issues are the formal reporting channel
關鍵字:token 節省Claude Code skill漸進式揭露The New Stack上下文成本
來源原文:https://thenewstack.io/claude-code-token-reduction/
本頁為報導內容的摘要與分析,版權屬原媒體所有;請以原文為準。
