Plugin agents incorrectly listed in Skill tool's available_skills
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
/agentsinterface - Be invokable via Task tool with
subagent_typeparameter - NOT appear in the Skill tool's
available_skillslist
Actual Behavior
Plugin agents appear in BOTH places:
- Task tool's subagent_type documentation (correct)
- Skill tool's
available_skillslist (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
- Create a plugin with this structure:
````
my-plugin/
├── .claude-plugin/
│ └── plugin.json
├── agents/
│ └── my-agent.md # Subagent
└── commands/
└── my-command.md # Slash command
- 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...
```
- Install the plugin and start Claude Code
- Observe the
available_skillsshown to Claude — it includes both:
my-plugin:my-command(correct — this is a command)my-plugin:my-agent(incorrect — this is an agent)
- When Claude tries to invoke the agent, it may incorrectly use
Skill(skill="my-plugin:my-agent")because it appears inavailable_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:
- Only add
commands/*.mdfiles to the Skill tool'savailable_skills - Only add
agents/*.mdfiles to the Task tool's subagent_type list - 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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗