[BUG] Skills with disable-model-invocation: true only visible to LLM when slash command is at message start
Bug Description
When a skill has disable-model-invocation: true in its frontmatter, the LLM can only see the skill content (via <command-name> and <command-message> tags) if the slash command is placed at the start of the user's message. If the slash command appears anywhere else in the message, the LLM doesn't receive the skill context.
Environment
- Platform: Linux
- Claude Code version: Latest (2026-01-21)
Steps to Reproduce
- Create a skill with
disable-model-invocation: truein frontmatter - Test 1: Send message starting with the slash command:
```
/my-skill Do something
<command-name>
Result: ✅ LLM receives and <command-message>` tags and can see skill content
- Test 2: Send message with slash command elsewhere:
````
Do you see the skill I am about to invoke? /my-skill
Result: ❌ LLM does NOT receive the tags and cannot see skill content
Expected Behavior
The position of the slash command in the message should not affect whether the LLM receives the skill context. If disable-model-invocation: true is meant to prevent the LLM from autonomously invoking the skill (via the Skill tool), it should still receive the skill content when the user explicitly invokes it via slash command, regardless of message position.
Actual Behavior
Skill context is only loaded when the slash command is at the beginning of the message. This creates inconsistent behavior and makes it difficult to naturally reference or ask questions about skills mid-sentence.
Impact
- Forces unnatural message formatting (slash command must be first)
- Prevents asking questions about skills (e.g., "Can you see /my-skill?")
- Creates confusion about when skills are actually loaded
- Inconsistent with how user-invoked commands should work
Related Configuration
This specifically affects skills with:
---
disable-model-invocation: true
---
The disable-model-invocation flag is intended to prevent autonomous invocation by the LLM, not to make skill loading position-dependent for user invocations.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗