[BUG] "X plugins failed to install" on first launch due to race condition with marketplace auto-install
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?
Description
On first launch with enabledPlugins configured in .claude/settings.json, Claude Code shows "x plugins failed to install" even though the official marketplace auto-installs successfully moments later.
## Root Cause
The plugin loading check runs before the marketplace auto-install completes:
16:07:14.009Z [DEBUG] Attempting to auto-install official marketplace
16:07:14.017Z [DEBUG] Cannot install 6 plugins because their marketplaces are not installed
16:07:14.046Z [DEBUG] Adding notification for 6 failed installations ← triggered here
16:07:15.091Z [DEBUG] Successfully auto-installed official marketplace ← completes ~1s later
## Steps to Reproduce
- Fresh environment (e.g., new devcontainer) with no
~/.claudedirectory - Configure
.claude/settings.jsonwithenabledPlugins:
```json
{
"enabledPlugins": {
"feature-dev@claude-plugins-official": true,
"code-review@claude-plugins-official": true
}
}
- Launch Claude Code for the first time
- See "X plugins failed to install" notification
Expected Behavior
Plugins should install automatically after the marketplace auto-install completes, or the notification should be deferred until after marketplace setup.
Actual Behavior
- Notification shows plugins "failed to install"
- Marketplace installs successfully in background
- Plugins remain uninstalled until manually installed via /plugin install
Workaround
Run claude plugin install <plugin>@claude-plugins-official manually after first launch.
Environment
- Claude Code: 2.1.12
- Platform: Linux (Docker/devcontainer)
- Installation: Native
Related Issues
- #15569 - Similar timing issue with marketplace notification
- #17089 - Plugin persistence issues after 2.1.x
What Should Happen?
Expected Behavior
Plugins should install automatically after the marketplace auto-install completes, or the notification should be deferred until after marketplace setup.
Error Messages/Logs
Steps to Reproduce
- Fresh environment (e.g., new devcontainer) with no
~/.claudedirectory - Configure
.claude/settings.jsonwithenabledPlugins:
```json
{
"enabledPlugins": {
"feature-dev@claude-plugins-official": true,
"code-review@claude-plugins-official": true
}
}
- Launch Claude Code for the first time
- See "X plugins failed to install" notification
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.12
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗