Skip to content

Project-scoped plugins: install command fails for new projects, Discovery tab incorrectly hides plugin #14185

Description

@9swampy

Description

When a plugin is installed with scope: "project" for one project, attempting to install it in a different project fails silently. The Discovery tab also incorrectly hides the plugin (showing it as already installed) even though it's not installed for the current project.

Steps to Reproduce

  1. Install a plugin with project scope in Project A
  2. Open Claude Code in Project B (where plugin is NOT installed)
  3. Run /plugin → Discovery tab does NOT list the plugin
  4. Browse marketplace → plugin shows as "installed"
  5. Attempt to install the plugin → command completes without error
  6. Run /plugin → plugin still not in Installed list
  7. Plugin commands/agents/MCP server not available

Expected Behavior

  • Discovery tab should show plugin as available (not installed for this project)
  • Install command should create all required configuration for the new project
  • Plugin should become functional after install

Actual Behavior

  • Discovery tab hides the plugin (checks global install status, not per-project)
  • Install command is a no-op (doesn't add project to existing plugin entry)
  • No local project configuration is created

Root Cause Analysis

The install command checks if the plugin ID exists in installed_plugins.json globally, but doesn't check if the current project path is in the installations array for project-scoped plugins.

Workaround

Manually create all required configuration:

1. Add entry to ~/.claude/plugins/installed_plugins.json:

{
  "scope": "project",
  "projectPath": "/path/to/new/project",
  "installPath": "/home/user/.claude/plugins/cache/marketplace-name/plugin-name/version",
  "version": "x.x.x",
  "installedAt": "2025-12-16T00:00:00.000Z",
  "lastUpdated": "2025-12-16T00:00:00.000Z",
  "isLocal": true
}

2. Create .mcp.json at project root (if plugin has MCP server):

{
  "mcpServers": {
    "server-name": {
      "command": "...",
      "args": ["..."]
    }
  }
}

3. Update .claude/settings.local.json:

{
  "enableAllProjectMcpServers": true,
  "enabledMcpjsonServers": ["server-name"]
}

4. Create .claude/settings.json (THIS IS THE KEY MISSING PIECE):

{
  "enabledPlugins": {
    "plugin-name@marketplace-name": true
  }
}

Note: Steps 1-3 alone only enable the MCP server. Step 4 is required for plugin commands/agents/hooks to load.

Environment

  • Claude Code version: 2.0.70
  • OS: Linux (WSL2)

Suggested Fix

  1. Discovery tab should check if current projectPath exists in the plugin's installation array (for project-scoped plugins)
  2. Install command should append new project entry to existing plugin array
  3. Install command should create .claude/settings.json with enabledPlugins
  4. Install command should create .mcp.json if plugin defines MCP servers
  5. Install command should update .claude/settings.local.json with MCP settings

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions