[BUG] plugin marketplace update/install fails for never-launched users — official marketplace auto-seeded only on interactive first launch, no autoheal
Summary
For a user who has never launched the interactive claude CLI, the built-in claude-plugins-official marketplace is not registered, so both a named marketplace update and a plugin install against it fail:
claude plugin marketplace update claude-plugins-official # exit 1: Marketplace '...' not found
claude plugin install security-guidance@claude-plugins-official # exit 1: Plugin not found in marketplace
The official marketplace appears to be auto-seeded only during interactive first-launch onboarding, never during a non-interactive CLI invocation, and neither update nor install self-heals it. Worse, the install failure tells the user to run marketplace update, which also fails — a circular dead-end. This breaks headless/CI/installer/Docker provisioning that drives plugins purely through claude plugin ... subcommands before any interactive launch.
Context (how this surfaced)
This was hit during automated first-time environment setup: a provisioning script installs official plugins on a freshly created login user that has never launched claude interactively. The script ran claude plugin marketplace update claude-plugins-official followed by claude plugin install <plugin>@claude-plugins-official; both exited non-zero and aborted the whole setup. The error message's suggested fix (marketplace update) also failed, so there was no obvious forward path until we discovered the undocumented need to marketplace add the official marketplace first. For a marketplace the docs call "automatically available," a fresh-machine bootstrap should not dead-end like this.
Environment
- claude: 2.1.170 (Claude Code) — also reproduced on 2.1.169
- OS: Ubuntu 24.04.4 LTS (Linux 6.6 microsoft-standard-WSL2)
Reproduction
Use a throwaway HOME to simulate a never-launched user (no ~/.claude.json, no onboarding):
$ tmp=$(mktemp -d)
$ HOME="$tmp" claude plugin marketplace list </dev/null
No marketplaces configured # exit 0
$ HOME="$tmp" claude plugin marketplace update claude-plugins-official </dev/null
Updating marketplace: claude-plugins-official...✘ Failed to update marketplace(s): Marketplace 'claude-plugins-official' not found. Available marketplaces:
# exit 1
$ HOME="$tmp" claude plugin install security-guidance@claude-plugins-official </dev/null
Installing plugin "security-guidance@claude-plugins-official"...✘ Failed to install plugin "security-guidance@claude-plugins-official": Plugin "security-guidance" not found in marketplace "claude-plugins-official". Your local copy may be out of date — try `claude plugin marketplace update claude-plugins-official`.
# exit 1 (and the suggested `update` above also fails)
$ HOME="$tmp" claude plugin marketplace list </dev/null
No marketplaces configured # exit 0 — install did NOT seed the marketplace
For contrast, a HOME that has completed interactive onboarding has ~/.claude.json with officialMarketplaceAutoInstalled: true and claude-plugins-official present in ~/.claude/plugins/known_marketplaces.json, and the same commands succeed.
Actual vs expected
- Actual: on a never-launched user, named
update claude-plugins-officialandinstall <p>@claude-plugins-officialboth exit 1; neither seeds the marketplace, and theinstallerror points atupdate, which also fails. (Note: the bareupdatewith no name exits 0 — it just iterates an empty marketplace list.) - Expected: because
claude-plugins-officialis a built-in marketplace,claude plugin marketplace update claude-plugins-officialshould autoheal (seed + clone the official marketplace) on first run so it works without a prior interactive launch — and the plugin installs that follow then succeed. Ideallyplugin install <p>@claude-plugins-officialshould likewise autoheal instead of failing with advice to run a command that also fails.
Root cause (observed)
The marketplace registry (~/.claude/plugins/known_marketplaces.json) is populated only via (a) interactive onboarding auto-seed, or (b) an explicit marketplace add. A non-interactive first invocation writes basic ~/.claude.json state but does not trigger the auto-seed, so the registry stays empty and the existence checks in both update <name> and install <p>@<name> fail.
Impact
Any non-interactive provisioning (CI, Dockerfiles, setup scripts run as a fresh user) that calls claude plugin marketplace update claude-plugins-official or claude plugin install <p>@claude-plugins-official aborts on a fresh machine, because the official marketplace that docs describe as "automatically available" is not actually present until an interactive launch happens.
Workaround
Explicitly add before update/install (idempotent — re-adding an already-registered marketplace exits 0 with already on disk):
claude plugin marketplace add anthropics/claude-plugins-official
claude plugin marketplace update claude-plugins-official
claude plugin install security-guidance@claude-plugins-official
Related (distinct contexts)
- #22310 official marketplace inaccessible (registry change)
- #32268 [Windows] official marketplace not pre-registered vs macOS
- #19275 first-launch race during marketplace auto-install
- #18329 reserved-name conflict when adding the official marketplace
These overlap in area but none covers the specific "named update/install fails, with no autoheal, for a never-launched / non-interactive user" case above.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗