Plugin 'Update now' fails when CWD differs from original install workspace
Bug
When a project-scoped plugin is installed from a local marketplace source, ~/.claude/plugins/installed_plugins.json records projectPath as the CWD at install time. The "Update now" action validates the current CWD against this stored projectPath, failing from any other workspace — even the workspace that contains the marketplace source.
Steps to reproduce
- Define a custom marketplace with a local plugin source (
"source": "./claude-plugin"in.claude-plugin/marketplace.json) - Register the marketplace in global settings via
extraKnownMarketplaces - Open Claude Code in workspace A and install the plugin —
installed_plugins.jsonrecords"projectPath": "/path/to/workspace-A" - Open Claude Code in workspace B (where the marketplace source actually lives)
- Navigate to Plugins > [plugin] > "Update now"
Expected
Update succeeds — the plugin is enabled and the source is resolvable.
Actual
Failed to update: Plugin "X" is not installed at scope project (/path/to/workspace-B)
The error names the current CWD, not the registered projectPath. The update fails because CWD ≠ stored projectPath.
Root cause
In installed_plugins.json, the projectPath field for project-scoped plugins is set to the CWD at install time:
"my-plugin@my-marketplace": [{
"scope": "project",
"projectPath": "/path/to/workspace-A",
...
}]
The "Update now" validation checks projectPath against the current CWD and rejects the update if they differ.
Suggested fix
One or more of:
- Set
projectPathto the directory containing the marketplace source (.claude-plugin/marketplace.json), not the CWD at install time - Allow "Update now" from any workspace where the plugin is enabled in
enabledPlugins - If the plugin is also enabled at
userscope in global settings, allow the update regardless of CWD
Workaround
Manually edit ~/.claude/plugins/installed_plugins.json and change projectPath to the directory you want to update from.
Environment
- Claude Code v2.1.96
- macOS (Darwin 25.3.0)
Showing cached comments. Read the full discussion on GitHub ↗
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This appears to share the same root cause as #45997, which has a detailed analysis and suggested fix.
The underlying bug is in
pluginLoader.tsline 2051 — it doesinstalledPluginsData.plugins[pluginId]?.[0](takes the first array entry) instead of filtering by the current project context using the existingisInstallationRelevantToCurrentProject()function frominstalledPluginsManager.ts.When the CWD differs from the original install workspace, the loader picks up the wrong entry from the array, explaining the failure you're seeing.
This was fixed in v2.1.98 — The plugin 'Update now' action now works regardless of the current working directory, instead of failing when it differs from the original install location. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.
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.