claude-api bundled skill (v2.1.169): aggressive auto-trigger on model name mentions causes double context compaction
Summary
The claude-api bundled skill introduced in Claude Code 2.1.169 (installed 2026-06-17) contains an aggressive TRIGGER condition that auto-invokes the skill whenever a user casually mentions Anthropic model names (Sonnet, Opus, Haiku) or asks about model performance. This caused a double context compaction and a killed session in a project where neither the user nor the assistant had any intent to use the Claude API.
Version
Claude Code 2.1.169 (bundled skills folder created: 2026-06-17 10:25 AM local time)
Steps to Reproduce
- Open Claude Code 2.1.169 on any project.
- In conversation, casually compare model context window usage -- e.g. "when I load the same file in Sonnet it jumps to 19-20% context, in Opus it was 4-6%."
- Claude auto-invokes the
claude-apiskill.
What Happened
- The bundled
claude-apiskill description includes this TRIGGER text injected into every system-reminder:
> TRIGGER -- read BEFORE opening the target file; don't skip because it "looks like a one-liner" -- whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Opus, Sonnet, Haiku, anthropic, @anthropic-ai, claude-*, us.anthropic.*); the user asks about an LLM (pricing/model choice/limits/caching) -- never answer from memory...
- The trigger fired on a casual remark comparing Sonnet vs Opus context percentages -- a meta/conversational question with no relation to API development.
- The
claude-apiskill payload is enormous (full API reference, code examples across 9 language directories). Loading it pushed the session context to 100%. - First compaction ran. The compaction summary serialized all the skill content, producing a 583 KB synthetic user message (line 41 of transcript, 583,685 chars).
- The 583 KB summary immediately re-filled the context on reload. Second compaction ran.
- User killed the session.
Impact
- Session destroyed by double compaction with no user intent to invoke the skill.
- The skill was never invoked before 2.1.169 -- same conversation patterns (comparing Sonnet vs Opus performance) had zero effect on prior versions.
- Workaround applied: local stub skill at
~/.claude/skills/claude-api/SKILL.md+ explicit CLAUDE.md rule. The bundled trigger text still appears in the system-reminder because it is baked into the harness, not a file the user can edit.
Expected Behavior
Bundled skills with auto-trigger conditions should not fire on casual mentions of model names in conversational/meta context. The trigger scope ("any mention of Sonnet, Opus, Haiku, Claude") is too broad and does not distinguish between "user is building a Claude API application" and "user is discussing model behavior."
At minimum, the trigger should require an active coding task involving the Claude API -- not a meta-discussion about the tool itself.
Suggested Fix
- Scope the TRIGGER condition to require an open file or explicit coding context involving the Anthropic SDK.
- Or provide a user-level setting to disable specific bundled skill triggers without requiring file hacks.
- The current workaround (local stub + CLAUDE.md rule) is fragile because the bundled trigger text still appears in the system-reminder every session.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗