AI
Anthropic cuts Claude Code's hidden token overhead by 85%
An overloaded API reference skill was silently consuming 200,000 tokens before answering any question—until Anthropic redesigned it to load documentation on demand.
The New Stack
Anthropic's built-in Claude Code skill for API documentation was burning through massive amounts of context—bloating every interaction with more than 200,000 tokens before developers got a single answer. Version 2.1.234 cuts that hidden overhead down to roughly 25,000 tokens, freeing up 85% of the wasted context window.
The problem had been hiding in plain sight. The /claude-api skill, which provides reference material for working with Anthropic's APIs and SDKs, was bundling all its documentation directly into memory at load time. In July, a developer filing a GitHub issue found the skill embedding 120,000 tokens of reference material upfront—with a single migration document alone accounting for 36,000 tokens. A follow-up report in August revealed another case where the skill loaded documentation for eight programming languages plus 26 supporting files (812 KB total) even when only a fraction was needed for the task.
The silent context drain#
This penalty affected every prompt. Once the skill loaded, Claude would consume its entire reference library before even starting to process a user's question. As Anthropic's own guidance warns, filling the context window degrades model performance and increases error rates—a cost hidden from view because developers see only their request and response, not the bulky skill body sitting underneath.
The problem mirrors a broader pattern in AI coding tools. As token budgets become the fastest-growing cost item in agentic workflows, unchecked consumption forces teams to choose between quality and expense. Context fills silently, and earlier instructions get pushed out or forgotten.
Pulling references on demand#
Anthropic's fix shifts from loading everything upfront to fetching documentation as needed. The redesigned skill now ships with a lean core (metadata and skill instructions in SKILL.md), then retrieves additional API specs and examples only when Claude identifies they're relevant to the task.
This trade-off is deliberate: Claude may need an extra file read to pull in the right language documentation or API feature. But that single additional lookup happens only for material tied to the current work, turning a blanket 200,000-token tax into a surgical, per-task cost.
The change highlights how token optimization has shifted from academic concern to operational necessity—and why agentic systems now demand the same scrutiny on context efficiency that production pipelines received years ago.

