Repository navigation
Description
Bug Report: Plugin Path Resolution Incorrectly Uses marketplace.json File Path Instead of Marketplace Directory
Environment
- Claude Code Version: 2.0.36
- OS: Linux 6.6.76
- Platform: linux
Summary
When installing plugins from a local marketplace, Claude Code incorrectly constructs plugin installation paths by using the full marketplace.json file path (including the filename) as the base directory, instead of using the marketplace directory as the base. This causes all plugins to fail loading with "Plugin directory not found" errors.
Steps to Reproduce
- Create a local marketplace with the following structure:
marketplace/
├── .claude-plugin/
│ └── marketplace.json
└── plugins/
├── lc_query/
│ └── .claude-plugin/
│ └── plugin.json
└── lc_external_datasources/
└── .claude-plugin/
└── plugin.json
- Configure
marketplace.jsonwith relative plugin paths:
{
"name": "limacharlie-marketplace",
"plugins": [
{
"name": "lc-query",
"source": "./plugins/lc_query",
"version": "1.0.0"
},
{
"name": "lc-external-datasources",
"source": "./plugins/lc_external_datasources",
"version": "1.0.0"
}
]
}- Add the marketplace using
/plugincommand - Install both plugins from the marketplace
Expected Behavior
Plugin paths should be resolved relative to the marketplace directory:
- Base directory:
/path/to/marketplace/ - Relative source:
./plugins/lc_query - Expected result:
/path/to/marketplace/plugins/lc_query
This is the standard behavior for resolving relative paths from configuration files - use the directory containing the config file, not the file itself.
Actual Behavior
Plugin paths are incorrectly resolved relative to the marketplace.json file path (including the filename):
- Base (incorrect):
/path/to/marketplace/.claude-plugin/marketplace.json - Relative source:
./plugins/lc_query - Actual result:
/path/to/marketplace/.claude-plugin/marketplace.json/plugins/lc_query
This creates an invalid filesystem path (trying to use a file as a directory) that doesn't exist.
Error Messages
Plugin Loading Errors:
✘ lc-query@limacharlie-marketplace
Plugin directory not found at path: /home/maxime/goProjects/github.com/refractionPOINT/documentation/marketplace/.claude-plugin/plugins/lc_query. Check that the marketplace entry has the correct path.
✘ lc-external-datasources@limacharlie-marketplace
Plugin directory not found at path: /home/maxime/goProjects/github.com/refractionPOINT/documentation/marketplace/.claude-plugin/plugins/lc_external_datasources. Check that the marketplace entry has the correct path.
Note: The error shows Claude Code looking in marketplace/.claude-plugin/plugins/ rather than marketplace/plugins/, indicating the base path was resolved incorrectly during installation.
Evidence from Configuration Files
After installation, ~/.claude/plugins/installed_plugins.json contains:
{
"version": 1,
"plugins": {
"lc-query@limacharlie-marketplace": {
"installPath": "/home/maxime/goProjects/github.com/refractionPOINT/documentation/marketplace/.claude-plugin/marketplace.json/plugins/lc_query",
"isLocal": true
},
"lc-external-datasources@limacharlie-marketplace": {
"installPath": "/home/maxime/goProjects/github.com/refractionPOINT/documentation/marketplace/.claude-plugin/marketplace.json/plugins/lc_external_datasources",
"isLocal": true
}
}
}Notice the paths include marketplace.json/plugins/ which is invalid - marketplace.json is a file, not a directory.
Root Cause
The path resolution logic appears to be using the full marketplace.json file path as the base when resolving relative plugin source paths, instead of extracting the parent directory first.
Incorrect logic (current):
baseDir = marketplaceJsonPath // e.g., "/path/to/.claude-plugin/marketplace.json"
pluginPath = resolve(baseDir, pluginSource) // Results in invalid path
Correct logic (needed):
baseDir = dirname(dirname(marketplaceJsonPath)) // e.g., "/path/to/marketplace/"
pluginPath = resolve(baseDir, pluginSource) // Results in valid path
Or more accurately, the base should be the marketplace root directory, which is the parent of .claude-plugin/.
Impact
- Local marketplace plugins cannot be loaded
- Plugins show as "installed" but are not accessible
- Users see conflicting state (plugins listed as installed but with loading errors)
- No workaround exists except restructuring the marketplace directory to match the incorrect path expectations
Suggested Fix
When resolving plugin source paths from marketplace.json:
- Take the marketplace.json file path
- Extract the parent directory (
.claude-plugin/) - Extract the parent of that (the marketplace root directory)
- Use the marketplace root directory as the base for resolving relative plugin paths
This ensures that "source": "./plugins/lc_query" correctly resolves relative to the marketplace root, not the config file.
Activity
github-actions commentedon Nov 8, 2025
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
maximelb commentedon Nov 9, 2025
Adding the marketplace without the JSON file in the path fixes it. So part of the marketplace add is too lenient and allows for a JSON file instead of a directory.
github-actions commentedon Nov 16, 2025
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.