Plugin 'Update now' fails when CWD differs from original install workspace

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 5 comments · opened Apr 9, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

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

  1. Define a custom marketplace with a local plugin source ("source": "./claude-plugin" in .claude-plugin/marketplace.json)
  2. Register the marketplace in global settings via extraKnownMarketplaces
  3. Open Claude Code in workspace A and install the plugin — installed_plugins.json records "projectPath": "/path/to/workspace-A"
  4. Open Claude Code in workspace B (where the marketplace source actually lives)
  5. 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 projectPath to 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 user scope 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)

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/14202
  2. https://github.com/anthropics/claude-code/issues/27525
  3. https://github.com/anthropics/claude-code/issues/42411

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

erudenko · 6 months ago

This appears to share the same root cause as #45997, which has a detailed analysis and suggested fix.

The underlying bug is in pluginLoader.ts line 2051 — it does installedPluginsData.plugins[pluginId]?.[0] (takes the first array entry) instead of filtering by the current project context using the existing isInstallationRelevantToCurrentProject() function from installedPluginsManager.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.

ashwin-ant collaborator · 6 months ago

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.

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

Showing cached comments. Read the full discussion on GitHub ↗