Skip to content

[BUG] Plugin marketplace removal doesn't clean up settings.json, causing marketplace to reinstall #9537

Description

@dylan-huff-apex

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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:

  1. Removing the marketplace from cache/runtime state
  2. Removing the extraKnownMarketplaces entry from ~/.claude/settings.json
  3. Removing any enabledPlugins entries associated with that marketplace
  4. 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

  1. Add a marketplace to your global settings (~/.claude/settings.json):
{
	"extraKnownMarketplaces": {
		"test-marketplace": {
			"source": {
				"source": "directory",
				"path": "/path/to/marketplace"
			}
		}
    }
 }
  1. Start Claude Code and verify the marketplace is loaded by running:
    /plugin
  2. Then navigate through the menu to view marketplaces
  3. Use the /plugin interactive menu to remove the marketplace:
  • Run /plugin
  • Navigate to marketplace management
  • Select the option to remove/uninstall the marketplace
  1. The command reports success: ✔ Removed 1 marketplace
  2. Check your settings file:
    cat ~/.claude/settings.json | grep extraKnownMarketplaces
  3. Bug: The extraKnownMarketplaces entry is still present in settings.json
  4. Restart Claude Code and run /plugin again
  5. 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:

  1. Users cannot clean up unwanted or test marketplaces
  2. Marketplace configurations accumulate over time with no proper cleanup mechanism
  3. The only workaround requires manual file editing or command-line JSON manipulation
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions