claude-api skill over-triggers on any Claude model mention, injecting ~400k+ tokens of unrelated SDK docs into context

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 2 comments · opened Aug 3, 2026

Environment

  • Claude Code version: 2.1.220
  • Platform: macOS (Darwin 25.5.0)
  • Project type: non-code (Obsidian markdown vault, no source files)

What happened

Asked two small, unrelated product questions in a fresh session:

  1. "Do I have the latest version of Claude Code?"
  2. "I can use Fable 5 in the Claude app, why can't I use it here, and why does it say it'll cost credits?"

Neither question involved writing code or using the Anthropic API/SDK. After these two exchanges, session context usage was already ~410k tokens.

Root cause

The bundled claude-api skill (bundled-skills/2.1.220/.../claude-api) has a mandatory trigger rule:

TRIGGER — read BEFORE opening the target file ... whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, ...)

Mentioning "Fable 5" in a plain product/billing question satisfied this trigger. The skill's "Language Detection" step found no project language (correct, since the working directory has no source files), and its fallback behavior in that case is to inline its entire reference documentation into context — full per-language SDK guides (Python, TypeScript, Go, Java, Ruby, PHP, C#, cURL) plus every shared/*.md file (migration guide, managed agents overview + ~15 sub-topics, prompt caching, tool-use concepts, model catalog, platform availability, etc.).

This is many hundreds of thousands of tokens of SDK/API reference material that has no relevance to a question about model availability/billing in the Claude Code product itself.

Expected behavior

For questions that are about Claude Code / Claude product behavior (pricing, model availability, plan entitlements) rather than about writing code that calls the Anthropic API, the claude-api skill should either:

  • Not trigger at all (the claude-code-guide agent already exists and covers exactly this kind of "how do I / can Claude do X" product question, and runs in an isolated subagent context), or
  • Trigger but skip the "no language detected → dump everything" fallback, and instead ask a clarifying question or return a much smaller, targeted answer.

Suggested fix

  • Narrow the claude-api skill's keyword trigger so it doesn't fire on bare model-name mentions in non-coding contexts (e.g. gate on the presence of code/API-shaped language: "SDK", "API key", "curl", "client.messages", a source file being open, etc.)
  • When no project language is detected, avoid inlining the full multi-language doc set by default — surface a short capability summary and let the model pull specific {lang}/ files on demand instead of front-loading all of them into the main conversation transcript.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗