[BUG] Skill tool re-invoked after slash command already loaded skill

Open 💬 1 comment Opened Jul 3, 2026 by PaulRBerg

Preflight Checklist

  • [ ] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code
[!NOTE] This was already reported as #59363, but that issue was auto-closed for staleness (NOT_PLANNED, not fixed) with a bot comment inviting a fresh issue if still relevant. It is — filing this as the requested follow-up, with a cleaner repro that rules out the narrower cause a commenter proposed on the old issue.

What's Wrong?

When a user types a slash command for a skill with disable-model-invocation: true in its frontmatter, Claude Code correctly expands the command and injects the skill's content into context via <command-message>/<command-name> tags. But the model's system prompt also instructs it to invoke the Skill tool for any /<name> reference ("invoke the relevant Skill tool BEFORE generating any other response"). That redundant call is rejected by the harness because the skill is disable-model-invocation: true, and the error is shown to the user even though they invoked the command correctly.

A commenter on #59363 claimed this only happens after a mid-session plugin install + /reload-plugins, and that fresh sessions are unaffected. That's not accurate — this repro uses a personal (non-plugin) skill under ~/.claude/skills/, hit in a normal session with no plugin install/reload involved, so the bug is broader than previously scoped.

What Should Happen?

When a skill was already loaded via the slash-command path in the current turn, Claude Code should not fire the "invoke Skill tool" instruction again for that same invocation — either by suppressing it when a <command-name> tag is already present this turn, or by making the redundant Skill tool call a no-op success instead of a hard error.

Error Messages/Logs

Error: Skill todo-archive cannot be used with Skill tool due to disable-model-invocation

Steps to Reproduce

  1. Create or use a skill with this frontmatter (e.g. ~/.claude/skills/todo-archive/SKILL.md):

``yaml
disable-model-invocation: true
name: todo-archive
user-invocable: true
``

  1. In a normal session (no plugin installed/reloaded this session), type /todo-archive.
  2. Claude Code expands the command and injects the SKILL.md body via <command-message>/<command-name> tags — this part works.
  3. Claude follows the system prompt instruction and calls Skill(skill: "todo-archive") anyway.
  4. The harness rejects it: Error: Skill todo-archive cannot be used with Skill tool due to disable-model-invocation.
  5. Claude recovers by following the already-injected instructions directly, but the tool-call error is still surfaced to the user for what was a normal, correctly-typed slash command.

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

N/A

Claude Code Version

2.1.199 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

  • Exact OS version: macOS Tahoe v26.5.1
  • Related: #59363 (duplicate, closed stale — this issue supersedes it with a non-plugin repro), #50075, #43809, #51165
  • The Skill tool's own docstring already has a guard for this: "If you see a <command-name> tag in the current conversation turn, the skill has ALREADY been loaded — follow the instructions directly instead of calling this tool again." In practice the blanket system-prompt instruction to call Skill for any /<name> reference fires ahead of that guard.

View original on GitHub ↗

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