[BUG] claude-api skill trigger self-fires on /model banner (bare model names + ANSI [1m as trigger tokens)
Summary
The bundled claude-api skill's auto-activation TRIGGER self-fires on Claude Code's own /model confirmation banner. The trigger is a broad pattern match whose published trigger list includes bare model names (Fable, Opus, Sonnet, Haiku) and the literal ANSI bold escape [1m. The /model command's stdout contains both at once, so switching models in a session with no LLM-related task spuriously satisfies the trigger.
Environment
- Platform: macOS
- Surface: Claude Code CLI
- Model: Fable 5 (any model whose name/banner matches)
Repro
- In any project with no LLM/Claude-API content (e.g. an R data-analysis repo), run
/modeland pick a model. - The harness injects a local-command banner into the transcript, e.g.:
````
<local-command-stdout>Set model to [1mFable 5[22m and saved as your default for new sessions</local-command-stdout>
- On the next turn, the
claude-apiskill's TRIGGER evaluates as satisfied — it matches both the wordFableand the raw[1mbold code, both of which are explicit items in the skill's own trigger list.
The trigger text (paraphrased from the loaded skill description) instructs the model to read the claude-api skill "BEFORE opening the target file ... whenever the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, ... [1m])".
Expected
Switching models, or any appearance of the model name in harness-generated UI/banner output, should not count as a user task that activates the claude-api documentation skill.
Actual
The /model banner is indistinguishable, to the substring trigger, from a genuine "help me build against the Claude API" request. It's a false positive driven by (a) bare single-token model names and (b) the ANSI escape [1m being treated as a trigger token. The cost is a spurious instruction to load a large documentation skill (related context-bloat reports: #63566, #63415) on an unrelated task.
Suggested fixes
- Exclude harness-generated content (
<local-command-stdout>,/modelbanners, system reminders) from skill-trigger matching, or match only against actual user-authored prompt text. - Remove ANSI control codes (
[1m,[22m, etc.) as trigger tokens — they only ever appear in terminal formatting, never in a user's substantive request. - Require model-name tokens to co-occur with API/SDK context rather than matching bare names, or gate eager activation behind something like the proposed
auto_invokeflag (#46383).
Notes
Caught on Claude Code CLI, model Fable 5. Full session JSONL available on request via a private channel (not attached here because it embeds personal global CLAUDE.md content).
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗