Skill mis-trigger loads ~775K-char reference doc into context for a simple usage-tracking question
Title: Skill mis-trigger loads ~775K-char reference doc into context for a simple usage-tracking question
Body:
Description
Asking Claude Code a plain question about tracking credit/usage across machines ("how do I see Claude Code usage breakdown per API key or device") incorrectly triggers the claude-api skill (intended for "building LLM-powered applications with Claude"), rather than being treated as a meta-question about Claude Code itself.
The claude-api skill's base reference file is loaded in full as the tool result — in the observed transcript this was 775,161 characters (~299,218 cache_creation_input_tokens in a single turn). This consumed a large fraction of the session's usage limit for a question that had nothing to do with building an LLM application.
Steps to reproduce
- In a Claude Code session, ask something like: "Claude API / Claude Code credit usage tracking across multiple machines - how to see usage breakdown per API key or per device in the Anthropic Console, and Claude Code's own cost/usage commands"
- Observe that the
claude-apiskill is invoked via the Skill tool. - Observe the tool_result content length / cache_creation_input_tokens for that turn (~300K tokens in our case).
Expected behavior
A question about Claude Code's own usage/cost tracking (not about building an app with the Claude API) should not trigger the claude-api skill, or the skill's trigger heuristics should more precisely match "building an LLM app" intent vs. "how much have I spent" intent. At minimum, the skill's reference material should not be loaded in full (775K chars) for what is effectively a keyword collision.
Impact
Silently consumes a large percentage of the user's rolling session usage limit (e.g., Pro/Max 5-hour window) with no visible benefit — the user did not ask Claude to write any code and received no relevant answer from that context load.
Environment
- Claude Code CLI
- Reported via session transcript analysis (
~/.claude/projects/.../*.jsonl), single turn withcache_creation_input_tokens: 299218,tool_resulttext length 775,161 chars for theclaude-apiskill invocation.