claude-api bundled skill inlines ~120K+ tokens of reference docs on every invoke

Resolved 💬 1 comment Opened Jul 7, 2026 by nitsanavni Closed Jul 7, 2026

What happened

Invoking the bundled claude-api skill (Claude Code 2.1.201) loads the skill's entire reference-doc corpus inline into context via <doc path=...> tags before any task work begins.

Measured on bundled-skills/2.1.201/.../claude-api:

  • ~120K tokens inline on a single invoke — all of shared/*.md plus the language-detected docs (e.g. typescript/*.md), embedded directly in the SKILL body.
  • Single worst offender: shared/model-migration.md — ~144K chars (~36K tokens) — inlined in full.
  • On-disk corpus is ~828K across all language dirs; the SKILL prose adds more on top of the ~120K.

Net effect: asking a one-line question (e.g. "how are Fable limits handled") consumes ~200K tokens of context purely from skill loading.

Why this is avoidable

The reference docs already cross-reference each other by path (e.g. "see shared/prompt-caching.md", "WebFetch the URL in shared/live-sources.md"). That's exactly the pattern for progressive disclosure — SKILL.md should stay lean and point to files the model reads on demand, rather than embedding the whole corpus in every invocation.

Expected

SKILL.md loads a small entry doc; language-specific and topic-specific .md files are read on demand.

Actual

The full shared/* + language-detected corpus is embedded in the prompt on every invoke (~120K+ tokens).

Version

Claude Code 2.1.201, bundled claude-api skill.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗