[BUG] Multiple Agent(type)entries in agenttools:` frontmatter — only last entry survives
Preflight Checklist
- [x] 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
What's Wrong?
When a plugin agent's tools: frontmatter field contains multiple Agent(type) entries (comma-separated), only the last entry is retained as an available agent type. All preceding entries are silently dropped.
Example orchestrator.md:
tools: Agent(my-plugin:agent-a), Agent(my-plugin:agent-b), Agent(my-plugin:agent-c)
At runtime, only my-plugin:agent-c is available. Attempts to spawn agent-a or agent-b fail with:
Error: Agent type 'my-plugin:agent-a' not found. Available agents: my-plugin:agent-c
What Should Happen?
All three agent types (my-plugin:agent-a, my-plugin:agent-b, my-plugin:agent-c) should be available for spawning.
Error Messages/Logs
Error: Agent type 'my-plugin:agent-a' not found. Available agents: my-plugin:agent-c
Steps to Reproduce
- Create a plugin with an orchestrator agent whose frontmatter is:
---
name: orchestrator
tools: Agent(my-plugin:agent-a), Agent(my-plugin:agent-b), Agent(my-plugin:agent-c)
---
- Also define agent-a, agent-b, and agent-c in the plugin.
- Run the orchestrator: claude --agent my-plugin:orchestrator
- Ask the orchestrator to invoke agent-a via the Agent tool.
Expected: agent-a spawns successfully.
Actual: Error: Agent type 'my-plugin:agent-a' not found. Available agents: my-plugin:agent-c
Workaround: Replace all Agent(type) entries with the bare Agent keyword:
tools: Agent
This grants access to all agent types and unblocks the pipeline.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.145
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗