Stale officialMarketplaceAutoInstallFailReason causes permanent "Failed to install Anthropic marketplace" banner when marketplace is already installed
Summary
On every startup, Claude Code shows the orange notification "Failed to install Anthropic marketplace · Will retry on next startup" even though the official marketplace is installed and healthy (~/.claude/plugins/marketplaces/claude-plugins-official is a working sparse git checkout, fetches cleanly from origin, valid marketplace.json, listed in ~/.claude/plugins/known_marketplaces.json).
Repro
- Hit a transient install failure once (e.g. brief git/network blip during a retry attempt) — this writes
officialMarketplaceAutoInstallFailReason: "unknown"plus retry-count/timestamps into~/.claude.json. - On a later startup, the marketplace successfully installs via the GCS-cached path.
- From then on, the user-facing notification fires on every subsequent startup — until the user manually edits
~/.claude.json.
Root cause
The auto-installer (Ic_ in the bundled CLI) has two success branches.
The git-fallback success branch correctly clears the failure bookkeeping:
// git-fallback success — correct
a8(z => ({
...z,
officialMarketplaceAutoInstallAttempted: true,
officialMarketplaceAutoInstalled: true,
officialMarketplaceAutoInstallFailReason: void 0,
officialMarketplaceAutoInstallRetryCount: void 0,
officialMarketplaceAutoInstallLastAttemptTime: void 0,
officialMarketplaceAutoInstallNextRetryTime: void 0,
}));
The GCS success branch (taken when W28(K, $) returns non-null) only flips two fields and leaks the prior failure state:
// GCS success — leaks stale failure state
a8(Y => ({
...Y,
officialMarketplaceAutoInstallAttempted: true,
officialMarketplaceAutoInstalled: true,
}));
If a previous attempt set officialMarketplaceAutoInstallFailReason: "unknown" (plus a retry count and timestamps), those fields stay in ~/.claude.json forever. On startup, the gate gtA() short-circuits to false (because officialMarketplaceAutoInstalled === true), and Ic_ early-returns:
let q = H.officialMarketplaceAutoInstallFailReason ?? "already_attempted";
return { installed: false, skipped: true, reason: q };
Because of the ?? fallback, reason is the stale "unknown" instead of "already_attempted". The notifier then unconditionally renders:
} else if (H.skipped && H.reason === "unknown") {
push({
key: "marketplace-install-failed",
text: "Failed to install Anthropic marketplace · Will retry on next startup",
color: "warning",
priority: "immediate",
timeoutMs: 8000,
});
}
Suggested fix
Either of these would resolve it:
- (preferred) Mirror the git-fallback success branch — clear
FailReason/RetryCount/LastAttemptTime/NextRetryTimein the GCS success branch as well. - (defensive) Have
gtA()andIc_'s early-return treatofficialMarketplaceAutoInstalled === trueas"already_installed"regardless of any leftover failure fields, so a staleFailReasoncan't leak into the notifier path.
Workaround
Manually delete these four fields from ~/.claude.json (leave Attempted and Installed alone):
officialMarketplaceAutoInstallFailReasonofficialMarketplaceAutoInstallRetryCountofficialMarketplaceAutoInstallLastAttemptTimeofficialMarketplaceAutoInstallNextRetryTime
After this, the banner stops appearing on next startup.
Environment
- Claude Code 2.1.143 (native installer)
- Windows 11 Enterprise
- Bedrock backend (
CLAUDE_CODE_USE_BEDROCK=1) - Marketplace folder is healthy: clean sparse git checkout of
anthropics/claude-plugins-official, valid.claude-plugin/marketplace.json, listed inknown_marketplaces.jsonwith a recentlastUpdated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗