[BUG] Project-scoped plugins not automatically enabled in git worktrees despite being configured in `.claude/settings.json`

Resolved 💬 2 comments Opened May 23, 2026 by Seretos Closed Jun 24, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When starting a Claude Code session in a git worktree, project-scoped plugins configured via enabledPlugins in .claude/settings.json show the following error in /plugin:

Plugin "<plugin>" is enabled in project settings but isn't installed here
→ Run claude plugin install <my-plugin> --scope project to install it for this project

When following the suggested fix and running the install command, it fails with:

Failed to install: EACCES: permission denied, rm '<path-to-cache>\0.1.2'

This permission error occurs because the plugin cache is already in use by a parallel Claude Code session running in the main repository. The only workaround that works is running /reload-plugins manually inside the worktree session.

What Should Happen?

When Claude Code starts in a git worktree, it should automatically recognize plugins configured in .claude/settings.json (project scope) as installed and enabled — since the settings file and plugin cache are shared across the main repo and all its worktrees. No manual intervention should be required.

The suggested fix ("run claude plugin install ... --scope project") is also broken in this context because it conflicts with parallel sessions using the same plugin cache, producing an EACCES error. Claude Code should detect that the plugin is already cached and simply register it for the worktree path without attempting to re-download or re-install.

Error Messages/Logs

In `/plugin` UI inside a worktree session:

  agent-project-issues @ agent-marketplace
  Scope: local
  Version: 0.1.2
  Status: Enabled
  1 error:
    Plugin "agent-project-issues" is enabled in project settings but isn't installed here
    → Run `claude plugin install agent-project-issues@agent-marketplace --scope project` to install it for this project

When following the suggested fix:

  Failed to install: EACCES: permission denied, rm 'C:\Users\arnev\.claude\plugins\cache\agent-marketplace\agent-project-issues\0.1.2'

Steps to Reproduce

  1. Enable a plugin via enabledPlugins in .claude/settings.json at project scope
  2. Verify the plugin works correctly in a normal session from the repo root
  3. Keep that session running (to simulate a parallel agent workflow)
  4. Create a git worktree: git worktree add ../my-worktree my-branch
  5. Start a Claude Code session in the worktree: cd ../my-worktree && claude
  6. Run /plugin — observe the error: "Plugin is enabled in project settings but isn't installed here"
  7. Follow the suggested fix: claude plugin install <plugin>@<marketplace> --scope project
  8. Observe: Failed to install: EACCES: permission denied due to cache lock from the parallel session

Workarounds attempted (none fully satisfactory):

  • claude plugin install <plugin> --scope project inside the worktree → fails with EACCES when the plugin cache is in use by a parallel session
  • Manually editing ~/.claude/plugins/installed_plugins.json to add the worktree path → appears to be ignored due to caching
  • Setting CLAUDE_CODE_SYNC_PLUGIN_INSTALL=1 → no effect
  • Running /reload-plugins manually at session start → works, but requires interactive intervention and cannot be scripted or passed as a CLI flag

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.150

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗