[BUG] Agents cannot discover plugin-scoped slash commands - namespace resolution fails
Preflight Checklist
Environment
- Claude Code Version: 2.0.31+
- Platform: macOS (Darwin 24.6.0)
- OS: macOS
- Plugin System: Using plugin marketplace with custom plugins
Problem Statement
When agents (launched via @mention or Task tool) attempt to use slash commands from plugins, they cannot discover the plugin-scoped command names. Agents try to use short names like /docs, /task, /commit but these commands are actually namespaced as /general:docs, /general:task, /general:commit when they come from a plugin.
This creates a fundamental disconnect between:
- User experience: Commands work fine when typed directly (
/general:docs)
- Agent experience: Agents fail when trying to use the same commands
What's Wrong?
Current Behavior
When an agent's documentation says:
Use /docs to search documentation
Use /task to plan implementation
The agent tries to execute:
Result: Error: Unknown slash command: docs
Root Cause
Slash commands from plugins are namespaced with the plugin name:
- Plugin:
general@personal
- Command file:
commands/docs.md
- Actual command name:
/general:docs (not /docs)
Agents don't have access to:
- The plugin command registry
- Namespace resolution mechanism
- Available command discovery
This is similar to issue #7152 but specific to the plugin namespace problem.
What Should Happen?
Agents should be able to:
- Discover plugin-scoped commands - know that
/general:docs exists
- Resolve short names - understand that
/docs in context means /general:docs
- Access command registry - see all available commands with their full names
OR
The SlashCommand tool should accept both:
- Full names:
/general:docs (currently works)
- Short names:
/docs (resolve to /general:docs if unambiguous)
Steps to Reproduce
-
Create a plugin with slash commands:
marketplaces/personal/general/
├── .claude-plugin/plugin.json
└── commands/
├── docs.md
├── task.md
└── commit.md
-
Install the plugin: claude plugin install general@personal
-
Create an agent that references commands:
---
name: offload
---
## How to Use
Execute commands like:
- /docs to search documentation
- /task to plan work
-
Launch the agent: @offload /docs fastmcp
-
Expected: Agent uses /general:docs fastmcp
-
Actual: Agent tries /docs and fails with "Unknown slash command"
Impact
This breaks agent workflows that rely on slash commands from plugins:
Affected Use Cases
- Documentation research agents - can't use
/general:docs
- Task planning agents - can't use
/general:task
- Commit automation - can't use
/general:commit
- Any agent in a plugin referencing other plugin commands
Current Workarounds
Option 1: Manually specify full names in agent documentation
Use /general:docs to search documentation # Not /docs
Use /general:task to plan implementation # Not /task
Problem: This is error-prone and non-obvious to plugin developers
Option 2: Use direct tool calls instead
Use mcp__context7__get-library-docs instead of /general:docs
Problem: Bypasses the slash command abstraction, couples to implementation
Option 3: Don't use agents with plugin commands
Problem: Severely limits plugin utility
Expected Behavior
Solution 1: Command Registry Exposure
Expose available commands to agents via context or tool:
// Agent has access to:
{
"available_commands": [
{ "name": "/general:docs", "short_name": "docs", "plugin": "general@personal" },
{ "name": "/general:task", "short_name": "task", "plugin": "general@personal" },
// ...
]
}
Agents can then intelligently resolve /docs → /general:docs.
Solution 2: Namespace Resolution in SlashCommand Tool
The SlashCommand tool could resolve short names:
# User types: /docs fastmcp
# SlashCommand tool resolves to: /general:docs fastmcp
# If multiple matches exist, ask for clarification
Solution 3: Plugin Context Inheritance
Agents launched from plugin context inherit the plugin's namespace:
# In general@personal plugin
# Agent can use /docs (implicitly means /general:docs)
Related Issues
Additional Context
This issue becomes critical when:
- Building modular plugin architectures
- Creating reusable agent libraries
- Sharing plugins across teams
Plugin developers currently must choose between:
- Not using slash commands in agents (lose functionality)
- Hardcoding full namespace in docs (fragile, unclear)
- Avoiding agent-to-agent command delegation (limits composition)
Proposed Priority
High - Blocks effective use of plugin marketplace for agent-driven workflows
Test Scenarios
- Agent in
general@personal uses /docs → resolves to /general:docs ✓
- Agent uses
/docs when two plugins provide it → asks for clarification ✓
- Agent lists available commands → sees all plugin commands with namespaces ✓
- SlashCommand tool with short name → resolves unambiguous matches ✓
- Plugin disabled → its commands not available to agents ✓
Environment Details
Plugin Structure:
~/.claude/marketplaces/personal/general/
├── .claude-plugin/
│ └── plugin.json
├── commands/
│ ├── docs.md # Creates /general:docs
│ ├── task.md # Creates /general:task
│ └── commit.md # Creates /general:commit
├── agents/
│ └── offload.md # Tries to use /docs, /task
└── .mcp.json
Settings:
{
"enabledPlugins": {
"general@personal": true
}
}
Commands work when typed directly:
/general:docs fastmcp ✓ Works
/docs fastmcp ✗ "Unknown slash command"
Same command in agent fails:
@offload /docs fastmcp → Agent tries /docs → Fails
[BUG] Agents cannot discover plugin-scoped slash commands - namespace resolution fails
Preflight Checklist
Environment
Problem Statement
When agents (launched via
@mentionor Task tool) attempt to use slash commands from plugins, they cannot discover the plugin-scoped command names. Agents try to use short names like/docs,/task,/commitbut these commands are actually namespaced as/general:docs,/general:task,/general:commitwhen they come from a plugin.This creates a fundamental disconnect between:
/general:docs)What's Wrong?
Current Behavior
When an agent's documentation says:
The agent tries to execute:
Result:
Error: Unknown slash command: docsRoot Cause
Slash commands from plugins are namespaced with the plugin name:
general@personalcommands/docs.md/general:docs(not/docs)Agents don't have access to:
This is similar to issue #7152 but specific to the plugin namespace problem.
What Should Happen?
Agents should be able to:
/general:docsexists/docsin context means/general:docsOR
The SlashCommand tool should accept both:
/general:docs(currently works)/docs(resolve to/general:docsif unambiguous)Steps to Reproduce
Create a plugin with slash commands:
Install the plugin:
claude plugin install general@personalCreate an agent that references commands:
Launch the agent:
@offload /docs fastmcpExpected: Agent uses
/general:docs fastmcpActual: Agent tries
/docsand fails with "Unknown slash command"Impact
This breaks agent workflows that rely on slash commands from plugins:
Affected Use Cases
/general:docs/general:task/general:commitCurrent Workarounds
Option 1: Manually specify full names in agent documentation
Problem: This is error-prone and non-obvious to plugin developers
Option 2: Use direct tool calls instead
Problem: Bypasses the slash command abstraction, couples to implementation
Option 3: Don't use agents with plugin commands
Problem: Severely limits plugin utility
Expected Behavior
Solution 1: Command Registry Exposure
Expose available commands to agents via context or tool:
Agents can then intelligently resolve
/docs→/general:docs.Solution 2: Namespace Resolution in SlashCommand Tool
The SlashCommand tool could resolve short names:
Solution 3: Plugin Context Inheritance
Agents launched from plugin context inherit the plugin's namespace:
Related Issues
Additional Context
This issue becomes critical when:
Plugin developers currently must choose between:
Proposed Priority
High - Blocks effective use of plugin marketplace for agent-driven workflows
Test Scenarios
general@personaluses/docs→ resolves to/general:docs✓/docswhen two plugins provide it → asks for clarification ✓Environment Details
Plugin Structure:
Settings:
{ "enabledPlugins": { "general@personal": true } }Commands work when typed directly:
/general:docs fastmcp✓ Works/docs fastmcp✗ "Unknown slash command"Same command in agent fails:
@offload /docs fastmcp→ Agent tries/docs→ Fails