[BUG] Plugin scope: "local" entries ignore projectPath — wrong version loaded based on array order
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?
Title: P
Claude Code version: 2.1.84
Description:
When multiple local-scoped entries exist for the same plugin in ~/.claude/plugins/installed_plugins.json, Claude Code loads the first entry in the array regardless of projectPath. This causes the wrong plugin version to be loaded in projects that have their own local install.
What Should Happen?
Expected: Plugin loads version 1.0.2 (projectPath matches project-b)
Actual: Plugin loads version 1.0.1 — the first array entry. $CLAUDE_PLUGIN_ROOT expands to the project-a install path. Restarting Claude Code does not fix it.
Root cause: The plugin resolver appears to take the first array entry for a given plugin key rather than filtering local-scope entries by projectPath against the current working directory before selecting a version.
Workaround: Manually remove the stale entry from ~/.claude/plugins/installed_plugins.json.
Error Messages/Logs
Steps to Reproduce
Steps to reproduce:
- Install a plugin locally in project A (e.g. version 1.0.1):
cd /home/user/projects/project-a
# install plugin → creates local scope entry in installed_plugins.json
- Install the same plugin locally in project B at a newer version (e.g. version 1.0.2):
cd /home/user/projects/project-b
# install/update plugin → appends local scope entry
- installed_plugins.json now contains:
"my-plugin@my-marketplace": [
{ "scope": "local", "projectPath": "/home/user/projects/project-a", "version": "1.0.1", ... },
{ "scope": "local", "projectPath": "/home/user/projects/project-b", "version": "1.0.2", ... }
]
- Open Claude Code from project-b. Run any skill from my-plugin.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.84
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗