Plugin install copies marketplace-only fields into plugin.json, causing validation failure

Resolved 💬 3 comments Opened Mar 6, 2026 by andjelboskovic Closed Mar 6, 2026

Bug

When installing a marketplace plugin that doesn't ship its own .claude-plugin/plugin.json, the install process (pUT()) falls back to using the raw marketplace entry object as the manifest:

else K = _?.manifest || {name:q, description:`Plugin cached from ${typeof T==="string"?T:T.source}`}

The marketplace entry includes fields like source and category that are marketplace-level metadata, not valid plugin manifest keys. These get persisted into the cached .claude-plugin/plugin.json.

Later, when the plugin is loaded, iN_() validates the manifest using a strict Zod schema (aAT().safeParse()), which rejects unrecognized keys — causing the plugin to fail with:

Plugin plugin-dev has an invalid manifest file at
.claude-plugin/plugin.json. Validation errors: Unrecognized keys: "source", "category"

Affected plugins

11 plugins in claude-plugins-official don't ship their own .claude-plugin/plugin.json and are affected:

  • plugin-dev
  • clangd-lsp, csharp-lsp, gopls-lsp, jdtls-lsp, kotlin-lsp, lua-lsp, php-lsp, pyright-lsp, rust-analyzer-lsp, swift-lsp, typescript-lsp

Root cause

In the install function, when no plugin.json exists in the copied plugin directory, the raw marketplace entry (which includes source, category, etc.) is used as-is for the manifest. The strict Zod schema then rejects these extra keys at load time.

Suggested fix

In pUT(), when falling back to _?.manifest, strip marketplace-only fields before using it as the plugin manifest. For example, pick only known manifest fields (name, description, author, version, homepage) instead of passing the entire marketplace entry through.

Alternatively, the Zod schema could use .passthrough() instead of .strict() to be more lenient, but stripping at install time is the cleaner fix.

Workaround

Manually edit the cached .claude-plugin/plugin.json to remove "source" and "category" keys, then restart the session.

Related

  • #470 (same class of bug for figma plugin with lspServers key)

Environment

  • Claude Code 2.1.70
  • macOS (darwin arm64)

View original on GitHub ↗

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