Bundled claude-api skill injects entire 570KB SKILL.md (~210k tokens) into context on load
Summary
The bundled claude-api skill injects its entire SKILL.md — 570,113 characters (~210k tokens) — into the conversation as a single message when loaded. A casual one-sentence question about Claude models ballooned the session context from ~45k to ~256k tokens (26% of a 967k window) in one turn.
Environment
- Claude Code version: 2.1.201 (Windows 11, PowerShell)
- Model: claude-sonnet-5 (967k context window)
- Skill: bundled
claude-apiskill, loaded from%LOCALAPPDATA%\Temp\claude\bundled-skills\2.1.201\<hash>\claude-api
Steps to reproduce
- Start a fresh session.
- Ask a simple comparison question that mentions Claude model names, e.g. "Which has a lower tool-calling error rate, Sonnet 5 or Opus 4.8?"
- The
claude-apiskill auto-triggers (its trigger fires on any mention of Claude/Anthropic model names). - Run
/context.
Observed behavior
/context reports Messages: 221.2k tokens (22.9%) after a single Q&A turn.
Inspecting the session transcript (~/.claude/projects/.../<session>.jsonl) shows the breakdown:
| Message | Size |
|---|---|
| User question | 500 B |
| Assistant thinking + Skill(claude-api) tool_use | ~4 KB |
| Skill content injection (single text block) | 593 KB / 570,113 chars ≈ 210k tokens |
| Assistant answer | 2 KB |
API usage records in the transcript confirm it: the request before the skill load shows cache_creation_input_tokens=13980; the request right after shows cache_creation_input_tokens=210658.
The injected block starts with:
Base directory for this skill: C:\Users\dahu1\AppData\Local\Temp\claude\bundled-skills\2.1.201\...\claude-api
# Building LLM-Powered Applications with Claude
...
and inlines what appears to be the full API reference (model ids, pricing, streaming, tool use, Files API tables, migration guides, ...).
Expected behavior
Skills are supposed to use progressive disclosure: inject a compact SKILL.md index and let the model Read the specific reference files it needs. A ~210k-token single-shot injection:
- consumes a quarter of even a 1M-class context window for a casual question (and would nearly fill a 200k window),
- is billed as a ~210k-token cache write, and then rides along in every subsequent turn of the session,
- is triggered very aggressively (any mention of a Claude model name).
Suggested fix
Split the bundled claude-api skill's content into reference files loaded on demand, keeping the injected SKILL.md body to a few hundred lines — or gate the full-reference injection behind an actual coding/API-integration context instead of any model-name mention.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗