Plugin agents incorrectly listed in Skill tool's available_skills

Resolved 💬 3 comments Opened Jan 6, 2026 by jaredmixpanel Closed Jan 9, 2026

Summary

Plugin agents (files in agents/*.md) are incorrectly appearing in the Skill tool's available_skills list, causing Claude to attempt invoking them via the Skill tool instead of the Task tool.

Expected Behavior

According to the official subagents documentation:

Plugin agents appear in /agents alongside your custom agents Can be invoked explicitly: "Use the code-reviewer agent from the security-plugin"

Plugin agents should:

  • Appear in the /agents interface
  • Be invokable via Task tool with subagent_type parameter
  • NOT appear in the Skill tool's available_skills list

Actual Behavior

Plugin agents appear in BOTH places:

  1. Task tool's subagent_type documentation (correct)
  2. Skill tool's available_skills list (incorrect)

This causes Claude to attempt Skill(skill="plugin-name:agent-name") which fails with "Unknown skill" error, when it should use Task(subagent_type="plugin-name:agent-name").

Reproduction Steps

  1. Create a plugin with this structure:

``
my-plugin/
├── .claude-plugin/
│ └── plugin.json
├── agents/
│ └── my-agent.md # Subagent
└── commands/
└── my-command.md # Slash command
``

  1. Agent file (agents/my-agent.md) with official format:

```markdown
---
name: my-agent
description: A specialized agent for X
tools: Read, Write, Bash
model: sonnet
---

System prompt here...
```

  1. Install the plugin and start Claude Code
  1. Observe the available_skills shown to Claude — it includes both:
  • my-plugin:my-command (correct — this is a command)
  • my-plugin:my-agent (incorrect — this is an agent)
  1. When Claude tries to invoke the agent, it may incorrectly use Skill(skill="my-plugin:my-agent") because it appears in available_skills

Impact

  • Claude gets confused about which tool to use for agents vs commands
  • Skill() invocations fail with "Unknown skill" errors
  • Users have to manually correct Claude to use Task tool instead

Suggested Fix

The plugin loader should:

  1. Only add commands/*.md files to the Skill tool's available_skills
  2. Only add agents/*.md files to the Task tool's subagent_type list
  3. Not cross-list between the two

Alternatively, add a type field to the available_skills entries to distinguish agents from commands:

<skill>
  <name>my-plugin:my-agent</name>
  <type>agent</type>  <!-- NEW: indicates this is a Task subagent -->
  <location>plugin</location>
</skill>

Environment

  • Claude Code version: Latest
  • Platform: macOS

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗