[BUG] --plugin-dir does not take precedence over marketplace-installed plugin with same name
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
Bug Description
When running claude --plugin-dir=<path> with a plugin that has the same name as a marketplace-installed plugin, the marketplace version loads instead of the one at the specified path. The --plugin-dir flag should override (or at minimum merge with precedence over) marketplace-installed plugins.
Steps to Reproduce
- Have a plugin installed via marketplace (e.g.
~/.claude/plugins/marketplaces/<org>/<plugin-name>/, version 2.0.0) - Have a local development copy of the same plugin at a different path (e.g.
~/dev/my-plugin/, version 1.0.0) that contains an agent definition not present in the marketplace version - Run:
claude --plugin-dir=~/dev/my-plugin "invoke the agent only in the local version" - The marketplace version loads instead — the agent unique to the local version is unavailable
Expected Behavior
The plugin from --plugin-dir should take precedence over the marketplace-installed copy when they share the same plugin name. Agents and skills from --plugin-dir should be the ones loaded.
Actual Behavior
The marketplace version loads. Agent definitions only present in the --plugin-dir version are unavailable. The session resolves agent files from ~/.claude/plugins/marketplaces/... instead of the path passed via --plugin-dir.
Environment
- Claude Code version: 2.1.195
- OS: macOS (Darwin 25.5.0)
- Shell: zsh
Impact
- Plugin authors cannot test local changes without uninstalling the marketplace version first
- Users cannot pin an older plugin version via
--plugin-dirif the marketplace has a newer one - Makes iterative plugin development painful — the only workaround is
rm -rf ~/.claude/plugins/marketplaces/<org>/<name>
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗