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

Status Fixed / completed
Reported on v2.1.199
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Jul 3, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

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 ↗

3 Comments

github-actions[bot] · 3 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/59363

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Funnypie · 2 months ago
Found 1 possible duplicate issue: 1. Skill tool redundantly invoked after slash command loads skill, fails with disable-model-invocation error #59363 This issue will be automatically closed as a duplicate in 3 days. If your issue is a duplicate, please close it and 👍 the existing issue instead To prevent auto-closure, add a comment or 👎 this comment 🤖 Generated with Claude Code

The attached issue #59363 was closed because it was open for too long (Closing comment). The issue persists. This is the only open issue related to this issue. disable-model-invocation: true does not allow for skills to be injected and forces agents to read the skill.md instead even if the user invokes the skill themselves.

bcherny collaborator · 2 months ago

Thanks for the detailed repro. I tried this on the current release 2.1.233 (Linux): created ~/.claude/skills/hello-probe/SKILL.md with disable-model-invocation: true exactly as described, then ran /hello-probe in fresh sessions (including -p "/hello-probe" --output-format stream-json --verbose to inspect tool calls), three times.

All three runs were clean: the reply was HELLO FROM SKILL with no Skill tool call and no error.

This class of problem has been addressed in recent releases — including a fix for Claude redundantly invoking the Skill tool when running slash commands directly, deduplication when a skill is re-invoked after already being loaded, and an improved refusal for disable-model-invocation skills. See the changelog.

Closing as fixed in a recent release — if you still see the error on 2.1.233 or later, please reply with the version and a --output-format stream-json --verbose capture and we'll reopen.

🤖 Generated with Claude Code

Showing cached comments. Read the full discussion on GitHub ↗