claude plugin eval sandbox never loads a plugin's own agents/*.md for the Agent tool
Summary
claude plugin eval never registers a plugin's own custom agents (agents/*.md) for the Agent tool inside its eval sandbox, under any target form. An eval case that dispatches subagent_type: "<plugin>:<agent-name>" fails with Agent type '<plugin>:<agent-name>' not found, regardless of whether the target is a filesystem path, an installed plugin name, or <plugin>@<marketplace>.
Expected behavior
The eval "Available tools" reference documents Agent as a grantable tool type for eval cases. A plugin that ships a skill dispatching one of its own agents, plus an eval suite covering that skill, would reasonably expect the sandbox to resolve the plugin's own agent — the way an interactive session does.
Actual behavior
The Agent tool inside the eval sandbox only ever lists the built-in agent types: claude, Explore, general-purpose, Plan, statusline-setup. A plugin's own agents/*.md are never listed or resolvable, tested under all of:
claude plugin eval <path-to-plugin>claude plugin eval <installed-plugin-name>claude plugin eval <plugin-name>@<marketplace>(via a scratch marketplace +claude plugin install)
Agent(subagent_type: "<plugin>:<agent-name>") (and the bare agent name) returns Agent type '<plugin>:<agent-name>' not found in every case.
Docs cross-check
The Plugin Evals guide states:
claude plugin eval loads the target plugin's skills and hooks and runs its eval suite on your machine, as you.
Agents are never mentioned as loaded — only skills and hooks — so this may be intended scope rather than a bug. It isn't called out explicitly, though, and it silently breaks any eval case written to exercise agent-dispatching skill behavior (no error until the eval actually runs and the dispatch fails).
Suggested fix (either resolves this)
- Load the plugin's own
agents/*.mdinto the eval sandbox's Agent tool, matching interactive-session behavior, or - Document explicitly in the Plugin Evals guide that a plugin's own custom agents are out of scope for eval sandboxes, so authors know up front to inline agent instructions into the eval prompt instead.
Related but distinct issues
- #83168 (open) — intermittent plugin-agent loading failure in interactive sessions; different symptom (intermittent, not eval-specific) and likely different root cause.
- #59881, #21841, #18982, #13605, #21560 (closed) — earlier plugin-agent loading bugs, not eval-specific.
Environment
- Claude Code CLI 2.1.280
- macOS (darwin)