[BUG] Plugin marketplace removal doesn't clean up settings.json, causing marketplace to reinstall
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 using /plugin menu to remove a marketplace, the command appears to succeed and removes the marketplace from the cache, but it does not remove the marketplace configuration from ~/.claude/settings.json.
This causes the marketplace to automatically reinstall/reload the next time Claude Code starts, making it impossible to permanently remove a marketplace using the CLI.
The extraKnownMarketplaces entry remains in settings.json even after removal, and on next startup, Claude Code reads this configuration and attempts to reinstall the marketplace.
What Should Happen?
The /plugin menu selection for marketplace removing should completely uninstall the marketplace by:
- Removing the marketplace from cache/runtime state
- Removing the
extraKnownMarketplacesentry from~/.claude/settings.json - Removing any
enabledPluginsentries associated with that marketplace - Ensuring the marketplace does not reinstall on next startup
After removal, the marketplace should stay removed unless explicitly re-added by the user.
Error Messages/Logs
No error messages - the command silently succeeds but doesn't fully clean up.
Using `/plugin` then navigating to remove a marketplace outputs:
✔ Removed 1 marketplace
However, checking settings.json shows the configuration still present:
{
"extraKnownMarketplaces": {
"claude-plugins": {
"source": {
"source": "directory",
"path": "/path/to/claude-plugins"
}
}
}
}
Steps to Reproduce
- Add a marketplace to your global settings (
~/.claude/settings.json):
{
"extraKnownMarketplaces": {
"test-marketplace": {
"source": {
"source": "directory",
"path": "/path/to/marketplace"
}
}
}
}
- Start Claude Code and verify the marketplace is loaded by running:
/plugin
- Then navigate through the menu to view marketplaces
- Use the /plugin interactive menu to remove the marketplace:
- Run /plugin
- Navigate to marketplace management
- Select the option to remove/uninstall the marketplace
- The command reports success: ✔ Removed 1 marketplace
- Check your settings file:
cat ~/.claude/settings.json | grep extraKnownMarketplaces
- Bug: The extraKnownMarketplaces entry is still present in settings.json
- Restart Claude Code and run /plugin again
- Bug: The marketplace is automatically reinstalled because the configuration still exists in settings.json
Workaround: Manually remove extraKnownMarketplaces from settings.json
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.14
Platform
Google Vertex AI
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Impact: This bug makes it impossible to permanently remove marketplaces through the CLI, which is problematic because:
- Users cannot clean up unwanted or test marketplaces
- Marketplace configurations accumulate over time with no proper cleanup mechanism
- The only workaround requires manual file editing or command-line JSON manipulation
- Users may not realize the marketplace is still configured, leading to confusion when it reappears
Affected configurations: This issue occurs with both directory and github source types for marketplaces.
Expected CLI behavior: Other plugin management commands (like /plugin uninstall) should similarly clean up their respective configuration entries in settings.json if they don't already.
Related observation: The /plugin command system appears to modify runtime state and cache files but doesn't update the persistent settings.json configuration file, which is the source of truth for marketplace definitions.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗