extraKnownMarketplaces with directory source does not resolve relative paths
Bug Description
extraKnownMarketplaces in .claude/settings.json with "source": "directory" does not resolve relative paths to absolute paths. The relative path is passed through literally to known_marketplaces.json, causing plugin resolution to fail at runtime.
Steps to Reproduce
- Create a plugin marketplace in a git repo with
.claude-plugin/marketplace.jsonat the repo root - Add to
.claude/settings.json(checked into the repo):
{
"extraKnownMarketplaces": {
"my-marketplace": {
"source": {
"source": "directory",
"path": "./"
}
}
},
"enabledPlugins": {
"my-plugin@my-marketplace": true
}
}
- Start Claude Code in the project directory
- Run
/doctor
Expected Behavior
Claude Code should resolve "./" to the absolute project root path (e.g., D:\Projects\my-project) when populating known_marketplaces.json, similar to how /plugin marketplace add ./ resolves it.
Actual Behavior
/doctorreports:Plugin my-plugin not found in marketplace my-marketplaceknown_marketplaces.jsonstores the path literally as"./"instead of resolving it- The marketplace appears in
/pluginlist but the plugin fails to load (skills, hooks, output-styles not registered)
Evidence
When using /plugin marketplace add ./ (interactive command), known_marketplaces.json correctly stores:
{
"my-marketplace": {
"source": {
"source": "directory",
"path": "D:\Projects\my-project"
},
"installLocation": "D:\Projects\my-project"
}
}
When using extraKnownMarketplaces in settings.json, the same file stores the unresolved relative path:
{
"my-marketplace": {
"source": {
"source": "directory",
"path": "./"
},
"installLocation": "./"
}
}
Impact
This prevents plugin authors from shipping a fully auto-discoverable local marketplace with their repos. The checked-in settings.json cannot use absolute paths (not portable), and relative paths don't resolve. The workaround is requiring cloners to manually run /plugin marketplace add ./ after cloning.
Environment
- Claude Code on Windows (MSYS_NT-10.0-26100 / Git Bash)
- Plugin marketplace at repo root with
.claude-plugin/marketplace.json
Workaround
Users must manually run /plugin marketplace add ./ after cloning the repo. The checked-in settings.json can pre-set enabledPlugins so the plugin auto-enables once the marketplace is added manually.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗