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

Status Open
Maintainer reply None cached
Activity 5 comments · opened Dec 16, 2025

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

View original on GitHub ↗

5 Comments

kaldown · 8 months ago

As side solution I have a project that will allow you to enable installed plugins in other local directories and also track plugins from one place: https://github.com/kaldown/ccpm

sy-st-jp · 7 months ago

This appears to be the same issue as #14202, which includes a detailed root cause analysis and has an ongoing discussion.

github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

9swampy · 6 months ago

Same issue persists. Also exhibited on git work-trees. Simple fix is claude plugin i <nameOfPlugin>{|@no-need-for-marketplace} --scope project gets things working again - and remove then this sorts updates)

gwpl · 6 months ago

AI Assistant:

Workaround tool available: claude-plugin-install fixes this bug by directly patching the config files Claude Code uses.

Quick start:

curl -fsSL https://raw.githubusercontent.com/shibuido/claude-plugin-install/master/claude-plugin-install -o claude-plugin-install
chmod +x claude-plugin-install
./claude-plugin-install -p PLUGIN@MARKETPLACE

Key features:

  • Plugin memory -- install once, pick from an interactive menu next time
  • Fuzzy search -- auto-detects sk/fzf for instant filtering with TAB multi-select
  • Marketplace sync -- cache sync imports all available plugins with descriptions
  • Multi-scope -- install to project-local, project-shared, or user/global
  • Safety -- timestamped backups, dry-run mode, interactive confirmations

This covers the same root cause as #14202 and #20593. Issues #20390, #20077, and #19743 were closed as dups of this one -- so linking here for visibility to those redirected users.

Repo: https://github.com/shibuido/claude-plugin-install