[BUG] Plugin installPath incorrectly includes marketplace.json filename

Status Closed — not planned
Maintainer reply None cached
Activity 6 comments · opened Nov 8, 2025 · closed Feb 4, 2026

Description

When configuring a custom marketplace using a relative file path to marketplace.json, Claude Code incorrectly constructs the plugin's installPath by concatenating the full marketplace file path (including the .json filename) with the plugin source path, resulting in an invalid path and need to manually clear out cache.

Expected Behavior

The installPath should use the marketplace directory as the base, not the marketplace file path.

Expected:

"installPath": "../../.claude-plugin/plugins/project-shared-skills"

Actual Behavior

The installPath incorrectly includes marketplace.json as if it were a directory.

Actual:

"installPath": "../../.claude-plugin/marketplace.json/plugins/project-shared-skills"

Impact

  • Plugin shows as "Installed" in /plugin UI
  • Plugin fails to load with error: "Plugin 'project-shared-skills' not found in marketplace 'project-plugins'"
  • Skills, commands, and other plugin features are not available
  • Zero plugin skills/commands/agents loaded despite successful marketplace installation

Reproduction Steps

  1. Create a custom marketplace structure:
project/
├── .claude-plugin/
│   ├── marketplace.json
│   └── plugins/
│       └── project-shared-skills/
│           ├── .claude-plugin/
│           │   └── plugin.json
│           └── skills/
│               └── playwright/
│                   └── SKILL.md
└── apps/
    └── example/
        └── .claude/
            └── settings.json
  1. Configure marketplace in apps/example/.claude/settings.json:
{
  "extraKnownMarketplaces": {
    "project-plugins": {
      "source": { "source": "file", "path": "../../.claude-plugin/marketplace.json" }
    }
  },
  "enabledPlugins": {
    "project-shared-skills@project-plugins": true
  }
}
  1. Configure marketplace in project/.claude-plugin/marketplace.json:
{
  "name": "project-plugins",
  "owner": { "name": "Project DevTools" },
  "plugins": [
    {
      "name": "project-shared-skills",
      "source": "./plugins/project-shared-skills",
      "description": "Shared Skills for all project apps"
    }
  ]
}
  1. Start Claude Code from project/apps/example/ directory
  1. Check /plugin - marketplace shows as "Installed" but plugin fails to load
  1. Inspect ~/.claude/plugins/installed_plugins.json - observe malformed installPath

Environment

Claude Code Version

2.0.45

Platform

Google Vertex AI

Operating System

Other Linux

Terminal/Shell

Ghostty

Additional Context

  • Working directory: Subdirectory of repository (e.g., project/apps/example/)
  • Marketplace path: Relative path to parent directories (e.g., ../../.claude-plugin/marketplace.json)

Debug Log Evidence

From ~/.claude/debug/*.txt:

[DEBUG] Plugin loading errors: Plugin project-shared-skills not found in marketplace project-plugins
[DEBUG] Total plugin skills loaded: 0
[DEBUG] Total plugin commands loaded: 0

Root Cause Analysis

The plugin installation logic appears to concatenate:

  1. Marketplace source path: ../../.claude-plugin/marketplace.json
  2. Plugin source path from marketplace: ./plugins/project-shared-skills

Resulting in: ../../.claude-plugin/marketplace.json/plugins/project-shared-skills

The logic should strip the filename from the marketplace path or use the marketplace's directory as the base.

Workarounds Attempted

  • Using absolute paths (works but not portable across users/machines)
  • Moving plugins directory to different locations
  • Clearing cache files (known_marketplaces.json, installed_plugins.json)

Related Issues

This affects any setup where:

  • Custom marketplace is in a parent directory
  • Working directory is a subdirectory of the project
  • Relative paths are required for portability across team members

Suggested Fix

When constructing installPath, use path.dirname() on the marketplace file path before concatenating with the plugin source path, or recognize that marketplace paths ending in .json are files and should be treated as such.

View original on GitHub ↗

6 Comments

ejc3 · 10 months ago

I've reproduced and confirmed the bug. The issue occurs during the initial plugin installation when
marketplaces are first discovered from extraKnownMarketplaces.

### Evidence

When Claude Code discovers a marketplace from a relative file path and attempts to install plugins, it
constructs the installPath by concatenating the marketplace file path (including the .json filename) with
the plugin source path:

Broken installed_plugins.json:

``json
{
"version": 1,
"plugins": {
"project-shared-skills@project-plugins": {
"version": "unknown",
"installedAt": "2025-11-22T20:27:44.176Z",
"lastUpdated": "2025-11-22T20:27:44.176Z",
"installPath": "../../.claude-plugin/marketplace.json/plugins/project-shared-skills",
"isLocal": true
},
"custom-plugin@custom-marketplace": {
"version": "unknown",
"installedAt": "2025-11-22T20:27:44.176Z",
"lastUpdated": "2025-11-22T20:27:44.176Z",
"installPath": "../../../tools/claude/marketplace.json/plugins/custom-plugin",
"isLocal": true
}
}
}
``

Corresponding known_marketplaces.json:

``json
{
"project-plugins": {
"source": {
"source": "file",
"path": "../../.claude-plugin/marketplace.json"
},
"installLocation": "../../.claude-plugin/marketplace.json",
"lastUpdated": "2025-11-22T20:27:44.202Z"
},
"custom-marketplace": {
"source": {
"source": "file",
"path": "../../../tools/claude/marketplace.json"
},
"installLocation": "../../../tools/claude/marketplace.json",
"lastUpdated": "2025-11-22T20:27:44.231Z"
}
}
``

### The Problem

The installPath includes marketplace.json as if it were a directory:

  • ❌ Actual: ../../.claude-plugin/marketplace.json/plugins/project-shared-skills
  • ✅ Expected: ../../.claude-plugin/plugins/project-shared-skills

Since marketplace.json is a file (not a directory), the path doesn't exist:

``bash
$ ls "../../.claude-plugin/marketplace.json/plugins/project-shared-skills"
ls: cannot access '../../.claude-plugin/marketplace.json/plugins/project-shared-skills': Not a directory
``

### Debug Logs

From the initial startup with empty caches:

``
2025-11-22T20:27:42.126Z [DEBUG] Found 1 plugins (1 enabled, 0 disabled)
2025-11-22T20:27:42.127Z [DEBUG] Plugin not available for MCP: project-shared-skills@project-plugins - error
type: plugin-not-found
2025-11-22T20:27:42.127Z [DEBUG] Plugin not available for MCP: custom-plugin@custom-marketplace - error type:
plugin-not-found
...
2025-11-22T20:27:44.151Z [DEBUG] Found 3 extra marketplaces in settings
2025-11-22T20:27:44.174Z [DEBUG] Loaded plugins - Enabled: 1, Disabled: 0, Commands: 0, Agents: 0, Errors: 2
2025-11-22T20:27:44.174Z [DEBUG] Installing 2 marketplaces automatically
2025-11-22T20:27:44.177Z [DEBUG] Setting installation status: 2 marketplaces, 3 installable plugins, 0
uninstallable plugins
2025-11-22T20:27:44.204Z [DEBUG] Added marketplace source: project-plugins
2025-11-22T20:27:44.218Z [DEBUG] Installing 1 plugins from newly installed marketplace project-plugins
2025-11-22T20:27:44.232Z [DEBUG] Added marketplace source: custom-marketplace
2025-11-22T20:27:44.234Z [DEBUG] Installing 1 plugins from newly installed marketplace custom-marketplace
``

The marketplaces are discovered and "installed," but the plugins fail to load because the paths are
malformed.

### Impact

This bug affects:

  • ✅ First-time installation: When marketplaces are discovered from extraKnownMarketplaces and plugins

are auto-installed

  • ✅ Cache clearing: When users delete ~/.claude/plugins/ and restart
  • ✅ Any relative file path marketplace: "path": "../../.claude-plugin/marketplace.json"

Once the bug occurs, the malformed paths persist in installed_plugins.json and plugins remain broken until
manual intervention.

### Original Issue Description Was Accurate

The original issue description correctly identified the root cause:

> The plugin installation logic appears to concatenate:
>
> - Marketplace source path: ../../.claude-plugin/marketplace.json
> - Plugin source path from marketplace: ./plugins/project-shared-skills
> - Resulting in: ../../.claude-plugin/marketplace.json/plugins/project-shared-skills
>
> The logic should strip the filename from the marketplace path or use the marketplace's directory as the
base.

This is exactly what's happening.

github-actions[bot] · 9 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.

spacebat · 9 months ago

This is definitely still happening in claude 2.0.74

github-actions[bot] · 8 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 8 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.