[BUG] Plugin-namespaced agent definitions not injected for teammates (works for subagents and .claude/agents/)

Resolved 💬 5 comments Opened Mar 17, 2026 by justyn Closed May 9, 2026

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 provides agent definitions (e.g., agents/executor.md inside a .claude-plugin/ package), spawning that agent as a teammate (with team_name set) does not inject the definition into the teammate's system prompt. The teammate starts as a generic Claude Code agent with no role-specific instructions.

Two related paths work correctly:

  • The same plugin agent spawned as a subagent (without team_name) receives its definition.
  • Non-plugin definitions in .claude/agents/ (no namespace prefix) load correctly for teammates (fixed in v2.1.69).

The bug is specific to plugin-namespaced agent resolution (plugin-name:agent-name) in the teammate spawn path.

What Should Happen?

A teammate spawned with subagent_type: "my-plugin:my-agent" should receive the same agent definition that a subagent spawned with the same subagent_type receives.

How this differs from existing issues

  • #30703 and #24316 cover .claude/agents/ definitions (non-namespaced) not loading for teammates. That path now works (v2.1.69). This report is about plugin-namespaced definitions, which use a different resolution path.
  • #29441 is about skills: frontmatter not loading for teammates. This report is about the base definition (markdown body) not loading at all for plugin agents.

Steps to Reproduce

  1. Create a plugin with an agent definition at .claude-plugin/agents/my-agent.md
  2. Enable agent teams (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1)
  3. Spawn the agent as a subagent: subagent_type: "my-plugin:my-agent" without team_name. Definition loads correctly.
  4. Spawn the same agent as a teammate: subagent_type: "my-plugin:my-agent" with team_name set. Definition is missing; teammate is generic.

Error Messages/Logs

No error. The teammate spawns successfully but operates without its definition. Only observable by checking whether the teammate follows its role instructions.

Claude Model

Opus

Is this a regression?

Unknown. Plugin agents may never have worked for teammates.

Claude Code Version

2.1.69+

Platform

Anthropic API

Operating System

Linux

Terminal/Shell

bash

Additional Information

Tested in in-process teammate mode. Not tested in tmux mode.

View original on GitHub ↗

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