220Once a plugin is cloned or copied into the local machine, it is copied into the local versioned plugin cache at `~/.claude/plugins/cache`.220Once a plugin is cloned or copied into the local machine, it is copied into the local versioned plugin cache at `~/.claude/plugins/cache`.
221 221
222| Source | Type | Fields | Notes |222| Source | Type | Fields | Notes |
223| ------------- | ------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------- |223| ------------- | ------------------------------- | ---------------------------------- | ----------------------------------------------------------------------------------- |
224| Relative path | `string` (e.g. `"./my-plugin"`) | — | Local directory within the marketplace repo. Must start with `./` |224| Relative path | `string` (e.g. `"./my-plugin"`) | — | Local directory within the marketplace repo. Must start with `./` |
225| `github` | object | `repo`, `ref?`, `sha?` | |225| `github` | object | `repo`, `ref?`, `sha?` | |
226| `url` | object | `url` (must end .git), `ref?`, `sha?` | Git URL source |226| `url` | object | `url`, `ref?`, `sha?` | Git URL source |
227| `git-subdir` | object | `url`, `path`, `ref?`, `sha?` | Subdirectory within a git repo. Clones sparsely to minimize bandwidth for monorepos |227| `git-subdir` | object | `url`, `path`, `ref?`, `sha?` | Subdirectory within a git repo. Clones sparsely to minimize bandwidth for monorepos |
228| `npm` | object | `package`, `version?`, `registry?` | Installed via `npm install` |228| `npm` | object | `package`, `version?`, `registry?` | Installed via `npm install` |
229| `pip` | object | `package`, `version?`, `registry?` | Installed via pip |229| `pip` | object | `package`, `version?`, `registry?` | Installed via pip |
558 558
559For full configuration options, see [Plugin settings](/en/settings#plugin-settings).559For full configuration options, see [Plugin settings](/en/settings#plugin-settings).
560 560
561### Pre-populate plugins for containers
562
563For container images and CI environments, you can pre-populate a plugins directory at build time so Claude Code starts with marketplaces and plugins already available, without cloning anything at runtime. Set the `CLAUDE_CODE_PLUGIN_SEED_DIR` environment variable to point at this directory.
564
565The seed directory mirrors the structure of `~/.claude/plugins`:
566
567```
568$CLAUDE_CODE_PLUGIN_SEED_DIR/
569 known_marketplaces.json
570 marketplaces/<name>/...
571 cache/<marketplace>/<plugin>/<version>/...
572```
573
574The simplest way to build a seed directory is to run Claude Code once during image build, install the plugins you need, then copy the resulting `~/.claude/plugins` directory into your image and point `CLAUDE_CODE_PLUGIN_SEED_DIR` at it.
575
576At startup, Claude Code registers marketplaces found in the seed's `known_marketplaces.json` into the primary configuration, and uses plugin caches found under `cache/` in place without re-cloning. This works in both interactive mode and non-interactive mode with the `-p` flag.
577
578Behavior details:
579
580* **Read-only**: the seed directory is never written to. Auto-updates are disabled for seed marketplaces since git pull would fail on a read-only filesystem.
581* **Seed entries take precedence**: marketplaces declared in the seed overwrite any matching entries in the user's configuration on each startup. To opt out of a seed plugin, use `/plugin disable` rather than removing the marketplace.
582* **Path resolution**: Claude Code locates marketplace content by probing `$CLAUDE_CODE_PLUGIN_SEED_DIR/marketplaces/<name>/` at runtime, not by trusting paths stored inside the seed's JSON. This means the seed works correctly even when mounted at a different path than where it was built.
583* **Composes with settings**: if `extraKnownMarketplaces` or `enabledPlugins` declare a marketplace that already exists in the seed, Claude Code uses the seed copy instead of cloning.
584
561### Managed marketplace restrictions585### Managed marketplace restrictions
562 586
563For organizations requiring strict control over plugin sources, administrators can restrict which plugin marketplaces users are allowed to add using the [`strictKnownMarketplaces`](/en/settings#strictknownmarketplaces) setting in managed settings.587For organizations requiring strict control over plugin sources, administrators can restrict which plugin marketplaces users are allowed to add using the [`strictKnownMarketplaces`](/en/settings#strictknownmarketplaces) setting in managed settings.
771 795
772* Verify the marketplace URL is accessible796* Verify the marketplace URL is accessible
773* Check that `.claude-plugin/marketplace.json` exists at the specified path797* Check that `.claude-plugin/marketplace.json` exists at the specified path
774* Ensure JSON syntax is valid using `claude plugin validate` or `/plugin validate`798* Ensure JSON syntax is valid and frontmatter is well-formed using `claude plugin validate` or `/plugin validate`
775* For private repositories, confirm you have access permissions799* For private repositories, confirm you have access permissions
776 800
777### Marketplace validation errors801### Marketplace validation errors
778 802
779Run `claude plugin validate .` or `/plugin validate .` from your marketplace directory to check for issues. Common errors:803Run `claude plugin validate .` or `/plugin validate .` from your marketplace directory to check for issues. The validator checks `plugin.json`, skill/agent/command frontmatter, and `hooks/hooks.json` for syntax and schema errors. Common errors:
780 804
781| Error | Cause | Solution |805| Error | Cause | Solution |
782| :------------------------------------------------ | :------------------------------ | :--------------------------------------------------------------------------------------------- |806| :------------------------------------------------ | :---------------------------------------------- | :--------------------------------------------------------------------------------------------- |
783| `File not found: .claude-plugin/marketplace.json` | Missing manifest | Create `.claude-plugin/marketplace.json` with required fields |807| `File not found: .claude-plugin/marketplace.json` | Missing manifest | Create `.claude-plugin/marketplace.json` with required fields |
784| `Invalid JSON syntax: Unexpected token...` | JSON syntax error | Check for missing commas, extra commas, or unquoted strings |808| `Invalid JSON syntax: Unexpected token...` | JSON syntax error in marketplace.json | Check for missing commas, extra commas, or unquoted strings |
785| `Duplicate plugin name "x" found in marketplace` | Two plugins share the same name | Give each plugin a unique `name` value |809| `Duplicate plugin name "x" found in marketplace` | Two plugins share the same name | Give each plugin a unique `name` value |
786| `plugins[0].source: Path contains ".."` | Source path contains `..` | Use paths relative to the marketplace root without `..`. See [Relative paths](#relative-paths) |810| `plugins[0].source: Path contains ".."` | Source path contains `..` | Use paths relative to the marketplace root without `..`. See [Relative paths](#relative-paths) |
811| `YAML frontmatter failed to parse: ...` | Invalid YAML in a skill, agent, or command file | Fix the YAML syntax in the frontmatter block. At runtime this file loads with no metadata. |
812| `Invalid JSON syntax: ...` (hooks.json) | Malformed `hooks/hooks.json` | Fix JSON syntax. A malformed `hooks/hooks.json` prevents the entire plugin from loading. |
787 813
788**Warnings** (non-blocking):814**Warnings** (non-blocking):
789 815
790* `Marketplace has no plugins defined`: add at least one plugin to the `plugins` array816* `Marketplace has no plugins defined`: add at least one plugin to the `plugins` array
791* `No marketplace description provided`: add `metadata.description` to help users understand your marketplace817* `No marketplace description provided`: add `metadata.description` to help users understand your marketplace
818* `Plugin name "x" is not kebab-case`: the plugin name contains uppercase letters, spaces, or special characters. Rename to lowercase letters, digits, and hyphens only (for example, `my-plugin`). Claude Code accepts other forms, but the Claude.ai marketplace sync rejects them.
792 819
793### Plugin installation failures820### Plugin installation failures
794 821