[BUG] Plugin install matches wrong marketplace when same plugin name exists in multiple marketplaces
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 with the same name exists in multiple marketplaces (e.g., superpowers in both claude-plugins-official and superpowers-marketplace), the install command:
- Matches on plugin name only, ignoring the marketplace qualifier
- Reports the wrong marketplace in error messages
- Refuses to install even with fully-qualified name
User explicitly requests superpowers@superpowers-marketplace but error refers to superpowers@claude-plugins-official.
Important context: This issue was encountered while installing plugins on a per-repository basis (project/local scope), not globally. Per-repository plugin installation is a valid and important use case that should be well-supported. Currently, the behavior is flaky - sometimes it works, sometimes it doesn't, even with identical steps. This issue may also affect users installing plugins globally, but the per-repository workflow is where issue repetitively occurs one some repositories, on some not... therefore on one hand flaky, on the other when on one repository installation works and on another later does not work no matter if uninstalling/installing of marketplace/plugins and other strategies are applied it leaves it problematic.
How this differs from related issues:
| Issue | Focus | This Issue |
|-------|-------|------------|
| #14202 | projectPath scope not checked | ✓ Plus wrong marketplace name |
| #20390 | "already installed" for different projects | ✓ Plus marketplace confusion |
The error message explicitly names the wrong marketplace, indicating resolution logic matches superpowers@* instead of the exact qualified name.
What Should Happen?
The plugin resolution should use the full qualified name including marketplace:
- Input:
superpowers@superpowers-marketplace - Should match:
superpowers@superpowers-marketplace(exact) - Should NOT match:
superpowers@claude-plugins-official(different plugin)
If the exact plugin is installed for a different project, it should either:
- Prompt for scope choice, OR
- Install for current project
Error Messages/Logs
❯ /plugin install superpowers@superpowers-marketplace
⎿ Plugin 'superpowers@claude-plugins-official' is already installed. Use '/plugin' to manage
existing plugins.
State of ~/.claude/plugins/installed_plugins.json:
{
"superpowers@superpowers-marketplace": [
{ "scope": "local", "projectPath": "/path/to/project-a" }
],
"superpowers@claude-plugins-official": [
{ "scope": "local", "projectPath": "/path/to/project-b" }
]
}
Both entries exist with different marketplaces, but install matches wrong one.
Steps to Reproduce
- Add two marketplaces that both contain a plugin with the same name:
````
/plugin marketplace add obra/superpowers-marketplace
# claude-plugins-official already has superpowers
- Install the plugin from marketplace A for project A:
````
cd /project-a
/plugin install superpowers@superpowers-marketplace
# Select project scope
- Install the plugin from marketplace B for project B:
````
cd /project-b
/plugin install superpowers@claude-plugins-official
# Select project scope
- Try to install from marketplace A for project C:
````
cd /project-c
/plugin install superpowers@superpowers-marketplace
- Observe: Error says
superpowers@claude-plugins-officialis installed (wrong marketplace)
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.19 (Claude Code)
Platform
Anthropic API
Operating System
Linux
Terminal/Shell
tmux
Additional Information
Root Cause Hypothesis:
The plugin lookup logic appears to:
- Extract plugin name from qualified name (
superpowersfromsuperpowers@superpowers-marketplace) - Search for any key matching
superpowers@* - Return first match regardless of marketplace suffix
Suggested Fix:
Use exact string matching for the full qualified plugin name when checking installation status.
Workaround:
Manually edit ~/.claude/plugins/installed_plugins.json to add project entry, plus create .claude/settings.json with enabledPlugins. See issue #14185 for detailed steps.
Related Issues:
- #14202 - projectPath scope confusion (same cluster)
- #20390 - "already installed" for different projects (same cluster)
- #20077 - Scope conflict across projects (same cluster)
- #18322 - UI shows wrong "installed" status (related)
- #19743 - Discover hides project-scoped plugins (related)
- #14185 - Install fails for new projects (related)
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗