claude-api skill's trigger condition is too broad, causing massive unnecessary token overhead

Status Fixed / completed
Maintainer reply None cached
Activity 1 comment · opened Jul 25, 2026 · closed Aug 20, 2026

The claude-api skill has this trigger rule:

whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, anthropic, @anthropic-ai, claude-*, ...)

This fired on a request that was simply: "give me an overview of this article and how I should apply it", linking to a blog post about context engineering for Claude models. The task was pure summarization/reading comprehension — no code, no API integration, no SDK question.

Because the trigger matched, the skill loaded its entire bundled reference library as one tool result: full SDK docs for Python/TypeScript/Go/Java/Ruby/C#/PHP/cURL (tool use, streaming, batches, files API), the complete Managed Agents docs (core concepts, events, multiagent, memory stores, webhooks, self-hosted sandboxes, API reference), the full model-migration guide, model catalog, prompt-caching guide, error-codes reference, etc. — roughly 15,000+ lines of markdown, ~300k tokens.

That single load consumed 32% of a 967k-token context window for a task that needed zero of that content.

Suggestion: Narrow the trigger to require actual API/SDK/code intent (e.g., "generate code," "which model," "pricing," "rate limit," "tool use," provider comparison) rather than any bare mention of a model family name. A request to discuss/summarize a Claude-related blog post, news article, or general question about Claude-as-a-product shouldn't need the SDK reference dump. Alternatively, make the initial load lazy/tiered (load only the section relevant to the detected intent) rather than the full multi-language bundle every time.

View original on GitHub ↗

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