modified Week 14 · March 30 – April 3, 2026 View current →
--- a/2026-w14.md +++ b/2026-w14.md @@ -63,7 +63,7 @@ └── bin/ └── my-tool -[Plugins reference](</docs/en/plugins-reference#file-locations-reference>) +[Plugins reference](</docs/en/plugins/manifest-reference#standard-layout>) Other wins
modified Week 17 · April 20–24, 2026 View current →
--- a/2026-w17.md +++ b/2026-w17.md @@ -68,7 +68,7 @@ Auto mode: include `“$defaults”` in [`autoMode.allow`, `soft_deny`, or `environment`](</docs/en/auto-mode-config>) to add custom rules alongside the built-in list instead of replacing it -New [`claude plugin tag`](</docs/en/plugin-dependencies#tag-plugin-releases-for-version-resolution>) command creates release git tags for plugins with version validation +New [`claude plugin tag`](</docs/en/plugins/dependencies#tag-plugin-releases-for-version-resolution>) command creates release git tags for plugins with version validation Opus 4.7 sessions now compute against the model’s native 1M context window, fixing inflated `/context` percentages and premature autocompaction
modified Week 19 · May 4–8, 2026 View current →
--- a/2026-w19.md +++ b/2026-w19.md @@ -1,4 +1,4 @@ -Releases [v2.1.128 → v2.1.136](</en/changelog#2-1-128>)2 features · May 4–8 +Releases [v2.1.128 → v2.1.136](</docs/en/changelog#2-1-128>)2 features · May 4–8 Plugins from .zip archives and URLs @@ -10,13 +10,13 @@ claude --plugin-url https://example.com/my-plugin.zip -[Plugins guide](</en/plugins>) +[Plugins guide](</docs/en/plugins/overview>) History search across all your projectsv2.1.129 `Ctrl+R` reverse-search now defaults to all prompts across every project, restoring the behavior from before v2.1.124. Press `Ctrl+S` while searching to narrow back to the current project or session. Handy when you remember a command you ran in another repo last week and don’t want to go digging for it. -[Interactive mode: command history](</en/interactive-mode#command-history>) +[Interactive mode: command history](</docs/en/interactive-mode#command-history>) Other wins
modified Week 23 · June 1–5, 2026 View current →
--- a/2026-w23.md +++ b/2026-w23.md @@ -34,7 +34,7 @@ > /plugin list --enabled -[Plugin commands](</docs/en/plugins-reference#plugin-list>) +[Plugin commands](</docs/en/plugins/cli-reference#plugin-list>) Version requirements for managed deploymentsv2.1.163
modified Week 32 · August 3–7, 2026 View current →
--- a/2026-w32.md +++ b/2026-w32.md @@ -52,13 +52,13 @@ Sandbox credential files accept [`mode: “mask”`](</docs/en/sandboxing#mask-credential-files>) on Linux and WSL2, so sandboxed commands read a sentinel copy while the sandbox proxy substitutes the real value on egress; credential masking also gains `extract`, JWT-aware `decode`, and AWS SigV4 re-signing options -Marketplaces can distribute a plugin as a [zip archive](</docs/en/plugin-marketplaces#zip-archives>) with the new `archive` source, downloaded over HTTPS with an optional SHA-256 pin, so installs work without git or npm +Marketplaces can distribute a plugin as a [zip archive](</docs/en/plugins/marketplace-reference#archive-plugin-source>) with the new `archive` source, downloaded over HTTPS with an optional SHA-256 pin, so installs work without git or npm `/review` is now an alias of [`/code-review`](</docs/en/code-review#review-a-diff-locally>), and `/code-review` with no effort level reuses the level you typed last A session you copy with [`/fork`](</docs/en/agent-view#copy-the-session-with-%2Ffork>) now makes its code changes in a worktree of its own instead of the original session’s checkout -Plugins you install from [`/plugin`](</docs/en/discover-plugins#install-plugins>) activate in the current session when it’s safe to do so; the install summary reports `Plugin is now active.` or tells you to run `/reload-plugins` +Plugins you install from [`/plugin`](</docs/en/plugins/install#install-a-plugin>) activate in the current session when it’s safe to do so; the install summary reports `Plugin is now active.` or tells you to run `/reload-plugins` [Background sessions](</docs/en/agent-view#how-file-edits-are-isolated>) that changed code in a worktree now commit and push before finishing, open a draft pull request only when the task calls for one, and follow the git instructions in your `CLAUDE.md`
modified Week 33 · August 10–14, 2026 View current →
--- a/2026-w33.md +++ b/2026-w33.md @@ -42,7 +42,7 @@ Interactive sessions on one machine keep [unique names](</docs/en/cross-session-messaging#see-which-sessions-claude-can-reach>): if you start or rename a session with a name another live session already uses, Claude Code gives yours a `name-word-word` variant and tells you -Plugin marketplaces accept [`command` sources](</docs/en/plugin-marketplaces#command-sources>): a local command prints the plugin directory, which Claude Code re-resolves each session and applies without a restart +Plugin marketplaces accept [`command` sources](</docs/en/plugins/marketplace-reference#command-plugin-source>): a local command prints the plugin directory, which Claude Code re-resolves each session and applies without a restart On Linux and WSL, set [`CLAUDE_CODE_TOOL_MEMORY_LIMIT`](</docs/en/tools-reference#memory-limit-on-linux-and-wsl>) to a size such as `4G` to cap the memory Bash and PowerShell tool commands can use @@ -50,7 +50,7 @@ [`/code-review`](</docs/en/code-review#review-a-diff-locally>) at high, xhigh, and max effort now runs in a background agent like the other levels -[`/plugin install plugin@marketplace`](</docs/en/discover-plugins#install-plugins>) refreshes the marketplace first, so newly published plugins install without a manual marketplace update +[`/plugin install plugin@marketplace`](</docs/en/plugins/install#install-a-plugin>) refreshes the marketplace first, so newly published plugins install without a manual marketplace update Settings accept [`additionalMarketplaces` and `allowedMarketplaces`](</docs/en/settings-reference#marketplace-key-aliases>) as aliases for `extraKnownMarketplaces` and `strictKnownMarketplaces`
modified Week 37 · September 7–11, 2026 View current →
--- a/2026-w37.md +++ b/2026-w37.md @@ -24,11 +24,11 @@ Set [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) at the top level or per model under `modelSettings` to cap the effort level on every provider, including Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry; any higher level runs at the cap -Point `--plugin-dir` at a folder of plugins to [load each immediate subfolder that has a manifest](</docs/en/plugins#test-your-plugins-locally>) +Point `--plugin-dir` at a folder of plugins to [load each immediate subfolder that has a manifest](</docs/en/plugins/create#load-a-directory-or-archive-for-one-session>) If WebFetch hasn’t finished downloading a page within five minutes, [the fetch fails with a deadline error](</docs/en/tools-reference#webfetch-tool-behavior>) instead of hanging; set `CLAUDE_CODE_WEBFETCH_DEADLINE_MS` to change the deadline, or to `0` to remove the limit -Pass `--json` to `claude plugin install`, `uninstall`, `update`, `enable`, or `disable` to print the result as [one JSON object on the last line of stdout](</docs/en/plugins-reference#plugin-json-result>) +Pass `--json` to `claude plugin install`, `uninstall`, `update`, `enable`, or `disable` to print the result as [one JSON object on the last line of stdout](</docs/en/plugins/cli-reference#plugin-json-result>) When the auto mode classifier blocks an action, the reason Claude receives [usually names the rule that matched](</docs/en/auto-mode-config#fix-a-denial-with-an-allow-rule-an-environment-entry-or-a-retry>), such as `[Data Exfiltration]`
modified Set up Claude Code for your organization View current →
--- a/admin-setup.md +++ b/admin-setup.md @@ -82,9 +82,9 @@ [Sandboxing](</docs/en/sandboxing>)| OS-level filesystem and network isolation with domain allowlists| `sandbox.enabled`, `sandbox.network.allowedDomains` [Managed policy CLAUDE.md](</docs/en/memory#deploy-organization-wide-claude-md>)| Org-wide instructions loaded in every session, can’t be excluded| File at the managed policy path [MCP server control](</docs/en/managed-mcp>)| Restrict which MCP servers users can add or connect to, deploy a fixed set, or provide remote servers to every user alongside their own| `allowedMcpServers`, `deniedMcpServers`, `allowManagedMcpServersOnly`, `managedMcpServers`, or a deployed `managed-mcp.json` file -[Plugin marketplace control](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>)| Restrict which marketplace sources users can add and install from, reject the CLI flags that sideload plugins, agents, and MCP servers for a single run, block [`command` plugin sources](</docs/en/plugin-marketplaces#command-sources>), and allowlist which marketplaces’ plugins can be suggested| `strictKnownMarketplaces`, `blockedMarketplaces`, `disableSideloadFlags`, `disableCommandPluginSources`, `pluginSuggestionMarketplaces` +[Plugin marketplace control](</docs/en/plugins/org#restrict-what-users-can-install>)| Restrict which marketplace sources users can add and install from, reject the CLI flags that sideload plugins, agents, and MCP servers for a single run, block [`command` plugin sources](</docs/en/plugins/marketplace-reference#command-plugin-source>), and allowlist which marketplaces’ plugins can be suggested| `strictKnownMarketplaces`, `blockedMarketplaces`, `disableSideloadFlags`, `disableCommandPluginSources`, `pluginSuggestionMarketplaces` [Customization lockdown](</docs/en/settings-reference#strictpluginonlycustomization>)| Block skills, agents, hooks, and MCP servers from user and project sources, so they can only come from plugins or managed settings. Locking skills also stops the [skills your developers enable on claude.ai](</docs/en/skills#where-synced-skills-load>) from syncing| `strictPluginOnlyCustomization` -[Disable claude.ai sync](</docs/en/settings-reference#syncclaudeaiskills>)| Stop Claude Code from loading the [skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins-reference#synced-plugins>) your developers enable on claude.ai. If you turn off Skills for your organization on claude.ai, Claude Code stops syncing both, and on v2.1.273 or later it also removes the ones it already synced. To stop either one without turning Skills off, set its key to `false` in managed settings| `syncClaudeAiSkills`, `syncClaudeAiPlugins` +[Disable claude.ai sync](</docs/en/settings-reference#syncclaudeaiskills>)| Stop Claude Code from loading the [skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#synced-plugins>) your developers enable on claude.ai. If you turn off Skills for your organization on claude.ai, Claude Code stops syncing both, and on v2.1.273 or later it also removes the ones it already synced. To stop either one without turning Skills off, set its key to `false` in managed settings| `syncClaudeAiSkills`, `syncClaudeAiPlugins` [Hook restrictions](</docs/en/settings-reference#allowmanagedhooksonly>)| Restrict which hooks run and restrict HTTP hook URLs; see [what runs under `allowManagedHooksOnly`](</docs/en/settings-reference#what-runs-under-allowmanagedhooksonly>) for the full effect list| `allowManagedHooksOnly`, `allowedHttpHookUrls` [Login enforcement](</docs/en/settings-reference#forceloginmethod>)| Restrict login to a specific method or Anthropic organization. The method restriction applies across the VS Code extension, Agent SDK, `claude setup-token`, and `/install-github-app`, and the terminal’s interactive login screen, reached by `/login` or first-run onboarding, pre-selects the method without enforcing it; Claude Code verifies the organization for claude.ai account logins in the terminal, VS Code extension, and Agent SDK, and doesn’t check it for Claude Console logins or for [gateway](</docs/en/claude-apps-gateway>) sign-in. Before v2.1.212, only terminal logins applied either key. When set, sessions authenticated by `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` are blocked at startup; cloud provider sessions aren’t affected| `forceLoginMethod`, `forceLoginOrgUUID` [Disable agent view](</docs/en/agent-view#how-background-sessions-are-hosted>)| Turn off `claude agents`, `--bg`, `/background`, and the on-demand supervisor| `disableAgentView`
modified Orchestrate teams of Claude Code sessions View current →
--- a/agent-teams.md +++ b/agent-teams.md @@ -96,7 +96,7 @@ `tmux` has known limitations on certain operating systems and traditionally works best on macOS. Using `tmux -CC` in iTerm2 is the suggested entrypoint into `tmux`. -The default is `"in-process"`. Set `"auto"` to enable split panes when you’re already running inside a tmux session, or when your terminal is iTerm2 with the `it2` CLI installed, falling back to in-process otherwise. The `"tmux"` setting enables split-pane mode and auto-detects whether to use tmux or iTerm2 based on your terminal. As of v2.1.186, set `"iterm2"` to use iTerm2 native split panes explicitly. This mode requires the [`it2` CLI](<https://github.com/mkusaka/it2>) and shows an error with the install command if `it2` is missing. The setup prompt that offers to install `it2` or switch to tmux appears under `"auto"` or `"tmux"` when your terminal is iTerm2 and tmux is available as a fallback. To override the default, set [`teammateMode`](</docs/en/settings-reference#teammatemode>) in `~/.claude/settings.json`: +The default is `"in-process"`. Set `"auto"` to enable split panes when you’re already running inside a tmux session, or when your terminal is iTerm2 with the `it2` CLI installed, falling back to in-process otherwise. The `"tmux"` setting enables split-pane mode and auto-detects whether to use tmux or iTerm2 based on your terminal. Set `"iterm2"` to use iTerm2 native split panes explicitly. This mode requires the [`it2` CLI](<https://github.com/mkusaka/it2>) and shows an error with the install command if `it2` is missing. The setup prompt that offers to install `it2` or switch to tmux appears under `"auto"` or `"tmux"` when your terminal is iTerm2 and tmux is available as a fallback. To override the default, set [`teammateMode`](</docs/en/settings-reference#teammatemode>) in `~/.claude/settings.json`: { "teammateMode": "auto"
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -547,7 +547,7 @@ ---|--- [`--settings <file-or-json>`](</docs/en/settings>)| Override settings for agent view and dispatched sessions [`--add-dir <path>`](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>)| Grant file access to an additional directory -[`--plugin-dir <path>`](</docs/en/plugins>)| Load a plugin from a local directory +[`--plugin-dir <path>`](</docs/en/plugins/create#load-a-directory-or-archive-for-one-session>)| Load a plugin from a local directory [`--mcp-config <file-or-json>`](</docs/en/mcp>)| Load MCP servers from a config file or JSON string `--strict-mcp-config`| Use only the MCP servers from `--mcp-config`, ignoring other MCP configuration. See [Exclusive control with managed-mcp.json](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>) for what the flag does under a managed MCP file @@ -885,7 +885,7 @@ v2.1.257| A prompt stashed with `Ctrl+S` inside an opened background session is kept with the session, so `Ctrl+S` restores it after the session’s process is stopped and started again. Before this release, the stash lived only in the running process and was lost when the session went idle long enough for its process to stop, or when it was stopped and then reopened. v2.1.251| In a background session that hasn’t moved into a worktree, Claude and the subagents it spawns can edit files inside a linked git worktree. v2.1.251| Claude Code forwards a cloud provider gateway exported in the shell you dispatch from, such as `ANTHROPIC_VERTEX_BASE_URL` or `ANTHROPIC_BEDROCK_BASE_URL` with its auth-bypass flag, to the session’s worker under the same conditions as `ANTHROPIC_BASE_URL`. Before this release, if you backgrounded or dispatched from a shell authenticated only through such a gateway, every request the session made failed, because the endpoint and flag were dropped from its environment. -v2.1.251| When a background session starts while another Claude Code process is refreshing a [plugin marketplace](</docs/en/plugin-marketplaces>), such as a sibling session running the [marketplace auto-update](</docs/en/discover-plugins#configure-auto-updates>), Claude Code keeps that marketplace’s plugins available. Before this release, such a session could start without any of that marketplace’s skills, agents, hooks, and MCP servers and stay that way for its whole run. +v2.1.251| When a background session starts while another Claude Code process is refreshing a [plugin marketplace](</docs/en/plugins/overview>), such as a sibling session running the [marketplace auto-update](</docs/en/plugins/install#keep-plugins-updated>), Claude Code keeps that marketplace’s plugins available. Before this release, such a session could start without any of that marketplace’s skills, agents, hooks, and MCP servers and stay that way for its whole run. v2.1.248| `Shift+Enter` in the dispatch input inserts a newline, matching the main prompt, and `Ctrl+Enter` dispatches and attaches immediately in terminals where the `?` overlay lists `ctrl+enter to start and open`. Before this release, `Shift+Enter` dispatched and attached. v2.1.248| Deleting a session succeeds when the worktree’s commits are already on the local copy of your `origin` remote’s default branch and your main checkout has that branch checked out; before this release, the delete was refused with `has commits that are not pushed anywhere`. v2.1.248| A session backgrounded with `←` or `/background` holds the [`git worktree lock`](</docs/en/worktrees#clean-up-subagent-and-background-session-worktrees>) on its worktree while it runs; before this release, backgrounding released the lock, and cleanup or `git worktree remove` could remove the worktree under the running session.
modified Run agents in parallel View current →
--- a/agents.md +++ b/agents.md @@ -12,7 +12,7 @@ * [Worktrees](</docs/en/worktrees>) give each session a separate git checkout, so parallel sessions never edit the same files. Use them for sessions you run yourself. A session you dispatch from agent view [moves into a worktree of its own before it edits files](</docs/en/agent-view#how-file-edits-are-isolated>), and subagents you spawn can each get one too. * [Cross-session messaging](</docs/en/cross-session-messaging>) lets Claude list and message your other Claude Code sessions on this machine, on another machine, or [in the cloud](</docs/en/claude-code-on-the-web>), so sessions you run yourself can pass findings and status between themselves. - * [`/batch`](</docs/en/commands>) is a [skill](</docs/en/skills>) that has Claude split one large change into 5 to 30 worktree-isolated subagents that each open a pull request. It’s a packaged use of subagents and worktrees, not a separate coordination style. + * [`/batch`](</docs/en/commands>) is a [skill](</docs/en/skills>) that has Claude split one large change into 5 to 30 worktree-isolated subagents. It’s a packaged use of subagents and worktrees, not a separate coordination style. A few other features run Claude without you driving each step, but they solve a different problem than splitting work across agents:
modified Claude Code on Amazon Bedrock View current →
--- a/amazon-bedrock.md +++ b/amazon-bedrock.md @@ -378,7 +378,7 @@ Use the Mantle endpoint -Mantle is an Amazon Bedrock endpoint that serves Claude models through the native Anthropic API shape rather than the Amazon Bedrock Invoke API. It uses the same AWS credentials, IAM permissions, and `awsAuthRefresh` configuration. +Mantle is an Amazon Bedrock endpoint that serves Claude models through the native Anthropic API shape rather than the Amazon Bedrock Invoke API. It uses the same AWS credentials and `awsAuthRefresh` configuration. Mantle has its own IAM actions under the `bedrock-mantle:` prefix, so the `bedrock:` actions in IAM configuration don’t cover it. Grant your IAM identity `bedrock-mantle:CreateInference` for inference and `bedrock-mantle:CountTokens` for token counting. See [Making inference requests](<https://docs.aws.amazon.com/bedrock/latest/userguide/inference.html>) and [Counting tokens](<https://docs.aws.amazon.com/bedrock/latest/userguide/count-tokens.html>) in the AWS documentation, and the [service authorization reference](<https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonbedrockpoweredbyawsmantle.html>) for every Mantle action. ### @@ -518,7 +518,12 @@ Mantle endpoint errors -If `/status` does not show `Amazon Bedrock (Mantle)` after you set `CLAUDE_CODE_USE_MANTLE`, the variable is not reaching the process. Confirm it is exported in the shell where you launched `claude`, or set it in the `env` block of your [settings file](</docs/en/settings>). A `403` from the Mantle endpoint with valid credentials means your AWS account has not been granted access to the model you requested. Contact your AWS account team to request access. A `400` that names the model ID means that model is not served on Mantle. Mantle has its own model lineup separate from the standard Amazon Bedrock catalog, so inference profile IDs such as `us.anthropic.claude-sonnet-4-6` will not work. Use a Mantle-format ID, or enable both endpoints so Claude Code routes each request to the endpoint where the model is available. +If `/status` does not show `Amazon Bedrock (Mantle)` after you set `CLAUDE_CODE_USE_MANTLE`, the variable is not reaching the process. Confirm it is exported in the shell where you launched `claude`, or set it in the `env` block of your [settings file](</docs/en/settings>). What a `403` from the Mantle endpoint means depends on whether the error names an IAM action: + + * If the error names a `bedrock-mantle:` action, grant your IAM identity that action. + * If the error names no action and your credentials are valid, your AWS account has not been granted access to the model you requested. Contact your AWS account team to request access. + +A `400` that names the model ID means that model is not served on Mantle. Mantle has its own model lineup separate from the standard Amazon Bedrock catalog, so inference profile IDs such as `us.anthropic.claude-sonnet-4-6` will not work. Use a Mantle-format ID, or enable both endpoints so Claude Code routes each request to the endpoint where the model is available. ##
added Anthropic's marketplaces View current →
--- a/anthropic-marketplaces.md +++ b/anthropic-marketplaces.md @@ -0,0 +1,91 @@ +Anthropic publishes three general-purpose plugin marketplaces for Claude Code: [official](<https://github.com/anthropics/claude-plugins-official>), [community](<https://github.com/anthropics/claude-plugins-community>), and [demo](<https://github.com/anthropics/claude-code>). Each is a catalog of plugins in its own GitHub repository. When you install a plugin from one of them in a Claude Code session, you type the marketplace’s name after `@`, as in `/plugin install commit-commands@claude-plugins-official`. Use this page to distinguish the three marketplaces and to find where to check whether the official one holds a given plugin. + +These cases are covered on other pages: + + * **How to install a plugin** : see [Install plugins](</docs/en/plugins/install>) + * **A failed install** : see [Troubleshoot plugins](</docs/en/plugins/troubleshooting>) + +Go to the part of the page you need: + + * To distinguish the three marketplaces by repository, marketplace name, and how you get each one, see Anthropic’s marketplaces. + * To find a plugin in the official marketplace, see Find plugins in the official marketplace. + +## + +​ + +Anthropic’s marketplaces + +A marketplace is a catalog of plugins that a repository defines in its `.claude-plugin/marketplace.json` file. The official, community, and demo marketplaces each come from their own GitHub repository. Anthropic also publishes topic-specific marketplaces, such as `anthropics/skills` and `anthropics/knowledge-work-plugins`, which you add in a Claude Code session with `/plugin marketplace add <owner>/<repo>`. This table gives each marketplace’s repository and marketplace name, which is what you type after `@` when you install a plugin from that marketplace. The community marketplace’s name is `claude-community`, not its repository name. + +| Official| Community| Demo +---|---|---|--- +Repository| [`anthropics/claude-plugins-official`](<https://github.com/anthropics/claude-plugins-official>)| [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>)| [`anthropics/claude-code`](<https://github.com/anthropics/claude-code/tree/main/plugins>) +Marketplace name| `claude-plugins-official`| `claude-community`| `claude-code-plugins` +What’s in it| Plugins Anthropic maintains, plus plugins from partners and other authors| Third-party plugins that their authors submitted to Anthropic| A small set of example plugins that show what a plugin can contain +How you get it| Claude Code adds it the first time you start an interactive terminal session, unless a [managed policy](</docs/en/plugins/org#allow-the-official-marketplace-and-your-own>) or `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL` blocks it. See [Marketplace `claude-plugins-official` not found](</docs/en/plugins/troubleshooting#marketplace-claude-plugins-official-not-found>) if it’s missing| You add it in a Claude Code session with `/plugin marketplace add anthropics/claude-plugins-community`| You add it in a Claude Code session with `/plugin marketplace add anthropics/claude-code` + +If you wrote a plugin and want other people to install it, see [Publish a plugin](</docs/en/plugins/publish>), which covers your own marketplace and submitting to the community marketplace. + +### + +​ + +The demo marketplace in `anthropics/claude-code` + +If a tutorial or an older set of instructions tells you to run `/plugin marketplace add anthropics/claude-code`, that adds the demo marketplace, named `claude-code-plugins`. It isn’t the official marketplace, which Claude Code already added for you. Most of the demo marketplace’s plugins are also in the official marketplace under the same names. For example, `code-review`, `feature-dev`, `commit-commands`, and `security-guidance` are in both. Install those from `claude-plugins-official` so you don’t have two copies installed. + +## + +​ + +Find plugins in the official marketplace + +The official marketplace, `claude-plugins-official`, is the one Claude Code adds for you. Most of what it lists comes from partners and other authors rather than from Anthropic: tool vendors publish plugins that connect Claude Code to their services, and Anthropic maintains a smaller set of its own, such as `commit-commands`, `code-review`, `feature-dev`, and the [language server plugins](</docs/en/plugins/code-intelligence>). The catalog changes often, so this page doesn’t list it. To see what’s in it, use the **Discover** tab of `/plugin` in a Claude Code session, which you can search, or browse [Claude Marketplace](<https://claude.com/marketplace/plugins>) on the web. + +## + +​ + +Browse and install from Anthropic’s marketplaces + +You can search Anthropic’s marketplaces for a plugin in Claude Code, on the web, or on GitHub: + + * **In Claude Code, by browsing** : run `/plugin` in an interactive session. Its **Discover** tab lists the plugins from the marketplaces you’ve added. + * **In Claude Code, by name** : run `/plugin install <name>` in a session, which looks the name up in the marketplaces you’ve added. If the plugin is in one of them, its details open in the `/plugin` panel, and nothing installs until you choose an [installation scope](</docs/en/plugins/install#install-a-plugin>) and confirm there. If it isn’t, you see `Plugin "<name>" not found in any marketplace`. + * **On the web** : search the full catalog on [Claude Marketplace](<https://claude.com/marketplace/plugins>), which shows install counts and marks some plugins **Anthropic verified**. + * **On GitHub** : open `.claude-plugin/marketplace.json` in the marketplace’s repository, such as [`anthropics/claude-plugins-official`](<https://github.com/anthropics/claude-plugins-official>). That file is the catalog itself. + +To install from the desktop app or from a script, or to see what a cloud session loads, see [Install plugins](</docs/en/plugins/install>). + +### + +​ + +Add the community or demo marketplace + +The community and demo marketplaces aren’t registered until you add them in a Claude Code session: + + * **Community** : run `/plugin marketplace add anthropics/claude-plugins-community`, then install with the `@claude-community` suffix. + * **Demo** : run `/plugin marketplace add anthropics/claude-code`, then install with the `@claude-code-plugins` suffix. + +If `claude-plugins-official` isn’t on the **Marketplaces** tab of `/plugin`, add it the same way with `/plugin marketplace add anthropics/claude-plugins-official`. For `not found` errors and marketplaces that won’t add, see [Troubleshoot plugins](</docs/en/plugins/troubleshooting#install-a-plugin>). + +## + +​ + +Third-party marketplaces + +Many popular plugins aren’t in any Anthropic marketplace. They’re in their authors’ own marketplaces, usually a GitHub repository with a `.claude-plugin/marketplace.json` at its root. Anthropic doesn’t review third-party marketplaces, so read [Plugin security and trust](</docs/en/plugins/security>) before you add one. To use a third-party marketplace, add its repository in a Claude Code session with `/plugin marketplace add <owner>/<repo>`, then install with `/plugin install <plugin>@<marketplace-name>`. The marketplace name is the `name` field of that `marketplace.json`, and Claude Code prints it once it has added the marketplace. For other ways to add a marketplace, see [Add a marketplace](</docs/en/plugins/install#add-a-marketplace>). + +## + +​ + +Next steps + + * [Install and manage plugins](</docs/en/plugins/install>): install a plugin from one of these marketplaces and choose a scope + * [Plugin security and trust](</docs/en/plugins/security>): what a plugin can do on your machine and how to review one before you install it + * [Code intelligence plugins](</docs/en/plugins/code-intelligence>): install one of the official marketplace’s language-server plugins + * [Create a marketplace](</docs/en/plugins/create-marketplace>): run your own marketplace alongside Anthropic’s
modified Best practices for Claude Code View current →
--- a/best-practices.md +++ b/best-practices.md @@ -296,7 +296,7 @@ Run `/plugin` to browse the marketplace. Plugins add skills, tools, and integrations without configuration. -[Plugins](</docs/en/plugins>) bundle skills, hooks, subagents, and MCP servers into a single installable unit from the community and Anthropic. If you work with a typed language, install a [code intelligence plugin](</docs/en/discover-plugins#code-intelligence>) to give Claude precise symbol navigation and automatic error detection after edits. For guidance on choosing between skills, subagents, hooks, and MCP, see [Extend Claude Code](</docs/en/features-overview#match-features-to-your-goal>). +[Plugins](</docs/en/plugins/overview>) bundle skills, hooks, subagents, and MCP servers into a single installable unit from the community and Anthropic. If you work with a typed language, install a [code intelligence plugin](</docs/en/plugins/code-intelligence>) to give Claude precise symbol navigation and automatic error detection after edits. For guidance on choosing between skills, subagents, hooks, and MCP, see [Extend Claude Code](</docs/en/features-overview#match-features-to-your-goal>). * * * @@ -491,7 +491,7 @@ Loop through tasks calling `claude -p` for each. Use `--allowedTools` to scope permissions for batch operations. -For large migrations or analyses, you can distribute work across many parallel Claude invocations. In a git repository, run [`/batch <instruction>`](</docs/en/commands#all-commands>) to have Claude split the change across 5 to 30 subagents. Each subagent works in its own worktree and opens a pull request. To drive the fan-out from your own script instead, loop over `claude -p`: +For large migrations or analyses, you can distribute work across many parallel Claude invocations. Run [`/batch <instruction>`](</docs/en/commands#all-commands>) to have Claude split the change across 5 to 30 subagents. Each subagent works in its own worktree. To drive the fan-out from your own script instead, loop over `claude -p`: 1
modified Claude Code changelog View current →
Show diff (117 lines)
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,97 @@ This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Run `claude --version` to check your installed version. + +​ + +2.1.282 + +September 24, 2026 + + * Added a `maxProseWidth` setting that caps the width of Claude’s prose in wide terminals while tables and code blocks keep the full width + * Added a startup notice, and `/status` and `claude doctor` entries, listing telemetry variables in a project’s settings files that were ignored or that turned telemetry off + * Added the `allowClaudeInChromeWithManagedMcp` managed setting to let `claude --chrome` run alongside an exclusive `managed-mcp.json`; the error shown when Chrome is blocked now names it + * Added `store.readiness_grace_seconds` to the Claude apps gateway so `/readyz` can stay ready through a short Postgres outage such as a database failover + * Added a scrollbar to the `/feedback` drafts list in fullscreen mode; it appears while the mouse is over the list + * Fixed every request failing with a 400 error in conversations whose history holds web search results the API cannot decrypt (for example, from a turn answered through a third-party gateway) + * Fixed more cases of continued or resumed sessions (`--continue`, `--resume`) re-sending earlier messages in a changed form, which could make the API drop Claude’s earlier reasoning + * Fixed earlier extended thinking being dropped when `/model`, `/rename`, `/artifacts` or another immediate slash command was used while Claude was working + * Fixed continued or resumed conversations losing earlier extended thinking when relaunched with a `--tools` list that leaves out a built-in tool offered earlier in the conversation + * Fixed sessions failing on every turn with an “Invalid `data` in `redacted_thinking` block” API error; Claude Code now drops the conversation’s thinking blocks and retries once + * Fixed compaction failing when the summarization request is refused; it now retries on a fallback model + * Fixed a failed turn (“Effort ‘xhigh’ isn’t available with thinking turned off”) after a safety-related model switch in sessions with thinking off and effort above high + * Fixed an unanswered Fable usage-credits prompt switching models in SDK-hosted sessions such as Claude Desktop; the turn now ends instead, and Remote Control clients now see the model-switch notice + * Fixed `/model` with a full Fable model id stopping at an API error instead of opening the usage-credits prompt when the plan needs usage credits that aren’t turned on yet + * Fixed requests failing for up to a minute with an “another Claude Code process is refreshing it” login error after that other process was closed or killed mid-refresh + * Fixed sessions started while another Claude Code window was refreshing the sign-in (common with several VS Code windows) not retrying their organization policy fetch + * Fixed CLAUDE.md and rules being read at startup through a repository symlink reaching macOS’s `/Network` via `..` or a `/.vol`-style kernel path, or a rules link to macOS’s `/home` being listed + * Fixed Bash permission rules with a mid-pattern `:*` being skipped in settings files while `--allowedTools` honored them; they now work from every source, with a startup warning on how they match + * Fixed a command approved on a restored permission prompt running twice when a remote session’s worker restarted + * Fixed managed settings ignoring a mistyped value for boolean lock keys such as `disableClaudeAiConnectors` or `allowManagedPermissionRulesOnly`; the lock now applies and startup names the key + * Fixed managed `permissions`, `autoMode`, `worktree` and `attribution` settings being ignored entirely when one nested value was invalid; the rest of the block now still applies + * Fixed repository, user and `--add-dir` skills, commands and skills-directory plugin manifests pre-approving their own tools via `allowed-tools` under managed `allowManagedPermissionRulesOnly` + * Fixed safeguard block messages on Amazon Bedrock and Bedrock Mantle not showing a request ID; block messages now also show the message ID + * Vertex AI: Fixed web search not being offered for models Claude Code doesn’t recognize yet, such as newly released ones + * Fixed Bash and PowerShell hiding a full disk quota behind “Exit code 1” and leaving large output files in temp + * Fixed tool input validation errors naming only an unknown, missing or mistyped parameter when other parameters in the same call were also invalid; those are now listed too + * Fixed pasted multi-line text being submitted line by line after the terminal’s bracketed paste mode was reset mid-session + * Fixed the prompt’s example text flashing and disappearing at startup in projects with a `SessionStart` hook + * Fixed a blank screen flashing before the first frame when starting in fullscreen mode + * Fixed garbled, misplaced rows in the non-fullscreen renderer after the screen got shorter while still taller than the terminal, e.g. deleting a prompt line while a shell command streams output + * Fixed a stale character left in the last column of a diff when a redrawn line’s CJK character or emoji wrapped to the next row + * Fixed the cursor landing before the end of a prompt recalled from history when the prompt contains a tab + * Fixed the send-now hint showing ctrl+enter on terminals that send it as a newline (Windows Terminal before 1.25); it now shows ctrl+x ctrl+s there + * Fixed `claude remote-control --debug` failing with “Unknown argument: —debug”, although Remote Control’s own eligibility error says to run with `--debug` + * Fixed `/install-github-app` saying “cancelled” and then still pushing the branch and saving the API key secret; leaving now stops the remaining steps and reports what was already done + * Fixed /feedback, /bug and /share on Bedrock, Vertex and other third-party providers still saving the report file after you cancelled during the save + * Fixed plugin uninstall reporting success and deleting the plugin’s saved options when its settings file still enabled it or could not be read; it now stops and names the file + * Fixed plugin uninstall deleting a plugin’s saved options and secrets when the list of installed plugins could not be read after the removal; they are now kept and the uninstall says so + * Fixed a key typed right after `/` in `/skills` moving the skill list instead of reaching the search box + * Fixed the terminal cursor jumping from the `/skills` search box to the skill list while typing, which could hide the caret and put IME input in the wrong place + * Fixed lists with a scrollbar, such as `/skills` and `/mcp`, being two columns narrower outside fullscreen mode, where the scrollbar can never appear + * Fixed the agent panel footer wrapping onto two lines with long rebound keys, and its “Esc to collapse” hint ignoring a rebound collapse key + * Fixed a doubled `·` separator in the `/tasks` dialog footer when the stop-all-agents shortcut is unbound in `keybindings.json` + * Fixed artifact publishes failing when Claude gave the version a label longer than 60 characters; the label is now shortened + * Fixed screen-reader mode, quoted lists and very long lists dropping the blank lines at the top of a code block that opens a list item, directly or inside a quote + * Fixed PDF page-read error messages: paths with accented or non-Latin characters now appear readably, and a folder named like “password” or “invalid” can no longer make the error name the wrong cause + * Fixed vim mode `>>` indenting empty lines, `r` with a count longer than the line changing text, `2J` joining one line too many, and a count on the last line (`2dd`, `2>>`) shifting or deleting it + * Fixed vim mode cursor placement: after `dd`, `dj`, `dG` or a whole-line `p`/`P` it lands on the first non-blank, `yy` no longer moves it, and Esc after an emoji no longer leaves it inside the emoji + * Fixed vim mode ignoring a count typed before `.` when repeating `x`, `s`, `p`, `d` or `c`, and whole-line `p`/`P`, `o`, `O`, `J`, `>>` and `<<` acting on the wrong line when a line above wraps + * Fixed vim mode leaving the cursor past the end of a prompt recalled from history or pulled back from the queue in normal mode, so `x` did nothing + * Improved the time to resume very large sessions, including ones that were never compacted + * Improved the error shown on Windows when a session can’t be resumed because its transcript file could not be read (EBADF): it now names possible causes and what to try + * Improved the Claude Desktop unknown-model error to suggest switching to a different model + * Improved rendering of unusual Unicode in permission prompts + * Improved `/artifacts`: titles line up in one column, details are dropped whole instead of cut mid-word, and the list supports PgUp/PgDn, Home/End, the mouse wheel and clicks + * Updated the `claude-api` skill: pre-output refusal billing now links to the How refusals are billed docs, mid-stream refusals bill at normal rates, and pre-output refusals count against rate limits + * Updated the `claude-api` skill to recommend `ant apply` for keeping Managed Agents resources as version-controlled files + * Changed auto mode to use the server-side classifier by default on a direct Anthropic API connection when telemetry is off (`CLAUDE_CODE_AUTO_MODE_SERVER=0` opts out) + * Changed `sandbox.excludedCommands` to ignore project and local settings entries when managed settings or `--settings` set `allowUnsandboxedCommands: false`, or managed `allowManagedDomainsOnly: true` + * Changed project and local settings to ignore OpenTelemetry variables that turn on export, set its endpoint, or capture content, like `CLAUDE_CODE_ENABLE_TELEMETRY` and `OTEL_LOG_*` + * Changed Windows/WSL managed settings so an admin policy that is present but invalid or unreadable (HKLM, `managed-settings.json`) keeps user-writable HKCU and WSL `/etc/claude-code` from applying + * Changed `Skill(anthropic-skills:*)` and `Skill(claude-ai:*)` allow rules to cover only skills synced from claude.ai, not plugins or other skills that merely use such a name + * Changed skill folders, command files and workflow commands in the `anthropic-skills` or `claude-ai` namespace to no longer load; a plugin so named still loads but yields name ties to synced skills + * Changed MCP servers configured under the name `anthropic-skills` or `claude-ai` to list no skills or prompts (their tools still work); rename the server in your MCP configuration to list them again + * Changed the `ultracode` visuals in `/effort` and the prompt input to plain styling (no ripple, border flourish or keyword glimmer) and removed the dynamic-workflows spinner tip + * Changed the Clawd mascot’s feet in the start-up banner to sit under the corners of his body + * [VSCode] Fixed long replies falling behind the stream: the panel no longer re-parses the whole reply on every update + * [VSCode] Fixed the dictation mic button covering the message input’s scrollbar when the input is tall enough to scroll + * [VSCode] Fixed Remote Control sessions started on this computer not opening from their Web entry in the session list; they now open the local conversation unless it’s running elsewhere + * [VSCode] Fixed an editor tab’s sign-in screen hanging silently after the extension host restarts; it now shows the “stopped responding” notice too + * [Cloud sessions] Added Claude GitHub App status to Settings › Connectors › GitHub: whether the app is installed and reachable for your account, plus steps to connect, install or reconnect + * [Cloud sessions] Added “Open repository” and “Open compare page” links to the repository menu of a cloud session whose repository is hosted on a Git server other than GitHub + * [Cloud sessions] Added attaching a repository from a different GitHub owner, such as a fork’s upstream, to a running cloud session that already has one, including sessions started from Slack + * [Cloud sessions] Fixed the next run time shown for an hourly routine being 30 minutes off for people in half-hour-offset time zones such as India + * [Cloud sessions] Improved how quickly the Routines page and the sidebar’s Scheduled list load for accounts whose past sessions scheduled many check-in reminders + * [Claude Tag] Fixed auto-join channel patterns saved for one workspace in Claude Tag admin settings being ignored on an Enterprise Grid org-wide install; Claude now joins matching new channels + * [Claude Tag] Fixed Claude not responding in an Enterprise Grid channel shared between two workspaces of one organization when the channel’s Claude Tag version was saved from the other workspace + * [Claude Tag] Fixed the earlier Claude in Slack app’s progress card for sessions on a GitHub Enterprise Server repository: it now names the repository and offers a working Create PR button + * [Claude Tag] Fixed Slack threads whose model has been retired falling back to another model on every reply, slower and with a fallback note each time; the thread now moves to a working model + * [Claude Tag] Fixed files Claude uploads to Slack not being able to carry a caption containing a table; captions now render with the same formatting as replies + * [Claude Tag] Fixed Claude’s threads in Slack’s Agents & tools view sometimes being listed under their first message instead of their name; later renames now update the list too + * [Claude Tag] Fixed removing a GitHub organization’s grant from an access bundle’s Repositories tab in Claude Tag admin settings failing to save after that GitHub organization was disconnected + * [Claude Tag] Fixed Claude always replying “Couldn’t check this channel just now” in a channel shared with a Grid workspace it isn’t added to; the notice now says which workspace needs the app + * [Claude Tag] Fixed the cost and token totals in Claude’s reply footer reading many times too high after the session’s cloud worker restarted + * [Claude Tag] Changed the bordered cards Claude uses in Slack replies for plans, tables and details to render wide by default instead of a narrow width + * [Claude Tag] Changed newly connected Slack workspaces to follow the current default model instead of keeping whichever model was the default when they were connected ​ @@ -143,6 +236,7 @@ * Changed auto mode so that, where its classifier review runs server-side, read-only and sandboxed shell commands also wait for that review and are blocked when it flags them * Changed `CLAUDE_CODE_AUTO_MODE_SERVER` to also apply on a direct Anthropic API connection: `0` opts out of the server-side auto mode classifier (the local classifier then counts toward usage), `1` opts in * Changed the dangerous `rm` prompt in `--dangerously-skip-permissions` and auto mode to wait 2 minutes for an answer, then deny the command with a rewrite hint so unattended sessions keep going (`CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT=1` turns this off) + * Changed AGENTS.md support to also work on Amazon Bedrock, Google Vertex AI, Microsoft Foundry, LLM gateways, and sessions with telemetry disabled * Changed Claude apps gateway to refuse to start when a `managedMcpServers` entry’s `envHelper` path starts with `\??\` or `/??/`, a path form current Claude Desktop refuses to run * Changed self-hosted runners to pass system prompts to Claude Code as private files instead of command-line text, so large prompts no longer fail the launch; a wrapper or `command` hook that appends `--system-prompt` or `--append-system-prompt` must switch to `--system-prompt-file` or `--append-system-prompt-file` * Changed queued messages to show in the conversation above the spinner instead of under it @@ -319,7 +413,7 @@ September 18, 2026 - * Added AGENTS.md support: in a project with no CLAUDE.md, Claude Code reads AGENTS.md instead; change it under “Project instructions” in `/config` (not yet on Bedrock, Vertex or Foundry) + * Added AGENTS.md support: in a project with no CLAUDE.md, Claude Code reads AGENTS.md instead; change it under “Project instructions” in `/config` * Added `CLAUDE_GATEWAY_PROXY_IS_EGRESS_BOUNDARY=1` for Claude apps gateways whose only egress is a forward proxy: every outbound request hands the proxy the hostname instead of resolving it locally * Added an optional `headers:` map on Claude apps gateway upstreams, to send static headers to a proxy you run in front of a provider * Added a line saying a background task’s update is waiting when it finishes while a panel such as `/tasks` is open
modified Push events into a running session with channels View current →
--- a/channels.md +++ b/channels.md @@ -35,9 +35,9 @@ If the install fails, match the message Claude Code reports: * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install. - * The plugin is [not found in the marketplace](</docs/en/discover-plugins#install-plugins>): check the plugin name. - -When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to activate.`, see [Apply plugin changes without restarting](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) to make the plugin’s configure command available. + * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name. + +When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to activate.`, see [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>) to make the plugin’s configure command available. 3 @@ -113,9 +113,9 @@ If the install fails, match the message Claude Code reports: * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install. - * The plugin is [not found in the marketplace](</docs/en/discover-plugins#install-plugins>): check the plugin name. - -When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to activate.`, see [Apply plugin changes without restarting](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) to make the plugin’s configure command available. + * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name. + +When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to activate.`, see [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>) to make the plugin’s configure command available. 5 @@ -170,7 +170,7 @@ If the install fails, match the message Claude Code reports: * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install. - * The plugin is [not found in the marketplace](</docs/en/discover-plugins#install-plugins>): check the plugin name. + * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name. When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects.If the install summary reports `Run /reload-plugins to activate.`, you don’t need to act on it here, because restarting in the next step picks up the plugin. @@ -223,7 +223,7 @@ If the install fails, match the message Claude Code reports: * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install. - * The plugin is [not found in the marketplace](</docs/en/discover-plugins#install-plugins>): check the plugin name. + * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name. When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects.If the install summary reports `Run /reload-plugins to activate.`, you don’t need to act on it here, because restarting in the next step picks up the plugin.
modified Channels reference View current →
--- a/channels-reference.md +++ b/channels-reference.md @@ -159,7 +159,7 @@ # Testing a bare .mcp.json server (no plugin wrapper yet) claude --dangerously-load-development-channels server:webhook -The bypass is per-entry. Combining this flag with `--channels` doesn’t extend the bypass to the `--channels` entries. During the research preview, the approved allowlist is Anthropic-curated, so your channel stays on the development flag while you build and test. +The bypass is per-entry. Combining this flag with `--channels` doesn’t extend the bypass to the `--channels` entries. During the research preview, your channel isn’t on the approved allowlist, so it stays on the development flag while you build and test. This flag skips the allowlist only. The `channelsEnabled` organization policy still applies. Don’t use it to run channels from untrusted sources. @@ -740,7 +740,7 @@ Package as a plugin -To make your channel installable and shareable, wrap it in a [plugin](</docs/en/plugins>) and publish it to a [marketplace](</docs/en/plugin-marketplaces>). Users install it with `/plugin install`, then enable it per session with `--channels plugin:<name>@<marketplace>`. A channel published to your own marketplace still needs `--dangerously-load-development-channels` to run, since it isn’t on the [approved allowlist](</docs/en/channels#supported-channels>). The default allowlist is the channel plugins in `claude-plugins-official`, which Anthropic curates at its discretion. The [in-app submission forms](</docs/en/plugins#submit-your-plugin-to-the-community-marketplace>) add plugins to the community marketplace, which is not on the channel allowlist. If you are working with an Anthropic partner contact, reach out to them to coordinate an official-marketplace listing. On Team and Enterprise plans, an admin can instead include your plugin in the organization’s own [`allowedChannelPlugins`](</docs/en/channels#restrict-which-channel-plugins-can-run>) list, which replaces the default Anthropic allowlist. +To make your channel installable and shareable, wrap it in a [plugin](</docs/en/plugins/overview>) and publish it to a [marketplace](</docs/en/plugins/overview>). Users install it with `/plugin install`, then enable it per session with `--channels plugin:<name>@<marketplace>`. A channel published to your own marketplace still needs `--dangerously-load-development-channels` to run, since it isn’t on the [approved allowlist](</docs/en/channels#supported-channels>). The default allowlist is the channel plugins in `claude-plugins-official`. The [in-app submission forms](</docs/en/plugins/publish#submit-to-the-community-marketplace>) add plugins to the community marketplace, which is not on the channel allowlist. If you are working with an Anthropic partner contact, reach out to them to coordinate an official-marketplace listing. On Team and Enterprise plans, an admin can instead include your plugin in the organization’s own [`allowedChannelPlugins`](</docs/en/channels#restrict-which-channel-plugins-can-run>) list, which replaces the default Anthropic allowlist. ## @@ -751,4 +751,4 @@ * [Channels](</docs/en/channels>) to install and use Telegram, Discord, iMessage, or the fakechat demo, and to enable channels for a Team or Enterprise org * [Working channel implementations](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins>) for complete server code with pairing flows, reply tools, and file attachments * [MCP](</docs/en/mcp>) for the underlying protocol that channel servers implement - * [Plugins](</docs/en/plugins>) to package your channel so users can install it with `/plugin install` + * [Plugins](</docs/en/plugins/overview>) to package your channel so users can install it with `/plugin install`
modified Checkpointing View current →
--- a/checkpointing.md +++ b/checkpointing.md @@ -48,7 +48,7 @@ Rewind past a cleared conversation -If you ran `/clear` earlier in the same Claude Code process, the rewind menu shows an additional entry at the top of the list labeled `/resume <session-id> (previous session)`. Select it to resume the conversation that was active before `/clear` ran. The entry is available until you exit Claude Code or resume a different session, and requires Claude Code v2.1.191 or later. On earlier versions, run `/resume` and pick the previous session from the list instead. +If you ran `/clear` earlier in the same Claude Code process, the rewind menu shows an additional entry at the top of the list labeled `/resume <session-id> (previous session)`. Select it to resume the conversation that was active before `/clear` ran. The entry is available until you exit Claude Code or resume a different session. ####
modified Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry View current →
--- a/claude-apps-gateway.md +++ b/claude-apps-gateway.md @@ -382,11 +382,13 @@ Settings the locks don’t cover -Four parent-supplied settings pass the filter even with all five locks set. Under the default first-wins setting, the admin value that blocks the parent’s is the one in the highest-priority admin source, except for `allowedMcpServers` while the MCP server lock is on. Under the `managedSourcesBehavior` merge opt-in, [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s value applies instead. +Six parent-supplied settings pass the filter even with all five locks set. Under the default first-wins setting, an admin value blocks the parent’s only when it sits in the highest-priority admin source, except for `allowedMcpServers` while the MCP server lock is on. Under the `managedSourcesBehavior` merge opt-in, [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s value applies instead. * **`forceLoginOrgUUID`** : Claude Code honors a parent-supplied value when the highest-priority admin source doesn’t set an org UUID. Gateway sign-in doesn’t check this key, so it matters only for fleets that also use first-party Anthropic logins. An org UUID in the highest-priority admin source blocks the parent’s value and is the one Claude Code enforces, so set `forceLoginOrgUUID` there. * **`allowedMcpServers`** : Claude Code honors a parent-supplied allowlist when no admin list is in force. `allowManagedMcpServersOnly` doesn’t block it, because the lock enforces whichever list wins as the managed value, including a parent-supplied one when no admin source supplies a list. A list in the highest-priority admin source blocks the parent’s and is the list Claude Code enforces, so set `allowedMcpServers` there, next to the lock. Before v2.1.223, a value for either key in any admin source blocked the parent’s. * **`availableModels`** : Claude Code honors a parent-supplied model list when the winning managed source doesn’t set one. If your fleet restricts models, set `availableModels` in the winning source. + * **`strictKnownMarketplaces`** : Claude Code honors a parent-supplied plugin marketplace allowlist when the winning managed source doesn’t set one. If your fleet restricts marketplaces, set `strictKnownMarketplaces` in the winning source. Requires Claude Code v2.1.282 or later. + * **`blockedMarketplaces`** : a parent-supplied marketplace blocklist passes and adds to any blocklist that a managed source sets, since a blocklist can only restrict further. Requires Claude Code v2.1.282 or later. * **`strictPluginOnlyCustomization`** : this key passes the filter regardless of any lock, and it makes Claude Code ignore the developer’s own customization, including protective hooks. No lock blocks it. ###
modified Claude apps gateway configuration View current →
--- a/claude-apps-gateway-config.md +++ b/claude-apps-gateway-config.md @@ -23,6 +23,7 @@ * `managed`: managed settings policies by IdP group * `telemetry`: OTLP forwarding to your observability stack * `access_control`, `limits`, `timeouts`, `rate_limits`: IP allow/deny, request size caps, upstream time-to-first-byte, and per-IP sign-in limits + * `load_test_mode`: load test the gateway without calling a model provider ## @@ -863,6 +864,29 @@ Both signals use the client address as the gateway resolves it. If a load balancer, port-forward, or tunnel relays traffic and isn’t listed in `listen.trusted_proxies`, the gateway sees the relay’s address, which is usually private, so neither the runtime warning nor a private allow list catches traffic relayed through it. Behind such a front end, set `listen.trusted_proxies` first so the gateway sees real client addresses, and keep the gateway and everything in front of it unreachable from the public internet regardless. +### + +​ + +`load_test_mode` + +The `load_test_mode` block lets you load test a gateway without calling a model provider. While it’s on, the gateway builds and signs each provider request as usual, discards it instead of sending it, and streams a canned reply back through its normal response path. The reply is filler text that begins with a sentence saying it is canned. Requires v2.1.283 or later. Earlier versions refuse to start when the key is set, so upgrade every replica before you add the block and remove it before you roll back. The example below turns the mode on with the defaults, a reply of 750 output tokens streamed over about 10 seconds: + + load_test_mode: + enabled: true + reply_tokens: 750 # roughly how many tokens of text each canned reply carries + reply_seconds: 9.5 # how long a streamed reply takes + +Field| Required| Description +---|---|--- +`enabled`| Yes| `true` turns the mode on. `false` keeps your numbers in the file with the mode off. The gateway refuses to start if the block is present without it. +`reply_tokens`| No| Default `750`. Roughly how many tokens of text each canned reply carries, a whole number from 1 to 100000. +`reply_seconds`| No| Default `9.5`. How long a streamed reply takes, from 0 to 600. `0` sends the whole reply at once. A reply to a non-streaming request always comes back at once. + +A load test in this mode covers the gateway, your Postgres, and everything in front of the gateway. It doesn’t cover the provider’s limits, speed, or network path. While the mode is on, a request can carry an `x-load-test-user` header holding a whole number of up to seven digits, and the gateway counts each number as a separate developer with the email and groups of the developer whose token came with the request. Give the load-test deployment its own empty database, because the gateway refuses to start with the mode on against a database in which any developer has already spent anything. + +Never turn this on for a gateway that developers use. Every request gets the canned reply and no model is called. The gateway logs a `load_test_mode is on` warning at boot and marks each `inference` [audit event](</docs/en/claude-apps-gateway-deploy#logs>) with `load_test: true` while the mode is on. + ## ​ @@ -936,6 +960,13 @@ # enforcement: # fail_closed_on_error: false + + # Load test this deployment without calling a model provider. Never on a + # gateway that developers use: every request gets a canned reply. + # load_test_mode: + # enabled: true + # # reply_tokens: 750 + # # reply_seconds: 9.5 # Meter at contracted rates instead of USD list price. Requires admin: or a # managed: policy. With managed:, the same rates also go to signed-in clients.
modified Claude apps gateway deployment and operations View current →
--- a/claude-apps-gateway-deploy.md +++ b/claude-apps-gateway-deploy.md @@ -186,7 +186,7 @@ * **[Spend-limit enforcement](</docs/en/claude-apps-gateway-spend-limits#postgres-availability>)** : fails open by default during the outage, so inference still flows; flip it to fail closed if you’d rather block than run unmetered * **Readiness** : `/readyz` reports not-ready during the outage, so orchestrators that gate traffic on readiness remove every replica from rotation at once. In that topology all traffic, including inference the gateway could still serve, fails at the load balancer until Postgres recovers. The liveness probe on `/healthz` keeps passing, so replicas aren’t restarted. Point the readiness probe at `/healthz` instead if you’d rather signed-in developers keep working through a store outage; the cost is that new sign-ins fail against a replica that still reports ready. -If your IdP goes down, existing sessions work until `ttl_hours`, and new logins and refreshes fail. Set a longer `ttl_hours` if your IdP has frequent maintenance windows. +If your IdP goes down, existing sessions work until `ttl_hours`, new logins fail, and a session refresh gets a try-again answer and goes through once the IdP is back. Set a longer `ttl_hours` if your IdP has frequent maintenance windows. ###
modified Explore the .claude directory View current →
--- a/claude-directory.md +++ b/claude-directory.md @@ -21,7 +21,7 @@ `managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>). `CLAUDE.local.md`| Project root| Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`. `AGENTS.md`| Project root, `.claude/`, or any directory| Project instructions you write for AI coding agents. Claude Code can [load it](</docs/en/memory#agents-md>) on its own or alongside `CLAUDE.md`. -Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, the `installed_plugins.json` install record, and per-plugin data, managed by `claude plugin` commands. Plugins [synced from your claude.ai account](</docs/en/plugins-reference#synced-plugins>) download into `~/.claude/plugins/synced/`. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) in link mode, Claude Code stores links here instead of a copy, and the plugin’s files stay in the directory the command prints. A `command` source requires Claude Code v2.1.229 or later. A plugin listed by relative path in a local-directory marketplace also [loads in place](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up. +Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, the `installed_plugins.json` install record, and per-plugin data, managed by `claude plugin` commands. Plugins [synced from your claude.ai account](</docs/en/plugins/loading#synced-plugins>) download into `~/.claude/plugins/synced/`. For a plugin installed from a marketplace [`command` source](</docs/en/plugins/marketplace-reference#command-plugin-source>) in link mode, Claude Code stores links here instead of a copy, and the plugin’s files stay in the directory the command prints. A `command` source requires Claude Code v2.1.229 or later. A plugin listed by relative path in a local-directory marketplace also [loads in place](</docs/en/plugins/loading#find-plugins-on-disk>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins/loading#find-plugins-on-disk>) for how orphaned versions are cleaned up. `~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below. @@ -99,7 +99,7 @@ `output-styles/*.md`| `name`, `description`, `keep-coding-instructions`, `force-for-plugin`| [Output style frontmatter](</docs/en/output-styles#frontmatter>) `rules/*.md`| `paths`| [Rule frontmatter](</docs/en/memory#rules-frontmatter-reference>) -Agents shipped in a [plugin](</docs/en/plugins-reference#plugin-agent-frontmatter>) honor a subset of the subagent fields. +Agents shipped in a [plugin](</docs/en/plugins/components#agents>) honor a subset of the subagent fields. ## @@ -144,7 +144,7 @@ `feedback-bundles/`| Redacted transcript archives written by `/feedback` on third-party providers or when no Anthropic credentials are configured, for sending to your Anthropic account team `feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>) awaiting your review in `/feedback`. Swept after `cleanupPeriodDays` or 30 days, whichever is shorter. When the queue is at its 10-draft limit, Claude Code deletes the oldest draft to make room. `usage-data/`| `report.html` and timestamped report copies written by [`/insights`](</docs/en/costs#analyze-your-usage-patterns>), plus cached per-session analysis data used to build them -`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins-reference#synced-plugins>) that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing. The files stay here so you can recover them until the sweep deletes them +`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#synced-plugins>) that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing. The files stay here so you can recover them until the sweep deletes them `todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory. Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule: @@ -250,7 +250,7 @@ `~/.claude/cache/changelog.md`| Nothing. Refreshed in the background. `~/.claude/policy-limits.json`| Nothing. Refreshed automatically. `~/.claude/tasks/`| Task lists that a resumed session would pick up -`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins-reference#synced-plugins>) that Claude Code removed +`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins/loading#synced-plugins>) that Claude Code removed `~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing `~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/`| Nothing. Legacy directories not written by current versions.
modified Claude Code on Claude Platform on AWS View current →
--- a/claude-platform-on-aws.md +++ b/claude-platform-on-aws.md @@ -38,7 +38,7 @@ "awsAuthRefresh": "aws sso login --profile my-profile" } -Claude Code also runs this command at startup when it can’t validate your existing AWS credentials, and shows the command’s output in an `Authentication` panel until the login completes. With `awsAuthRefresh` configured, run `/login`, select **3rd-party platform** , then select **Claude Platform on AWS · refresh credentials** under **Using 3rd-party platforms**. Claude Code runs the configured command and re-reads your AWS credentials without a restart. This option requires Claude Code v2.1.186 or later. **Option B: Workspace API key** A workspace API key is a long-lived secret, useful when you don’t want to manage federated AWS credentials. Generate one in the AWS Console under **Claude Platform on AWS → API keys** and set it as `ANTHROPIC_AWS_API_KEY`: +Claude Code also runs this command at startup when it can’t validate your existing AWS credentials, and shows the command’s output in an `Authentication` panel until the login completes. With `awsAuthRefresh` configured, run `/login`, select **3rd-party platform** , then select **Claude Platform on AWS · refresh credentials** under **Using 3rd-party platforms**. Claude Code runs the configured command and re-reads your AWS credentials without a restart. **Option B: Workspace API key** A workspace API key is a long-lived secret, useful when you don’t want to manage federated AWS credentials. Generate one in the AWS Console under **Claude Platform on AWS → API keys** and set it as `ANTHROPIC_AWS_API_KEY`: export ANTHROPIC_AWS_API_KEY=sk-ant-xxxxx
modified Let Claude coordinate ongoing work with Projects View current →
Show diff (238 lines)
--- a/claude-projects.md +++ b/claude-projects.md @@ -1,9 +1,9 @@ Projects are in public beta on Pro and Max plans and rolling out gradually, starting with accounts that have used [cloud sessions](</docs/en/claude-code-on-the-web>) and don’t have existing projects in claude.ai chat or Cowork. They aren’t available on Team or Enterprise plans yet. If **Projects** doesn’t appear in the sidebar at [claude.ai/code](<https://claude.ai/code>) or in the Code tab of the [desktop app](</docs/en/desktop>), the rollout hasn’t reached your account, and you can [join the waitlist](<https://claude.com/form/projects>). [Run agents in parallel](</docs/en/agents>) lists what you can use in the meantime. -A project is one ongoing conversation where Claude coordinates a stream of related work for you. You tell it what needs doing and it starts a thread for each task. Each thread is a [cloud session](</docs/en/claude-code-on-the-web>): Claude Code running in the cloud rather than on your machine. Threads run in parallel and keep going after you close the laptop, and you can check on them and steer them from your phone. Without a project, running several sessions means doing the coordinating yourself: you decide what each one works on, repeat the same background at the start of each, and check back to see which finished or needs an answer. With a project, you instead: +A project is one ongoing conversation where Claude coordinates a stream of related work for you. You tell it what needs doing and it starts a thread for each task. Each thread is usually a [cloud session](</docs/en/claude-code-on-the-web>): Claude Code running in the cloud rather than on your machine. When a task needs something only your computer has, you can ask Claude to run that thread on your computer instead through [Remote Control](</docs/en/remote-control>). Threads run in parallel and you can check on them and steer them from your phone. Cloud threads keep going after you close the laptop. Without a project, running several sessions means doing the coordinating yourself: you decide what each one works on, repeat the same background at the start of each, and check back to see which finished or needs an answer. With a project, you instead: * **Send work to one place** : paste a bug report, a stack trace, or a list of tasks into the conversation whenever one comes up. Claude starts a thread for each piece of work or passes it to the thread already working in that area, and answers quick questions in place. - * **Set context once** : every new thread starts with the project’s repositories, instructions, and memory, so a rule you state once, such as which branch to target, reaches all of them. + * **Set context once** : every new thread starts with the project’s instructions, so a rule you state once, such as which branch to target, reaches all of them. * **Walk away and come back to finished work** : when you come back an hour later or the next morning, the **Overview** pane shows which threads finished, which pull requests are ready for review, and which thread is waiting for your answer. If you already know the work you want a project to run, go straight to Create a project. @@ -29,10 +29,10 @@ When something else fits better -Threads work on GitHub repositories and on the files, folders, and Google Drive folders you upload to the project, not on files or tools that exist only on your machine. Something else fits better in these cases: +Cloud threads work on GitHub repositories and on the files, folders, and Google Drive folders you upload to the project, not on files or tools that exist only on your machine. If a task needs your machine, ask Claude to run its thread there through [Remote Control](</docs/en/remote-control>). Limitations lists what that needs. Something else fits better in these cases: * **One task that fits in a session** : “Fix the flaky login test.” Start a [cloud session](</docs/en/claude-code-on-the-web>) yourself. - * **Work that needs tools or services only your machine can reach** : a local database, a device emulator, an API behind your VPN. Use a local session, or [agent view](</docs/en/agent-view>) to run several at once. If the work only needs local files, upload them to the project instead. + * **Work where every task needs your machine** : a local database, a device emulator, or an API behind your VPN. Use a local session, or [agent view](</docs/en/agent-view>) to run several at once. If the work only needs local files, upload them to the project instead. * **One task that repeats on a schedule with no conversation around it** : “Post a dependency report every Monday.” Create a [routine](</docs/en/routines>) on its own. * **Several people giving Claude work and steering it together in a Slack channel** : see [Claude Tag](<https://claude.com/docs/claude-tag/overview>). @@ -47,15 +47,15 @@ A project is one coordinating conversation with Claude plus the threads it starts to do the work. These are its parts: * **The project conversation** : one long-running session where Claude acts as coordinator. It takes what you send, decides what becomes a thread, and keeps track of every thread it started. It sees what threads report back, not every step they take. - * **Threads** : the workers. Each is a separate [cloud session](</docs/en/claude-code-on-the-web>) with its own context window that does one piece of work on its own branch, opens a pull request when the work calls for one, and reports back to the conversation when it finishes. - * **What every thread starts with** : + * **Threads** : the workers. Each is a separate session with its own context window that does one piece of work and reports back to the conversation when it finishes. A cloud thread works on its own branch and opens a pull request when the work calls for one. + * **What every cloud thread starts with** : * The project’s repositories and files, plus its instructions and memory * The `CLAUDE.md` and skills in each of the project’s repositories, and in a project with one repository, that repository’s permission rules and hooks too * The connectors on your claude.ai account * A cloud environment that sets its network access, environment variables, API credentials, and installed tools * **The Overview pane** : where you see all the threads at once and which of them need you. Its other tabs are **Library** for the files you added and the files threads produced, **Pull requests** for the ones threads opened, and **Routines** for scheduled work in the project. -Threads don’t pick up anything from the Claude Code setup on your own machine. Get skills, plugins, connectors, and tools into threads covers how to give them what they’d otherwise be missing. Here is how those parts connect, from you through the conversation to the threads doing the work, with **Overview** tracking their state: +Cloud threads don’t pick up anything from the Claude Code setup on your own machine. Get skills, plugins, connectors, and tools into threads covers how to give them what they’d otherwise be missing. Here is how those parts connect, from you through the conversation to the threads doing the work, with **Overview** tracking their state: ## @@ -79,8 +79,8 @@ Before you create a project, check your plan, your GitHub setup, and what the work needs to reach: * **Plan** : you’re on Pro or Max and **Projects** shows in your sidebar. - * **GitHub, if the project will work on code** : your code is on github.com rather than GitHub Enterprise Server, GitLab, or Bitbucket, your connected GitHub account has push access to it, and the Claude GitHub App is installed on it. If you connected GitHub with [`/web-setup`](</docs/en/web-quickstart#connect-from-your-terminal>), that token lets your other cloud sessions reach a repository but isn’t enough for project threads, which need the Claude GitHub App. Set up GitHub access has the steps. - * **Network, credentials, and tools** : these come from the project’s cloud environment. The default environment already reaches [common package registries](</docs/en/cloud-environments#default-allowed-domains>), so check this only if the work needs other domains, a secret, or a tool that isn’t preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](<https://claude.ai/customize/connectors>). + * **GitHub, if the project will work on code** : your code is on github.com rather than GitHub Enterprise Server, GitLab, or Bitbucket, your connected GitHub account has push access to it, and the Claude GitHub App is installed on it. If you connected GitHub with [`/web-setup`](</docs/en/web-quickstart#connect-from-your-terminal>), that token lets your other cloud sessions reach a repository but isn’t enough for a project’s cloud threads, which need the Claude GitHub App. Set up GitHub access has the steps. + * **Network, credentials, and tools** : for cloud threads, these come from the project’s cloud environment. The default environment already reaches [common package registries](</docs/en/cloud-environments#default-allowed-domains>), so check this only if the work needs other domains, a secret, or a tool that isn’t preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](<https://claude.ai/customize/connectors>). ### @@ -199,7 +199,7 @@ Review a thread’s pull request -When a thread changes code, this is what it does unless you tell it otherwise: +When a cloud thread changes code, this is what it does unless you tell it otherwise: * **Branch** : works on a new branch, started from the repository’s default branch. * **Pull request** : opens one when you ask, and can open one on its own for a bug fix or another concrete change. @@ -283,7 +283,7 @@ Unblock a thread waiting on approval -Threads run in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) when the thread’s model supports it, so most tool calls run without asking you. When a thread needs your approval, the prompt is inside that thread and the thread waits until you answer it there. Telling Claude in the project conversation to go ahead doesn’t reach it. Each approval covers that prompt, or the rest of that thread if you choose the broader option. To let every thread run certain commands without asking, or to block some, add [permission rules](</docs/en/permissions>) to the repository’s `.claude/settings.json`. Threads apply them only in a project with one repository; see What threads pick up from your repositories. +Threads run in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) when the thread’s model supports it, so most tool calls run without asking you. When a thread needs your approval, the prompt is inside that thread and the thread waits until you answer it there. Telling Claude in the project conversation to go ahead doesn’t reach it. Each approval covers that prompt, or the rest of that thread if you choose the broader option. To let every thread run certain commands without asking, or to block some, add [permission rules](</docs/en/permissions>) to the repository’s `.claude/settings.json`. Cloud threads apply them only in a project with one repository; see What threads pick up from your repositories. ## @@ -291,15 +291,15 @@ Give a project standing context -Project memory, project instructions, and the project’s repositories, files, and environment carry context across threads. You set each one once and it applies to every new thread. +Project memory, project instructions, and the project’s repositories, files, and environment carry context across threads. You set each one once. Context| What it carries| How you set it ---|---|--- -Project memory| Notes Claude keeps about the project, such as requirements, decisions, and pitfalls, stored as files. Every thread reads the index file `MEMORY.md` when it starts and opens the other files when it needs them| Ask Claude in the project conversation or any thread to remember a requirement, a decision, or a pitfall, or to forget one. Read, edit, and delete the files in **Project settings > Memory** +Project memory| Notes Claude keeps about the project, such as requirements, decisions, and pitfalls, stored as files. Every cloud thread reads the index file `MEMORY.md` when it starts and opens the other files when it needs them| Ask Claude in the project conversation or any cloud thread to remember a requirement, a decision, or a pitfall, or to forget one. Read, edit, and delete the files in **Project settings > Memory** Project instructions| Text sent to each new thread and to Claude in the project conversation, up to 16,000 characters. Write project instructions covers what to put in it| **Project settings > Memory > Project instructions**, or ask Claude to change the instructions -Repositories, files, and environment| The repositories every thread clones, the folders and files every thread can read under `/mnt/project-files`, and the cloud environment threads run in| Repositories and environment in **Project settings > Environment**, or ask Claude in the conversation to add a repository to the project. Files and folders from **Add** on the **Library** tab in **Overview** - -**Project settings > Memory** lists these files under **Auto memory** , because Claude writes them itself as it works in the project. They’re separate from the [auto memory](</docs/en/memory>) Claude Code keeps on your machine, even though both use a `MEMORY.md` index. Project memory is also separate from the `CLAUDE.md` files in the project’s repositories. Each thread still reads those `CLAUDE.md` files from its clone when it starts, so put instructions about a repository in its `CLAUDE.md` and notes about the project in project memory. +Repositories, files, and environment| The repositories every cloud thread clones, the folders and files it can read under `/mnt/project-files`, and the cloud environment it runs in| Repositories and environment in **Project settings > Environment**, or ask Claude in the conversation to add a repository to the project. Files and folders from **Add** on the **Library** tab in **Overview** + +**Project settings > Memory** lists these files under **Auto memory** , because Claude writes them itself as it works in the project. They’re separate from the [auto memory](</docs/en/memory>) Claude Code keeps on your machine, even though both use a `MEMORY.md` index. Project memory is also separate from the `CLAUDE.md` files in the project’s repositories. Each cloud thread still reads those `CLAUDE.md` files from its clone when it starts, so put instructions about a repository in its `CLAUDE.md` and notes about the project in project memory. ### @@ -324,7 +324,7 @@ - If you can't reach something you need, such as a repository, a secret, an API, or a connector, say exactly what's missing in your first message and stop. Don't substitute, mock, or guess. - Don't merge, force-push, or change CI configuration without asking me in the thread. -Rules about one repository, such as its build commands, belong in that repository’s `CLAUDE.md`, which every thread reads when the repository is part of the project. Once work is underway, when you correct a thread, also tell Claude to remember the correction: it goes into project memory and later threads start with it. +Rules about one repository, such as its build commands, belong in that repository’s `CLAUDE.md`, which every cloud thread reads when the repository is part of the project. Once work is underway, when you correct a thread, also tell Claude to remember the correction: it goes into project memory and later cloud threads start with it. ### @@ -332,12 +332,12 @@ Decide which repositories to add -The repositories you add to a project come with everything in them, their code, `CLAUDE.md`, and skills, in every thread. Repositories you don’t add are still within reach: a thread can add one to itself when its task needs it. Most projects use both: - - * **Add it to the project** , in the **New project** dialog, in **Project settings > Environment**, or by asking Claude in the conversation to add it to the project. Every thread from then on clones it and starts with its `CLAUDE.md` and skills loaded, whether or not the task touches it. Going from one repository to several also changes what threads take from each repository’s `.claude/settings.json`; see What threads pick up from your repositories. - * **Leave it off and let threads add it when needed.** A thread whose task needs a repository the project doesn’t have can add it to itself, and a note in the thread says it was added to this thread only. The clone happens partway through the task, so that repository’s `CLAUDE.md` and skills weren’t there when the thread started. The next thread starts without it again. A repository a thread adds needs the same prerequisites as a project repository: the Claude GitHub App installed on it and push access from your GitHub account. - -A project doesn’t need a repository at all. Its threads can still research, write documents, and write and run code in their own sandbox, and they deliver files to the **Library** tab. A thread there can also add a repository to itself when a task calls for one. Once the project has repositories, Claude can only add repositories from a GitHub owner the project already uses, whether it adds one to the project or a thread adds one to itself. To bring in a repository from a different owner, add it to the project yourself in **Project settings > Environment**. For a project that spans many repositories, such as one feature with server, web, mobile, and desktop code, add the one or two repositories nearly every task touches and name the others in project instructions so Claude knows where the rest of the code lives. Threads then start small and pull in the other repositories only for the tasks that need them. +The repositories you add to a project come with everything in them, their code, `CLAUDE.md`, and skills, in every cloud thread. Repositories you don’t add are still within reach: a cloud thread can add one to itself when its task needs it. Most projects use both: + + * **Add it to the project** , in the **New project** dialog, in **Project settings > Environment**, or by asking Claude in the conversation to add it to the project. Every cloud thread from then on clones it and starts with its `CLAUDE.md` and skills loaded, whether or not the task touches it. Going from one repository to several also changes what threads take from each repository’s `.claude/settings.json`; see What threads pick up from your repositories. + * **Leave it off and let threads add it when needed.** A cloud thread whose task needs a repository the project doesn’t have can add it to itself, and a note in the thread says it was added to this thread only. The clone happens partway through the task, so that repository’s `CLAUDE.md` and skills weren’t there when the thread started. The next thread starts without it. A repository added this way needs the same prerequisites as a project repository: the Claude GitHub App installed on it and push access from your GitHub account. + +A project doesn’t need a repository at all. Its cloud threads can still research, write documents, and write and run code in their own sandbox, and they deliver files to the **Library** tab. Any of its cloud threads can still add a repository to itself when a task calls for one. Once the project has repositories, Claude can only add repositories from a GitHub owner the project already uses, whether it adds one to the project or a thread adds one to itself. To bring in a repository from a different owner, add it to the project yourself in **Project settings > Environment**. For a project that spans many repositories, such as one feature with server, web, mobile, and desktop code, add the one or two repositories nearly every task touches and name the others in project instructions so Claude knows where the rest of the code lives. Cloud threads then start small and pull in the other repositories only for the tasks that need them. ### @@ -345,7 +345,7 @@ What threads pick up from your repositories -Each thread clones every repository in the project and loads `CLAUDE.md` and skills from all of them. Permission rules, hooks, and `env` come only from the `.claude/settings.json` in the directory the thread starts in: inside the repository when the project has one, and above the clones when it has several, where no repository’s file is read for them. +Each cloud thread clones every repository in the project and loads `CLAUDE.md` and skills from all of them. Permission rules, hooks, and `env` come only from the `.claude/settings.json` in the directory the thread starts in: inside the repository when the project has one, and above the clones when it has several, where no repository’s file is read for them. In each repository| One repository| Several repositories ---|---|--- @@ -362,7 +362,7 @@ Choose an environment for threads -Every new thread starts in the project’s [cloud environment](</docs/en/cloud-environments>). The environment sets which domains threads can reach, which environment variables they have, which API credentials are added to their requests, and what the setup script installs before Claude starts. Threads use a default Anthropic-hosted environment until you pick one in **Project settings > Environment**. If threads need to reach an internal API or a private package registry, or need a token your machine normally holds, change the environment rather than the project: see [Network access](</docs/en/cloud-environments#network-access>), [Add API credentials](</docs/en/cloud-environments#add-api-credentials>), and [Setup scripts](</docs/en/cloud-environments#setup-scripts>). +Every new cloud thread starts in the project’s [cloud environment](</docs/en/cloud-environments>). The environment sets which domains threads can reach, which environment variables they have, which API credentials are added to their requests, and what the setup script installs before Claude starts. Cloud threads use a default Anthropic-hosted environment until you pick one in **Project settings > Environment**. If cloud threads need to reach an internal API or a private package registry, or need a token your machine normally holds, change the environment rather than the project: see [Network access](</docs/en/cloud-environments#network-access>), [Add API credentials](</docs/en/cloud-environments#add-api-credentials>), and [Setup scripts](</docs/en/cloud-environments#setup-scripts>). ### @@ -370,14 +370,14 @@ Get skills, plugins, connectors, and tools into threads -Threads are cloud sessions, so they don’t have the skills, MCP servers, plugins, and tools installed only on your machine. To make each of these available to threads: - - * Skills, subagents, and commands: commit them to a repository you added to the project, for example a skill at `.claude/skills/<skill-name>/SKILL.md`. Each thread clones every repository in the project and loads `.claude/skills/`, `.claude/agents/`, and `.claude/commands/` from each of them, so a skill committed to one repository is available in every new thread. Threads also load the skills you enable for your claude.ai account. - * Plugins: add them in **Project settings > Plugins**; they load into each new thread. Plugins that a repository declares in its `.claude/settings.json` [don’t load in threads](</docs/en/cloud-environments#what-carries-over-from-your-setup>), because threads are cloud sessions. - * MCP servers: threads get their MCP tools from the connectors on your claude.ai account, which are MCP servers you connect once at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or through the **Manage connectors** link in **Project settings > Environment**. Every thread can use all of them with no per-project setup. The project conversation itself has no connectors, so send work that needs one as a task for a thread. In a project with one repository, threads also load MCP servers from that repository’s [`.mcp.json`](</docs/en/cloud-environments#what-carries-over-from-your-setup>). [How connectors reach Claude Code](</docs/en/mcp#how-connectors-reach-claude-code>) lists the rules for cloud sessions and the settings that turn connectors off. +Cloud threads don’t have the skills, MCP servers, plugins, and tools installed only on your machine. A thread that Claude runs on your machine through [Remote Control](</docs/en/remote-control>) uses what’s installed there. To make each of these available to cloud threads: + + * Skills, subagents, and commands: commit them to a repository you added to the project, for example a skill at `.claude/skills/<skill-name>/SKILL.md`. Each cloud thread clones every repository in the project and loads `.claude/skills/`, `.claude/agents/`, and `.claude/commands/` from each of them, so a skill committed to one repository is available in every cloud thread. Cloud threads also load the skills you enable for your claude.ai account. + * Plugins: add them in **Project settings > Plugins**; they load into each new cloud thread. Plugins that a repository declares in its `.claude/settings.json` [don’t load in cloud threads](</docs/en/cloud-environments#what-carries-over-from-your-setup>). + * MCP servers: cloud threads get their MCP tools from the connectors on your claude.ai account, which are MCP servers you connect once at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or through the **Manage connectors** link in **Project settings > Environment**. Every cloud thread can use all of them with no per-project setup. The project conversation itself has no connectors, so send work that needs one as a task for a cloud thread. In a project with one repository, cloud threads also load MCP servers from that repository’s [`.mcp.json`](</docs/en/cloud-environments#what-carries-over-from-your-setup>). [How connectors reach Claude Code](</docs/en/mcp#how-connectors-reach-claude-code>) lists the rules for cloud sessions and the settings that turn connectors off. * Command-line tools and packages: install them in the environment’s [setup script](</docs/en/cloud-environments#setup-scripts>). -To see which connectors a running thread has at claude.ai/code, open the thread and select **Connectors** from the **+** menu beside its message box. Turning a connector off there removes it from that thread and saves that as your account default, so new threads and claude.ai chats start without it until you turn it back on. A thread picks up a connector you add or reconnect after the next message you send it. +To see which connectors a running cloud thread has at claude.ai/code, open the thread and select **Connectors** from the **+** menu beside its message box. Turning a connector off there removes it from that thread and saves that as your account default, so new threads and claude.ai chats start without it until you turn it back on. A cloud thread picks up a connector you add or reconnect after the next message you send it. ## @@ -393,10 +393,10 @@ Coordinator model and effort| General| The model and [effort level](</docs/en/model-config#adjust-effort-level>) for Claude in the project conversation Thread model and effort| General| The model and effort level for threads Project instructions| Memory| Standing rules every new thread receives -Project repositories| Environment| The repositories new threads clone -Cloud environment| Environment| The cloud environment new threads run in -Connectors| Environment| A link to manage the claude.ai connectors threads get -Plugins| Plugins| The plugins that load into each new thread +Project repositories| Environment| The repositories new cloud threads clone +Cloud environment| Environment| The cloud environment new cloud threads run in +Connectors| Environment| A link to manage the claude.ai connectors cloud threads get +Plugins| Plugins| The plugins that load into each new cloud thread Usage| Usage| Token use by thread and by model Memory| Memory| The project’s memory files Restart Claude| General| Restarts the project conversation when Claude stops responding there @@ -454,13 +454,13 @@ How projects relate to other Claude Code features -Several Claude Code features let more than one session work at the same time, so running work in parallel is not by itself what a project is for. In a project, Claude starts and tracks the sessions instead of you, each one starts from the same repositories, instructions, and memory, and the work lives in the cloud for as long as it lasts. This is how each neighboring feature connects to a project: +Several Claude Code features let more than one session work at the same time, so running work in parallel is not by itself what a project is for. In a project, Claude starts and tracks the sessions instead of you, and each one starts from the same instructions. This is how each neighboring feature connects to a project: * **Claude Tag** : [Claude Tag](<https://claude.com/docs/claude-tag/overview>) is Claude in your team’s Slack channels, on Team and Enterprise plans. Anyone in a channel can give it work, everyone in the channel sees and steers it, and it uses connections an admin set up for that channel. A project is yours alone: you’re the only one who sends it work or sees its threads, it uses your own GitHub access and connectors, and it’s on Pro and Max. [How Claude Tag differs from Cowork and Claude Code](<https://claude.com/docs/claude-tag/concepts/how-it-works#how-claude-tag-differs-from-cowork-and-claude-code>) has the side-by-side. - * **Cloud sessions** : every thread is a [cloud session](</docs/en/claude-code-on-the-web>), started and tracked by Claude instead of by you. A cloud session you started yourself can become a project or feed one through **Continue as a project** or **Move to project**. + * **Cloud sessions** : every thread is a [cloud session](</docs/en/claude-code-on-the-web>) unless you ask Claude to run it on your machine. Either way, Claude starts and tracks it instead of you. A cloud session you started yourself can become a project or feed one through **Continue as a project** or **Move to project**. * **Routines** : when you ask for scheduled work in a project, Claude creates a [routine](</docs/en/routines>) that runs as threads in that project and appears on its **Routines** tab. Routines you create outside a project keep working on their own. - * **Local sessions and agent view** : sessions in your terminal, IDE, or the desktop app’s local environment run on your machine and can’t be part of a project. [Agent view](</docs/en/agent-view>) is a screen for tracking several of those local sessions; it has no coordinator. - * **Worktrees** : a [worktree](</docs/en/worktrees>) gives each local session its own working copy of a repository so parallel sessions on your machine don’t overwrite each other. Threads don’t need them: each thread clones its repositories into its own cloud sandbox and works on its own branch. + * **Local sessions and agent view** : a session you start yourself in your terminal, IDE, or the desktop app’s local environment can’t be added to a project. A project reaches your machine only by running a thread there through [Remote Control](</docs/en/remote-control>). [Agent view](</docs/en/agent-view>) is a screen for tracking several local sessions you started yourself; it has no coordinator. + * **Worktrees** : a [worktree](</docs/en/worktrees>) gives each local session its own working copy of a repository so parallel sessions on your machine don’t overwrite each other. Cloud threads don’t need them: each clones its repositories into its own cloud sandbox and works on its own branch. * **Agent teams** : an [agent team](</docs/en/agent-teams>) is one session that starts teammate sessions for a single task, on your machine or inside a cloud session, and ends with that task. * **Projects in claude.ai chat and Cowork** : the [earlier Projects experience](<https://support.claude.com/en/articles/9517075-what-are-projects>), which groups conversations and reference files without threads or a coordinator. Those projects keep working as they do today until the redesigned experience reaches them. @@ -473,9 +473,9 @@ Limitations * Projects are available at claude.ai/code, in the desktop app, and in the Claude mobile app, not in the terminal CLI or through Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. The CLI’s [`claude project`](</docs/en/cli-reference>) command, which manages local Claude Code state for a directory, is unrelated. - * Project threads are [cloud sessions](</docs/en/claude-code-on-the-web>) with Anthropic as the model provider. [Security](</docs/en/security>) and [Data usage](</docs/en/data-usage>) cover how cloud sessions are isolated and what’s retained. - * A local session can’t be part of a project. - * A thread’s sandbox pauses between turns and resumes when the thread continues. If the sandbox can’t be resumed, the thread continues from a fresh clone, so uncommitted changes can be lost. On long tasks, ask Claude to commit and push work in progress. + * Project threads are [cloud sessions](</docs/en/claude-code-on-the-web>), or sessions on your own machine through [Remote Control](</docs/en/remote-control>), with Anthropic as the model provider in both cases. [Security](</docs/en/security>) and [Data usage](</docs/en/data-usage>) cover how cloud sessions are isolated and what’s retained, and [Connection and security](</docs/en/remote-control#connection-and-security>) covers how a thread on your machine connects and what’s stored. + * You can’t add a session you started yourself on your machine to a project. To let a project run a thread on your machine, connect the folder it should work in through [Remote Control](</docs/en/remote-control#requirements>): turn on Remote Control under **Settings > Claude Code** in the Claude desktop app, or run `claude remote-control` in the folder and leave it running. That machine needs Claude Code v2.1.280 or later. A project also can’t run a thread on your machine while **Require trusted devices** is on in your claude.ai settings. + * A cloud thread’s sandbox pauses between turns and resumes when the thread continues. If the sandbox can’t be resumed, the thread continues from a fresh clone, so uncommitted changes can be lost. On long tasks, ask Claude to commit and push work in progress. * A project belongs to one user. You can’t share a project or its threads with another user, and thread transcripts don’t have the share option other cloud sessions have. There are no organization-level controls for projects during the beta. * A thread belongs to the one project that started it. You can’t move or copy a thread to another project, or move it out to stand alone. **Move to project** goes the other way only: it brings a cloud session’s work into a project. @@ -493,7 +493,7 @@ A thread looks stuck -Claude doesn’t post each step a thread takes, so a thread that shows as running with no new messages in the project conversation is usually still working. A new thread also provisions its [cloud environment](</docs/en/cloud-environments>) before Claude begins, so its first update takes a moment. Open the thread to read its transcript. If the thread is waiting on a permission prompt, answer it there. +Claude doesn’t post each step a thread takes, so a thread that shows as running with no new messages in the project conversation is usually still working. A new cloud thread also provisions its [cloud environment](</docs/en/cloud-environments>) before Claude begins, so its first update takes a moment. Open the thread to read its transcript. If the thread is waiting on a permission prompt, answer it there. ### @@ -521,7 +521,7 @@ Repository access errors -Three messages mean a thread or the project can’t reach one of its repositories. A project thread needs the GitHub prerequisites even when your other cloud sessions clone the same repository without trouble. +Three messages mean a thread or the project can’t reach one of its repositories. A project’s cloud threads need the GitHub prerequisites even when your other cloud sessions clone the same repository without trouble. * **“Couldn’t start the session — Claude doesn’t have GitHub access to this project’s repository”** , reported before the thread starts, when the Claude GitHub App isn’t installed on that repository, is suspended, or isn’t linked to the GitHub account you connected. * **“Unable to access your repository”** , reported by a thread when its clone fails: GitHub rejected the clone, the repository wasn’t found under the name the project has, or the branch the thread was asked to start from doesn’t exist. @@ -569,8 +569,8 @@ Related resources - * [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>): how the cloud sessions behind each thread work, including GitHub access options and auto-fix on pull requests - * [Configure cloud environments](</docs/en/cloud-environments>): change what threads can reach on the network, give them environment variables and API credentials, and install tools with a setup script + * [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>): how the cloud sessions behind each cloud thread work, including GitHub access options and auto-fix on pull requests + * [Configure cloud environments](</docs/en/cloud-environments>): change what cloud threads can reach on the network, give them environment variables and API credentials, and install tools with a setup script * [Automate work with routines](</docs/en/routines>): schedules, triggers, and management for routines, including the ones Claude creates from a project * [Manage multiple agents with agent view](</docs/en/agent-view>): run and track several sessions on your own machine when the work needs tools or services only your machine can reach * [Projects redesigned: from folder to conversation](<https://claude.com/blog/projects-redesigned>): the launch announcement, with the thinking behind making a project a conversation with Claude
modified Scan your codebase for vulnerabilities View current →
--- a/claude-security.md +++ b/claude-security.md @@ -19,16 +19,16 @@ Install the plugin -In a Claude Code session, install from the [official Anthropic marketplace](</docs/en/discover-plugins#official-anthropic-marketplace>): +In a Claude Code session, install from the [official Anthropic marketplace](</docs/en/plugins/anthropic-marketplaces>): /plugin install claude-security@claude-plugins-official -The command opens the plugin’s details, where you choose an [installation scope](</docs/en/discover-plugins#install-plugins>) to start the install. If the install fails, the fix depends on which message Claude Code reports: +The command opens the plugin’s details, where you choose an [installation scope](</docs/en/plugins/install#install-a-plugin>) to start the install. If the install fails, the fix depends on which message Claude Code reports: * If it reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install. - * If it reports that it [can’t find the plugin in the marketplace](</docs/en/discover-plugins#install-plugins>), check the plugin name for a typo. + * If it reports that it [can’t find the plugin in the marketplace](</docs/en/plugins/install#install-a-plugin>), check the plugin name for a typo. -Check the install summary. If it reports `Run /reload-plugins to activate.`, see [Apply plugin changes without restarting](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) to activate the plugin in your current session. Once the plugin is active, you’re ready to scan and fix your codebase. +Check the install summary. If it reports `Run /reload-plugins to activate.`, see [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>) to activate the plugin in your current session. Once the plugin is active, you’re ready to scan and fix your codebase. ### @@ -174,4 +174,4 @@ * [Code Review](</docs/en/code-review>): set up the PR-time multi-agent review * [Claude Security](<https://claude.com/product/claude-security>): the managed service that monitors connected repositories * [Claude Code security](</docs/en/security>): how Claude Code approaches trust, permissions, and safeguards - * [Discover and install plugins](</docs/en/discover-plugins#official-anthropic-marketplace>): browse other official plugins + * [Install and manage plugins](</docs/en/plugins/install>): find and install other plugins from the official marketplace
added Recommend your plugin from your CLI View current →
Show diff (121 lines)
--- a/cli-hints.md +++ b/cli-hints.md @@ -0,0 +1,118 @@ +If you maintain a CLI or SDK, your tool can prompt Claude Code users to install your plugin. When your CLI detects that it’s running inside Claude Code, have it write a one-line `<claude-code-hint />` tag to stderr. Claude Code removes the line from Bash and PowerShell tool output before the model sees the output, then shows the user a one-time install prompt. This page applies only if your plugin is listed in `claude-plugins-official` or another marketplace with one of Anthropic’s [official marketplace names](</docs/en/plugins/security#official-marketplace-names>). The community marketplace, `claude-community`, isn’t one of them. + +To publish a plugin, see [Publish and distribute a plugin](</docs/en/plugins/publish>). + +## + +​ + +Emit the hint + +Emit the tag only when `CLAUDECODE` or `CLAUDE_CODE_CHILD_SESSION` is set, so it doesn’t appear when a person runs your CLI directly. Claude Code sets `CLAUDECODE=1` in the commands it runs through the Bash and PowerShell tools and in hook commands. On v2.1.172 and later it also sets `CLAUDE_CODE_CHILD_SESSION=1` there. The variables differ in which processes carry them: + + * **`CLAUDECODE`** : set by every Claude Code version. IDE extensions also set it in their integrated terminals, so a gate on `CLAUDECODE` alone also emits the tag when a person runs your CLI themselves in one of those terminals + * **`CLAUDE_CODE_CHILD_SESSION`** : set only in subprocesses Claude Code itself starts. Use it when you can require v2.1.172 or later + +The [environment variables reference](</docs/en/env-vars>) has the details. The following examples gate on `CLAUDECODE` for the widest reach and emit a hint for a plugin named `example-cli` in the official marketplace: + +Node.js + +Python + +Go + +Shell + + if (process.env.CLAUDECODE) { + process.stderr.write( + '<claude-code-hint v="1" type="plugin" value="example-cli@claude-plugins-official" />\n', + ) + } + + import os, sys + + if os.environ.get("CLAUDECODE"): + print( + '<claude-code-hint v="1" type="plugin" value="example-cli@claude-plugins-official" />', + file=sys.stderr, + ) + + if os.Getenv("CLAUDECODE") != "" { + fmt.Fprintln(os.Stderr, + `<claude-code-hint v="1" type="plugin" value="example-cli@claude-plugins-official" />`) + } + + if [ -n "$CLAUDECODE" ]; then + printf '%s\n' '<claude-code-hint v="1" type="plugin" value="example-cli@claude-plugins-official" />' >&2 + fi + +Replace `example-cli` with your plugin’s name in the official marketplace. You can emit the hint on every invocation, because Claude Code prompts for each plugin once. To check the emitter, run `CLAUDECODE=1 example-cli` in a terminal and confirm the tag line appears on stderr, then run `example-cli` without the variable and confirm nothing extra prints. + +## + +​ + +Hint format + +The tag must occupy its own line; Claude Code ignores a tag embedded mid-line. The tag takes three attributes, all required: + +Attribute| Description +---|--- +`v`| Protocol version. `1` is the only supported value +`type`| Hint kind. `plugin` is the only supported value +`value`| Plugin identifier in `name@marketplace` form + +Values may be double-quoted or unquoted; an unquoted value can’t contain whitespace. Claude Code removes the line from the output even when `v` or `type` is unrecognized. + +## + +​ + +Check when the prompt appears + +The prompt appears only in interactive terminal sessions. In `claude -p` runs, in subagent runs, and in hook command output, the tag is stripped and no prompt is shown. All of these checks must also pass: + + * **Official and installable** : `value` names a plugin that Claude Code finds in its local copy of an official marketplace, that isn’t already installed, and that no policy blocks + * **Analytics on** : a session where Claude Code’s analytics are off never prompts, for example one with `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` set, or one on a third-party provider such as Amazon Bedrock, where the [automatic telemetry opt-out](</docs/en/data-usage#default-behaviors-by-api-provider>) applies + * **Frequency limits** : one prompt per session, one prompt ever per plugin regardless of the user’s answer, and none once 100 plugins have been prompted for on that machine + * **Not turned off** : the user hasn’t chosen **No, and don’t show plugin installation hints again** + * **Local, attended session** : the session’s workspace is local rather than on a cloud or remote machine, and the session isn’t running unattended. For example, a session started with `--cloud`, one serving Remote Control, or an agent-team teammate never prompts + +## + +​ + +Preview what the user sees + +When the checks in Check when the prompt appears pass, Claude Code shows a **Plugin recommendation** dialog like the following: + + ───────────────────────────────────────────────────────────── + Plugin recommendation + + The example-cli command suggests installing a plugin. + + Plugin: example-cli + Marketplace: claude-plugins-official + Description: Official integration for example-cli deployments + + Would you like to install it? + ❯ 1. Yes, install + 2. No + 3. No, and don't show plugin installation hints again + + ───────────────────────────────────────────────────────────── + +The dialog names the first word of the shell command Claude ran, so users can spot a mismatch. Each answer has one effect: + + * **Yes, install** : installs the plugin at [user scope](</docs/en/plugins/install>) + * **No, and don’t show plugin installation hints again** : turns off future hint prompts for that user + * **No answer for 30 seconds** : counts as **No** + +## + +​ + +Next steps + + * [Publish and distribute a plugin](</docs/en/plugins/publish>): the routes into each marketplace, including the official marketplace, which the hint requires + * [Plugin commands reference](</docs/en/plugins/cli-reference#plugin-install>): the shell command that installs the same plugin outside a session
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -31,9 +31,9 @@ `claude import [source]`| Start an interactive session that runs [`/import`](</docs/en/commands#all-commands>) to bring configuration from other coding agents into Claude Code. Accepts the same `--dry-run` and `--yes` options as the command. Not available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS. Also unavailable when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>). Requires Claude Code v2.1.213 or later| `claude import codex --dry-run` `claude logs <id>`| Print recent output from a [background session](</docs/en/agent-view#manage-sessions-from-the-shell>)| `claude logs 7c5dcf5d` `claude mcp`| Configure Model Context Protocol (MCP) servers| See the [Claude Code MCP documentation](</docs/en/mcp>). -`claude mcp login <name>`| Run a configured MCP server’s OAuth flow without opening the interactive `/mcp` panel. Works for HTTP, SSE, and claude.ai connector servers. Add `--no-browser` over SSH to print the authorization URL instead of opening a browser, then paste the redirect URL back at the prompt. Requires Claude Code v2.1.186 or later. See [Authenticate from the command line](</docs/en/mcp#authenticate-from-the-command-line>)| `claude mcp login sentry` -`claude mcp logout <name>`| Clear stored OAuth credentials for an MCP server. Requires Claude Code v2.1.186 or later| `claude mcp logout sentry` -`claude plugin`| Manage Claude Code [plugins](</docs/en/plugins>). Alias: `claude plugins`. See [plugin reference](</docs/en/plugins-reference#cli-commands-reference>) for subcommands| `claude plugin install code-review@claude-plugins-official` +`claude mcp login <name>`| Run a configured MCP server’s OAuth flow without opening the interactive `/mcp` panel. Works for HTTP, SSE, and claude.ai connector servers. Add `--no-browser` over SSH to print the authorization URL instead of opening a browser, then paste the redirect URL back at the prompt. See [Authenticate from the command line](</docs/en/mcp#authenticate-from-the-command-line>)| `claude mcp login sentry` +`claude mcp logout <name>`| Clear stored OAuth credentials for an MCP server| `claude mcp logout sentry` +`claude plugin`| Manage Claude Code [plugins](</docs/en/plugins/overview>). Alias: `claude plugins`. See [plugin reference](</docs/en/plugins/cli-reference#claude-plugin-commands>) for subcommands| `claude plugin install code-review@claude-plugins-official` `claude project purge [path]`| Delete all local Claude Code state for a project: transcripts, task lists, debug logs, file-edit history, prompt history lines, and the project’s entry in `~/.claude.json`. Omit `[path]` to pick from an interactive list. Flags: `--dry-run` to preview, `-y`/`--yes` to skip confirmation, `-i`/`--interactive` to confirm each item, `--all` for every project. See [Clear local data](</docs/en/claude-directory#clear-local-data>)| `claude project purge ~/work/repo --dry-run` `claude remote-control`| Start a [Remote Control](</docs/en/remote-control>) server to control Claude Code from Claude.ai or the Claude app. Runs in server mode (no local interactive session). See [Server mode flags](</docs/en/remote-control#start-a-remote-control-session>). After you stop the server, you can bring back the sessions it was serving. See [Resume sessions after stopping the server](</docs/en/remote-control#resume-sessions-after-stopping-the-server>)| `claude remote-control --name "My Project"` `claude respawn <id>`| Restart a [background session](</docs/en/agent-view#manage-sessions-from-the-shell>), running or stopped, with its conversation intact. Use `--all` to restart every running session, e.g. to pick up an updated Claude Code binary| `claude respawn 7c5dcf5d` @@ -67,7 +67,7 @@ `--append-system-prompt-file`| Load additional system prompt text from a file and append to the default prompt| `claude --append-system-prompt-file ./extra-rules.txt` `--autocompact <auto|tokens>`| Set the [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) for this session without changing your saved settings. Accepts the same values as `/autocompact`; that section covers the value forms and what overrides the flag. Requires Claude Code v2.1.221 or later| `claude --autocompact 500k` `--ax-screen-reader`| Render screen-reader friendly output: flat text without decorative borders or animations. Forces the classic renderer, so the [`tui`](</docs/en/settings-reference#tui>) setting has no effect; attached [background sessions](</docs/en/agent-view>) still render fullscreen. Takes precedence over [`CLAUDE_AX_SCREEN_READER`](</docs/en/env-vars>) and the [`axScreenReader`](</docs/en/settings-reference#axscreenreader>) setting. Requires Claude Code v2.1.181 or later| `claude --ax-screen-reader` -`--bare`| Minimal mode: skip auto-discovery of hooks, skills, custom commands, subagents, plugins, MCP servers, auto memory, and CLAUDE.md so scripted calls start faster. Skills in a directory you pass with `--add-dir` still load. Claude has access to Bash, file read, and file edit tools. Sets [`CLAUDE_CODE_SIMPLE`](</docs/en/env-vars>). See [bare mode](</docs/en/headless#start-faster-with-bare-mode>)| `claude --bare -p "query"` +`--bare`| Minimal mode: skip auto-discovery of hooks, skills, custom commands, subagents, installed plugins, MCP servers, auto memory, and CLAUDE.md so scripted calls start faster. Skills in a directory you pass with `--add-dir` still load. Claude has access to Bash, file read, and file edit tools. Sets [`CLAUDE_CODE_SIMPLE`](</docs/en/env-vars>). See [bare mode](</docs/en/headless#start-faster-with-bare-mode>)| `claude --bare -p "query"` `--betas`| Beta headers to include in API requests (API key users only)| `claude --betas interleaved-thinking` `--bg`, `--background`| Start the session as a [background agent](</docs/en/agent-view>) and return immediately. Prints the session ID and management commands. Combine with `--exec` to run a shell command as a background job instead of a Claude session, or with `--agent` to run a specific subagent. Can’t be combined with `-p`/`--print`; see the [error reference](</docs/en/errors#command-line-errors>)| `claude --bg "investigate the flaky test"` `--channels`| (Research preview) MCP servers whose [channel](</docs/en/channels>) notifications Claude should listen for in this session. Space-separated list of `plugin:<name>@<marketplace>` entries. Requires Anthropic authentication through claude.ai or a Console API key| `claude --channels plugin:my-notifier@my-marketplace` @@ -112,7 +112,7 @@ The prompt tool can’t approve an MCP tool marked as [requiring user interaction](</docs/en/mcp#require-approval-for-a-specific-tool>): Claude Code converts an `allow` result for one to a deny. This restriction requires Claude Code v2.1.199 or later| `claude -p --permission-prompt-tool mcp_auth_tool "query"` `--permission-prompts`| Set who answers permission prompts in print mode. With the default `host`, Claude Code sends them to the Agent SDK host or the `--permission-prompt-tool` tool. Pass `none` when nobody can answer, and Claude Code denies them instead. See [Turn off permission prompts in unattended runs](</docs/en/headless#turn-off-permission-prompts-in-unattended-runs>). Requires Claude Code v2.1.259 or later| `claude -p --permission-prompts none "query"` -`--plugin-dir`| Load a plugin from a directory or `.zip` archive, or several from a [folder of plugins](</docs/en/plugins#test-your-plugins-locally>), for this session only. Each flag takes one path. Repeat the flag for more paths: `--plugin-dir A --plugin-dir B.zip`. Passing a folder of plugins requires Claude Code v2.1.265 or later| `claude --plugin-dir ./my-plugin` +`--plugin-dir`| Load a plugin from a directory or `.zip` archive, or several from a [folder of plugins](</docs/en/plugins/create#load-a-directory-or-archive-for-one-session>), for this session only. Each flag takes one path. Repeat the flag for more paths: `--plugin-dir A --plugin-dir B.zip`. Passing a folder of plugins requires Claude Code v2.1.265 or later| `claude --plugin-dir ./my-plugin` `--plugin-url`| Fetch a plugin `.zip` archive from a URL for this session only. Repeat the flag for multiple plugins, or pass space-separated URLs in a single quoted value| `claude --plugin-url https://example.com/plugin.zip` `--print`, `-p`| Print response without interactive mode (see [Agent SDK documentation](</docs/en/agent-sdk/overview>) for programmatic usage details)| `claude -p "query"` `--prompt-suggestions`| Emit a `prompt_suggestion` message with a predicted next user prompt after each turn that generates one; very short conversations can produce none. Requires `--print`, `--output-format stream-json`, and `--verbose`. See [Prompt suggestions](</docs/en/interactive-mode#prompt-suggestions>)| `claude -p --prompt-suggestions --output-format stream-json --verbose "query"` @@ -132,7 +132,7 @@ `--system-prompt-file`| Load system prompt from a file, replacing the default prompt| `claude --system-prompt-file ./custom-prompt.txt` `--system-prompt-snapshot`| Pass `off` to rebuild the system prompt on every request instead of reusing the prompt recorded on the conversation’s first request, for example while you iterate on `--append-system-prompt` text across `--continue` runs. Requires Claude Code v2.1.257 or later| `claude --system-prompt-snapshot off` `--teleport`| Resume a [cloud session](</docs/en/claude-code-on-the-web>) in your local terminal| `claude --teleport` -`--teammate-mode`| Set how [agent team](</docs/en/agent-teams>) teammates display: `in-process` (default), `auto`, `tmux`, or `iterm2` (added in v2.1.186). Overrides the [`teammateMode`](</docs/en/settings-reference#teammatemode>) setting for this session. See [Choose a display mode](</docs/en/agent-teams#choose-a-display-mode>)| `claude --teammate-mode auto` +`--teammate-mode`| Set how [agent team](</docs/en/agent-teams>) teammates display: `in-process` (default), `auto`, `tmux`, or `iterm2`. Overrides the [`teammateMode`](</docs/en/settings-reference#teammatemode>) setting for this session. See [Choose a display mode](</docs/en/agent-teams#choose-a-display-mode>)| `claude --teammate-mode auto` `--tmux`| Create a tmux session for the worktree. Requires `--worktree`. Uses iTerm2 native panes when available; pass `--tmux=classic` for traditional tmux| `claude -w feature-auth --tmux` `--tools`| Restrict which built-in tools Claude can use. Use `""` to disable all, `"default"` for the default set, or tool names like `"Bash,Edit,Read"`. On macOS, Linux, and WSL, the default set leaves out `Glob` and `Grep`, as described under [Glob tool behavior](</docs/en/tools-reference#glob-tool-behavior>). If you name one of the [task-tracking tools](</docs/en/tools-reference#task-tool-availability>) here, Claude Code also opts the session in. The flag doesn’t affect MCP tools; to deny those too, use `--disallowedTools "mcp__*"`. A list that omits [`EndConversation`](</docs/en/tools-reference#endconversation-tool-behavior>) doesn’t remove it; `""` removes it only when no MCP tools remain| `claude --tools "Bash,Edit,Read"` `--verbose`| Enable verbose logging, shows full turn-by-turn output. Overrides the [`viewMode`](</docs/en/settings-reference#viewmode>) setting for this session| `claude --verbose`
modified Configure cloud environments View current →
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -290,11 +290,11 @@ Your repo’s `.mcp.json` MCP servers| Yes, in a session with one repository| Part of the clone, found from the session’s working directory Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone -Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>). Enable the plugin for your claude.ai account instead, so Claude Code loads it as a [synced plugin](</docs/en/plugins-reference#synced-plugins>) +Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai -Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine. Enable them for your claude.ai account instead, so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) +Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log API keys and tokens for services Claude calls| On Pro and Max plans, as API credentials| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable
added Code intelligence plugins View current →
Show diff (163 lines)
--- a/code-intelligence.md +++ b/code-intelligence.md @@ -0,0 +1,160 @@ +A code intelligence plugin gives Claude the live diagnostics and go-to-definition that your editor has, so Claude catches type errors and missing imports that its own edits introduce before you run your build, and finds definitions and references by symbol instead of by text search. Each plugin connects Claude Code to a language server for one language through the Language Server Protocol (LSP). You install the plugin from Anthropic’s official marketplace and the language server binary on your machine. + +Code intelligence plugins work in terminal sessions. In [cloud sessions](</docs/en/claude-code-on-the-web>), Claude Code doesn’t start plugin language servers, so Claude gets no diagnostics or code navigation there. To write your own language server plugin, or to connect a language server that has no plugin, see [LSP servers in plugin components](</docs/en/plugins/components#lsp-servers>). + +To get started, find your language in the table under Install a code intelligence plugin. The plugins in that table come from Anthropic’s [official plugin marketplace](</docs/en/plugins/anthropic-marketplaces>). If you already saw an **LSP plugin recommendation** dialog, see Accept or dismiss the recommendation dialog for what each choice does. + +## + +​ + +Install a code intelligence plugin + +A code intelligence plugin tells Claude Code which command starts the language server and which file extensions it handles. It doesn’t include the language server. Install the language server binary first, then the plugin, then confirm the server starts. + +1 + +Install the language server binary + +Find your language in the table below and install the binary in its row. If your language isn’t listed, see Add a language without an official plugin. + +Language| Plugin| Binary +---|---|--- +C/C++| [`clangd-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/clangd-lsp>)| `clangd` +C#| [`csharp-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/csharp-lsp>)| `csharp-ls` +Go| [`gopls-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp>)| `gopls` +Java| [`jdtls-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/jdtls-lsp>)| `jdtls` +Kotlin| [`kotlin-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/kotlin-lsp>)| `kotlin-lsp` +Liquid| [`liquid-lsp`](<https://github.com/Shopify/liquid-skills/tree/main/plugins/liquid-lsp>)| `shopify`, from the Shopify CLI +Lua| [`lua-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/lua-lsp>)| `lua-language-server` +PHP| [`php-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/php-lsp>)| `intelephense` +Python| [`pyright-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp>)| `pyright-langserver` +Ruby| [`ruby-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/ruby-lsp>)| `ruby-lsp` +Rust| [`rust-analyzer-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp>)| `rust-analyzer` +Swift| [`swift-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/swift-lsp>)| `sourcekit-lsp` +TypeScript and JavaScript| [`typescript-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp>)| `typescript-language-server` + +Anthropic maintains every plugin in the table except `liquid-lsp`, which Shopify maintains and the official marketplace lists.To find the command that installs the binary, follow the plugin’s link in the table to its README. For TypeScript, that command is `npm install -g typescript-language-server typescript`.After you install the binary, confirm it’s on the `PATH` of the shell you start `claude` from, for example with `which typescript-language-server`, or `Get-Command typescript-language-server` in PowerShell. + +2 + +Install the plugin + +To install the plugin listed for your language in the step 1 table, run `/plugin install` in a Claude Code session, replacing `typescript-lsp` with that plugin’s name: + + /plugin install typescript-lsp@claude-plugins-official + +A confirmation message says whether the plugin is active now or needs `/reload-plugins`. If the install fails with `Marketplace "claude-plugins-official" not found`, see the [troubleshooting entry for that error](</docs/en/plugins/troubleshooting#marketplace-claude-plugins-official-not-found>). To control where the plugin is installed, or to run the install from your shell instead of inside Claude Code, see [Install plugins](</docs/en/plugins/install>). + +3 + +Confirm the server starts + +The language server starts the first time Claude edits a file with one of the plugin’s extensions. To see it work, ask Claude to introduce a type error in a file of that language and then fix it. Then check the conversation for a diagnostics line: + + * **A diagnostics line appears** : `Found N new diagnostic issues in M files (ctrl+o to expand)` under the edit that introduced the error means the server started. + * **No diagnostics line appears** : run `/plugin` and open the **Errors** tab. A row reading `Executable not found in $PATH: "<binary>"` names the binary to install. If the tab has no such row, see Troubleshoot code intelligence. + +After you install a missing binary, Claude Code tries again the next time Claude edits a matching file. If you installed the binary into a directory that isn’t on the `PATH` of the shell you started `claude` from, start a new session from a shell where it is. + +## + +​ + +See what Claude gains + +With a language server running, Claude gains diagnostics and code navigation: + + * **Diagnostics after edits** : each time Claude edits or writes a file the server handles, Claude gets the errors and warnings the server reports. It sees a type error, missing import, or syntax error it introduced without running a compiler. + * **Code navigation** : Claude gets an `LSP` tool that looks up symbols through the server instead of searching text for them. The tool is read-only. For what Claude can look up with the tool and how permissions apply to it, see [LSP tool behavior](</docs/en/tools-reference#lsp-tool-behavior>). + +### + +​ + +Read the diagnostics yourself + +After Claude edits a file the server handles, the conversation shows only the `Found N new diagnostic issues` summary. To read the issues themselves, press **Ctrl+O**. + +## + +​ + +Accept or dismiss the recommendation dialog + +If a language server binary is already on your `PATH` and the plugin that uses it isn’t installed, Claude Code offers to install the plugin for you in a dialog titled **LSP plugin recommendation**. + +### + +​ + +When the recommendation dialog appears + +The **LSP plugin recommendation** dialog can appear after Claude edits a file. These conditions decide whether it appears and which plugin it offers: + + * **A plugin matches the file** : one of the marketplaces you’ve added, or the official marketplace Claude Code registered for you, lists a code intelligence plugin for that file’s extension, and the plugin’s binary is installed. + * **Official first** : when more than one marketplace offers a plugin for the extension, the dialog offers the official marketplace’s plugin. + * **Once per session** : the dialog appears at most once in a session, for the first matching file Claude edits. + * **Not for cloud sessions** : the dialog never appears when your terminal is attached to a cloud session, such as one you started with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>). + +### + +​ + +Respond to the recommendation dialog + +The **LSP plugin recommendation** dialog names the plugin and offers these choices: + + * **Yes, install** : Claude Code installs the plugin for your user account and prints `<plugin> installed · restart to apply`. Start a new session to load the server. + * **No, not now** : the dialog closes, and a later session can offer the plugin again. Pressing **Esc** does the same. + * **Never for this plugin** : the dialog stops appearing for that plugin and still appears for others. + * **Disable all LSP recommendations** : the dialog stops appearing for every language. + +If you don’t choose an option, Claude Code closes it after 30 seconds and counts that as ignored. The count is kept across sessions. After five ignored dialogs, Claude Code stops recommending plugins, the same as if you’d chosen **Disable all LSP recommendations**. + +### + +​ + +Turn recommendations back on + +The **LSP plugin recommendation** dialog stops appearing after you choose **Disable all LSP recommendations** or ignore it five times. + + * **Disabled or ignored five times** : to turn it back on in either case, remove the `lspRecommendationDisabled` and `lspRecommendationIgnoredCount` keys from `~/.claude.json`, Claude Code’s own configuration file. + * **Never for this plugin** : if you chose **Never for this plugin** and want that plugin offered again, remove its `name@marketplace` id from the `lspRecommendationNeverPlugins` list in the same file. + +## + +​ + +Troubleshoot code intelligence + +The plugins troubleshooting page covers the symptoms specific to code intelligence plugins under [Language server doesn’t start, uses too much memory, or reports wrong diagnostics](</docs/en/plugins/troubleshooting#language-server-doesnt-start>): + + * **The language server doesn’t start** : you see `Executable not found in $PATH` in the **Errors** tab of `/plugin`, or Claude never reports diagnostics for the language. + * **High memory use** : memory use increases while the server indexes the project. + * **False positive diagnostics in a monorepo** : diagnostics report imports as unresolved when they aren’t. + +## + +​ + +Add a language without an official plugin + +If your language isn’t in the table of official plugins, you can still connect a language server. + + 1. Write a plugin with an `.lsp.json` file that names the server command and the file extensions it handles. + 2. Then load the plugin with [`--plugin-dir`](</docs/en/plugins/cli-reference#flags-that-load-a-plugin-for-one-session>) or publish it to a marketplace. + +For the file’s fields and a worked example, see [LSP servers in plugin components](</docs/en/plugins/components#lsp-servers>). + +## + +​ + +Next steps + + * [LSP servers in plugin components](</docs/en/plugins/components#lsp-servers>): write the `.lsp.json` for a language server that has no official plugin + * [Install and manage plugins](</docs/en/plugins/install>): scopes, updates, and uninstalling + * [Troubleshoot plugins](</docs/en/plugins/troubleshooting>): load errors beyond the language-server ones on this page + * [Find plugins in the official marketplace](</docs/en/plugins/anthropic-marketplaces#find-plugins-in-the-official-marketplace>): where to browse the rest of the official marketplace
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -35,14 +35,14 @@ `/autocompact [auto|<tokens>]`| Set the auto-compact window: how full the context window gets before Claude Code compacts automatically. Pass a size such as `500k`, or `auto` to return to the window tuned for your model. Claude Code saves the value to user settings and applies it to the current session. See [Set the auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) for accepted values and what overrides it. Without an argument, opens a dialog that shows the current window. Requires Claude Code v2.1.221 or later `/autofix-pr [prompt]`| Spawn a [cloud session](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>) that watches the current branch’s PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with `gh pr view`; to watch a different PR, check out its branch first. By default the cloud session is told to fix every CI failure and review comment; pass a prompt to give it different instructions, for example `/autofix-pr only fix lint and type errors`. Requires the `gh` CLI and access to [cloud sessions](</docs/en/claude-code-on-the-web>) `/background [prompt]`| Detach the current session to run as a [background agent](</docs/en/agent-view>) and free this terminal. Pass a prompt to send one more instruction before detaching. Monitor the session with `claude agents`. To copy the conversation into a new background session while this one keeps running, use `/fork`. Alias: `/bg` -`/batch <instruction>`| **[Skill](</docs/en/skills#bundled-skills>).** Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one [background subagent](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) per unit in an isolated [git worktree](</docs/en/worktrees>). Each subagent implements its unit, runs tests, and opens a pull request. Requires a git repository. Example: `/batch migrate src/ from JavaScript to TypeScript` +`/batch <instruction>`| **[Skill](</docs/en/skills#bundled-skills>).** Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one [background subagent](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) per unit in an isolated [worktree](</docs/en/worktrees>). Each subagent implements its unit, runs tests, and publishes its change. Requires a git repository or a [`WorktreeCreate` hook](</docs/en/worktrees#non-git-version-control>) that creates the worktrees. Outside a git repository, `/batch` requires Claude Code v2.1.281 or later. Example: `/batch migrate src/ from JavaScript to TypeScript` `/branch [name]`| Create a branch of the current conversation at this point, so you can try a different direction without losing the conversation as it stands. Switches you into the branch and preserves the original, which you can return to with `/resume`. To run a copy as a separate [background session](</docs/en/agent-view>) instead of switching into it, use `/fork`; to hand a side task to a [subagent](</docs/en/sub-agents>) that reports back into this conversation, use `/subtask` `/btw [question]`| Ask a [side question](</docs/en/interactive-mode#side-questions-with-%2Fbtw>) about the current session without adding to the conversation. If you run `/btw` without a question, Claude Code shows your most recent side question so you can browse earlier answers; if you haven’t asked one yet, Claude Code prints a usage line. Before v2.1.212, `/btw` required a question `/bug [report]`| Report a bug or share your conversation. You choose how much session history to include and confirm on a consent screen before anything is sent. When you’re signed in to Anthropic on a first-party connection, the report goes to Anthropic; on a third-party provider, or without Anthropic credentials, Claude Code writes the report to a [local archive under `~/.claude/feedback-bundles/`](</docs/en/data-usage#telemetry-services>) that you forward yourself. In the [VS Code extension](</docs/en/vs-code#use-the-prompt-box>), `/bug` opens the extension’s own feedback dialog instead; requires Claude Code v2.1.229 or later. When you run it while Claude is responding, Claude Code opens the dialog immediately. Before v2.1.232, Claude Code queued the command until the turn finished. Alias: `/share`. Before v2.1.212, `/bug` and `/share` were aliases of `/feedback` `/cd <path>`| Move this session to a new working directory, keeping the conversation. Type a partial path to see matching directory suggestions; press `Tab` to accept one. The suggestions require Claude Code v2.1.206 or later. For what Claude Code applies from the new directory as soon as you move, and how `/cd` differs from `/add-dir`, see [Move the session to another directory](</docs/en/permissions#move-the-session-to-another-directory>) `/chrome`| Configure [Claude in Chrome](</docs/en/chrome>) settings `/claude-api [migrate|upgrade|managed-agents-onboard|prompt-audit|cost-optimize|build-eval|hillclimb]`| **[Skill](</docs/en/skills#bundled-skills>).** Load [Claude API](<https://platform.claude.com/docs/en/api/overview>) and [Managed Agents](<https://platform.claude.com/docs/en/managed-agents/overview>) reference material for your project’s language. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk`. Run `migrate` to update existing Claude API code to a newer model. Run `upgrade` to move your project’s Anthropic SDK dependency across a major version, currently the Python `anthropic` package from 0.x to 1.x. Run `managed-agents-onboard` for a walkthrough that creates a new Managed Agent. Run `prompt-audit` to flag instructions written for older models in your prompts, skills, and tool descriptions and propose fixes as a diff. Run `cost-optimize` to profile where your project’s Claude API spend goes and propose savings from options such as prompt caching, trimming unneeded input and output tokens, batch processing, effort, and model choice, one change at a time. Run `build-eval` to build an eval set for your Claude-powered app, and `hillclimb` to iteratively improve the app against an existing eval. The `prompt-audit` subcommand requires Claude Code v2.1.221 or later, `upgrade` requires v2.1.236 or later, `cost-optimize` requires v2.1.247 or later, and `build-eval` and `hillclimb` require v2.1.259 or later -`/clear [name]`| Start a new conversation with empty context. Pass a name to label the previous conversation in the `/resume` picker. To free up context while continuing the same conversation, use `/compact` instead. Resume the previous conversation with `/resume`, or, in the same Claude Code process, restore it from [the rewind menu’s previous-session entry](</docs/en/checkpointing#rewind-past-a-cleared-conversation>). The rewind entry requires Claude Code v2.1.191 or later. Aliases: `/reset`, `/new` +`/clear [name]`| Start a new conversation with empty context. Pass a name to label the previous conversation in the `/resume` picker. To free up context while continuing the same conversation, use `/compact` instead. Resume the previous conversation with `/resume`, or, in the same Claude Code process, restore it from [the rewind menu’s previous-session entry](</docs/en/checkpointing#rewind-past-a-cleared-conversation>). Aliases: `/reset`, `/new` `/code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [pr#|branch|path]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the current diff, or a PR number, branch, or path you pass, for correctness bugs. Depending on your model and effort level, the review also covers cleanup opportunities. Pass `--fix` to apply findings, `--comment` to post them on the GitHub PR or GitLab merge request, or `ultra` to run a deep [cloud review](</docs/en/ultrareview>). Posting to a GitLab merge request requires Claude Code v2.1.257 or later. With `ultra` on a `github.com` PR target, pass `--post` to preselect [posting the finished findings to the PR](</docs/en/ultrareview#post-findings-to-the-pull-request>) in the launch dialog; `--post` requires Claude Code v2.1.227 or later. See [Review a diff locally](</docs/en/code-review#review-a-diff-locally>) for the effort levels, targeting, and how it relates to `/simplify`. Alias: `/review` `/color [color|default]`| Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset, or run with no argument to pick a random color. When [Remote Control](</docs/en/remote-control>) is connected, the color syncs to claude.ai/code. Also available in non-interactive mode (`-p`); requires Claude Code v2.1.205 or later `/compact [instructions]`| Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary. See [how compaction handles rules, skills, and memory files](</docs/en/context-window#what-survives-compaction>) @@ -90,7 +90,7 @@ `/passes`| Share a free week of Claude Code with friends. Only visible if your account is eligible `/permissions`| Manage allow, ask, and deny rules for tool permissions. Opens an interactive dialog where you can view rules by scope, add or remove rules, manage working directories, and review [recent auto mode denials](</docs/en/auto-mode-config#review-denials>). You can also view and edit [auto mode classifier rules](</docs/en/auto-mode-config#edit-rules-from-permissions>) from the dialog’s **Auto mode** tab. When you run it while Claude is responding, Claude Code opens the dialog immediately and applies your changes starting with Claude’s next tool call in the same turn. Before v2.1.234, Claude Code queued the command until the turn finished. Alias: `/allowed-tools` `/plan [description]`| Enter plan mode directly from the prompt. Pass an optional description to enter plan mode and immediately start with that task, for example `/plan fix the auth bug` -`/plugin [subcommand]`| Manage Claude Code [plugins](</docs/en/plugins>). Run with no argument to open the plugin menu, or pass a subcommand such as `list`, `install`, `enable`, or `disable` to act directly. Claude Code can activate a plugin during the install; the [install summary](</docs/en/discover-plugins#install-plugins>) tells you whether it did or whether to run `/reload-plugins` +`/plugin [subcommand]`| Manage Claude Code [plugins](</docs/en/plugins/overview>). Run with no argument to open the plugin menu, or pass a subcommand such as `list`, `install`, `enable`, or `disable` to act directly. Claude Code can activate a plugin during the install; the [install summary](</docs/en/plugins/install#install-a-plugin>) tells you whether it did or whether to run `/reload-plugins` `/powerup`| Discover Claude Code features through quick interactive lessons with animated demos `/pr-comments [PR]`| Removed in v2.1.91. Ask Claude directly to view pull request comments instead. On earlier versions, fetches and displays comments from a GitHub pull request; automatically detects the PR for the current branch, or pass a PR URL or number. Requires the `gh` CLI `/privacy-settings`| View and update your privacy settings. Only available for Pro and Max plan subscribers @@ -98,7 +98,7 @@ `/rate-limit-options`| Show ways to keep working when a claude.ai usage limit blocks a request: wait and [continue automatically when the limit resets](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>), add [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>), or upgrade your plan. Claude Code can also open this menu on its own when you hit a limit at your own terminal. See [Turn automatic continue off](</docs/en/interactive-mode#turn-automatic-continue-off>). Requires a claude.ai subscription. Doesn’t appear in the command menu; type it in full. The wait-and-continue rows require Claude Code v2.1.234 or later `/recap`| Generate a one-line summary of the current session on demand. See [Session recap](</docs/en/interactive-mode#session-recap>) for the automatic recap that appears after you’ve been away `/release-notes`| View the changelog in an interactive version picker. Select a specific version to see its release notes, or choose to show all versions. The notes appear in your transcript without entering the conversation Claude sees -`/reload-plugins [--force]`| Reload all active [plugins](</docs/en/plugins>) to apply pending changes without restarting. Reports counts for each reloaded component and flags any load errors. When the reload would change which MCP tools are loaded and invalidate the prompt cache, the command warns and skips unless you pass `--force`. Also available in non-interactive mode (`-p`), the Agent SDK, and the desktop app, where it runs only on input typed directly into the session and doesn’t apply plugin MCP server changes; requires Claude Code v2.1.260 or later. See [Apply plugin changes without restarting](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) +`/reload-plugins [--force]`| Reload all active [plugins](</docs/en/plugins/overview>) to apply pending changes without restarting. Reports counts for each reloaded component and flags any load errors. When the reload would change which MCP tools are loaded and invalidate the prompt cache, the command warns and skips unless you pass `--force`. Also available in non-interactive mode (`-p`), the Agent SDK, and the desktop app, where it runs only on input typed directly into the session and doesn’t apply plugin MCP server changes; requires Claude Code v2.1.260 or later. See [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>) `/reload-skills`| Re-scan [skill](</docs/en/skills>) and command directories so skills added or changed on disk during the session become available without restarting. Reports how many skills are available and how many were added or removed `/remote-control`| Make this session available for [Remote Control](</docs/en/remote-control>) from claude.ai. Running it while signed out prints that Remote Control requires a claude.ai subscription and tells you how to sign in; before v2.1.206 it reported `Unknown command: /remote-control`. Alias: `/rc` `/remote-env`| Choose the default [cloud environment](</docs/en/cloud-environments#select-an-environment-from-the-cli>) for cloud sessions you start from the CLI
modified Common workflows View current →
--- a/common-workflows.md +++ b/common-workflows.md @@ -97,7 +97,7 @@ * Be specific about what you’re looking for * Use domain language from the project - * Install a [code intelligence plugin](</docs/en/discover-plugins#code-intelligence>) for your language to give Claude precise “go to definition” and “find references” navigation + * Install a [code intelligence plugin](</docs/en/plugins/code-intelligence>) for your language to give Claude precise “go to definition” and “find references” navigation * * *
added Add components to a plugin View current →
Show diff (506 lines)
--- a/components.md +++ b/components.md @@ -0,0 +1,503 @@ +A Claude Code plugin is built from components, such as skills, agents, hooks, and MCP servers. Each component has a default folder in the plugin, an optional manifest key in `.claude-plugin/plugin.json` that replaces or adds to that folder, and a name the user sees. For each key’s full field table, see the [manifest reference](</docs/en/plugins/manifest-reference#fields>). Use this page to add a component to a plugin that already loads. After you add a component, run `/reload-plugins` in a running session or start a new one so Claude Code loads it. To check the component’s file before loading it, run [`claude plugin validate .`](</docs/en/plugins/cli-reference#plugin-validate>) in your shell from the plugin directory. + +These cases are covered on other pages: + + * **Building your first plugin** : start with [Create a plugin](</docs/en/plugins/create>) + * **Installing someone else’s plugin** : see [Install plugins](</docs/en/plugins/install>) + * **Your plugin’s users are on claude.ai or in Cowork** : a different set of components loads there. See [Plugins on claude.ai and in Cowork](<https://claude.com/docs/plugins/overview>) + +## + +​ + +Explore the plugin directory + +The explorer shows an example plugin, `my-plugin`, that has one of every kind of component in its default location: + + * A review skill and an `about` command + * A security-review subagent + * A hook that formats files after Claude edits them, and the `scripts/` folder it calls + * A log monitor + * An output style and a color theme + * A route-audit workflow + * A `hello-plugin` executable + * Default settings + * A local MCP server and a Go language server + +Each file is the smallest valid example of its format, there to show the shape rather than to be useful: a real skill or agent carries full instructions and often supporting files, and a real hook or monitor does real work. The sections after the explorer use the same files as their examples and link to fuller ones. Select a file or folder to read what it’s for, see what goes in it, and find the section that covers it. + +## + +​ + +Add each kind of component + +Each section below covers one kind of component: where its files go in the plugin, an example that validates, what the user sees once the plugin loads, and the manifest key that changes the default location. Add the ones your plugin needs; none is required. + +### + +​ + +Skills + +A [skill](</docs/en/skills>) is a `SKILL.md` file that Claude can load when its description matches the task. The user can also run it as a command. Save each skill in its own directory under `skills/`: + + my-plugin/ + ├── .claude-plugin/ + │ └── plugin.json + └── skills/ + └── review/ + └── SKILL.md + +Give the `SKILL.md` a `description` so Claude knows when to use it: + +skills/review/SKILL.md + + --- + description: Reviews a pull request for style and test coverage. Use when asked to review code. + --- + + Review the changed files. Report style problems first, then missing tests. + +After you load the plugin, `/my-plugin:review` runs the skill. The command name and who can invoke it follow these rules: + + * **Command name** : `/<plugin>:<directory>`, so `skills/review/SKILL.md` in `my-plugin` is `/my-plugin:review`. If you set `name` in the frontmatter, it replaces the last segment and the plugin prefix stays. See [how a skill gets its command name](</docs/en/skills#how-a-skill-gets-its-command-name>) + * **Who invokes it** : Claude, the user, or both, controlled by frontmatter. See [Control who invokes a skill](</docs/en/skills#control-who-invokes-a-skill>) + +You can also place skills outside the default `skills/` directory: + + * **Additional directories** : list them in the `skills` manifest key. They add to the default `skills/` scan rather than replacing it, unlike `commands` and `agents` + * **A single skill at the plugin root** : with no `skills/` directory and no `skills` manifest key, a `SKILL.md` at the plugin root loads as one skill. Set `name` in its frontmatter, because otherwise a marketplace install names the skill after its [cache directory](</docs/en/plugins/loading#find-plugins-on-disk>) rather than your plugin + +To include instructions in a plugin, write them as a skill. Claude Code doesn’t load a `CLAUDE.md` at the plugin root, and `claude plugin validate` warns `CLAUDE.md at the plugin root is not loaded as project context`. For frontmatter fields and supporting files, see [Skills](</docs/en/skills>). + +### + +​ + +Commands + +A command is a single Markdown file the user runs by name, such as `/my-plugin:about`. + +Commands are the older format, and skills supersede them for new work. A skill runs by name the same way, and it can also carry supporting files in its directory. Keep `commands/` for files you’re moving over from `.claude/commands/`. + +Save a command at `commands/<file>.md` and it becomes `/<plugin>:<file>`. A subdirectory adds a segment, so `commands/db/migrate.md` is `/my-plugin:db:migrate`. Command files take the same frontmatter as skills. + +#### + +​ + +Define commands in the manifest + +You only need this if you want to keep command files somewhere other than `commands/`, or to define a short command inside `plugin.json` without a separate Markdown file. Set the `commands` manifest key, and Claude Code reads it instead of scanning `commands/`. The key takes a path, an array of paths, or an object that maps each command name to either a `source` file or inline `content`. This manifest defines `/my-plugin:about` inline, with no Markdown file: + +.claude-plugin/plugin.json + + { + "name": "my-plugin", + "commands": { + "about": { + "content": "Summarize what this repository does in three sentences.", + "description": "Summarize the repository" + } + } + } + +Load the plugin and run `/my-plugin:about` in the session to confirm it loaded. For the full key syntax, see [`commands`](</docs/en/plugins/manifest-reference#commands>). + +### + +​ + +Agents + +A [subagent](</docs/en/sub-agents>) is a separate assistant, with its own instructions and context window, that Claude can delegate a task to. Each Markdown file under `agents/` defines one: + +agents/security-reviewer.md + + --- + name: security-reviewer + description: Reviews code changes for security issues. Use after edits to authentication or input handling. + model: sonnet + --- + + You are a security reviewer. Read the changed files and report injection, authentication, and secrets-handling risks. + +This agent is named `my-plugin:security-reviewer`, and the user can [invoke it explicitly](</docs/en/sub-agents#invoke-subagents-explicitly>) with `@agent-my-plugin:security-reviewer`. The name form is `<plugin>:<name>`, where `<name>` comes from the frontmatter, or from the file name when there is none. The `agents` manifest key replaces the `agents/` scan. + +#### + +​ + +Organize agents in subfolders + +You can put plugin agent files in subfolders of `agents/`. Claude Code [loads them recursively](</docs/en/sub-agents#choose-the-subagent-scope>) and joins the plugin name, each subfolder name, and the file name with colons to form the agent’s scoped name. For example, `agents/review/security.md` in a plugin named `my-plugin` loads as `my-plugin:review:security`. Two settings change that name: + + * Frontmatter `name`: it replaces only the file name, so `name: audit` in `agents/review/security.md` loads as `my-plugin:review:audit` + * Manifest [`agents`](</docs/en/plugins/manifest-reference#fields>) field: a file you list there loads without subfolder names, so `"agents": "./custom/review/security.md"` loads as `my-plugin:security` + +#### + +​ + +Frontmatter fields in plugin agents + +A plugin agent’s frontmatter follows these rules: + + * **Supported fields** : `name`, `description`, `model`, `effort`, `maxTurns`, `tools`, `disallowedTools`, `skills`, `memory`, `background`, `omitClaudeMd`, `isolation`, `color`, and the `cacheTtl` key of `experimental`. The only valid `isolation` value is `"worktree"`. See [supported frontmatter fields](</docs/en/sub-agents#supported-frontmatter-fields>) for what each one does + * **Ignored fields** : `permissionMode`, `hooks`, `mcpServers`, and `initialPrompt`. An agent file can’t add hooks or MCP servers on its own, so add those as plugin hooks and MCP servers instead + * **Frontmatter that doesn’t parse** : the agent still loads with every field ignored. It’s named after the file, and its description reads `Agent from my-plugin plugin`. Run [`claude plugin validate`](</docs/en/plugins/cli-reference#plugin-validate>) in your shell to find these files + +For what each field does and the precedence rules, see [Subagents](</docs/en/sub-agents#supported-frontmatter-fields>). + +### + +​ + +Hooks + +A [hook](</docs/en/hooks-guide>) runs something automatically at a point in Claude Code’s lifecycle, such as after every file edit: a shell command, an HTTP request, an MCP tool call, a prompt to a model, or a subagent. Save the plugin’s hooks in `hooks/hooks.json` at the plugin root, under a top-level `"hooks"` key, in the same shape as the `hooks` object in `settings.json`. That lets you copy an existing settings hook in unchanged. This hook runs a bundled script after every `Write` or `Edit`: + +hooks/hooks.json + + { + "hooks": { + "PostToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "command", + "command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/format.sh\"" + } + ] + } + ] + } + } + +Save the script at `scripts/format.sh` and make it executable. Load the plugin and ask Claude to edit a file. A `PostToolUse` hook that exits 0 shows nothing in the transcript, so confirm it ran with [debug logging](</docs/en/hooks#debug-hooks>) or by what the script itself changes. Hooks in `hooks/hooks.json` and in the `hooks` manifest key both load. For every event and its payload, see [Hook events](</docs/en/hooks#hook-events>). + +#### + +​ + +When plugin hooks fire + +A plugin’s hooks don’t wait for one of the plugin’s skills or commands to be used. Claude Code registers them when a session loads the plugin, and they fire on their events from then on. To limit when a hook runs, narrow its `matcher`. If a hook never fires, see [hooks that don’t fire](</docs/en/plugins/troubleshooting#failed-to-load-hooks-from-and-hooks-that-dont-fire>). + +#### + +​ + +Environment, quoting, and matching MCP tools + +The hook’s environment, the quoting of `${CLAUDE_PLUGIN_ROOT}`, and matchers for the plugin’s own MCP tools work as follows: + + * **Environment** : every hook process receives `CLAUDE_PLUGIN_ROOT` and `CLAUDE_PLUGIN_DATA` in its environment, plus `CLAUDE_PLUGIN_OPTION_<KEY>` for each user configuration value, so your script can read them from there + * **Quoting** : when `command` has no `args`, it runs through a shell, so wrap the `${CLAUDE_PLUGIN_ROOT}` path in double quotes, as the `hooks/hooks.json` example under Hooks does, to keep the expanded path one shell word. When you pass `args` instead, each element is passed as one argument with no shell and needs no quoting. See [exec form and shell form](</docs/en/hooks#exec-form-and-shell-form>) + * **Matching the plugin’s own MCP tools** : a tool from an MCP server this plugin declares is named `mcp__plugin_<plugin>_<server>__<tool>`, so write that full name in the matcher. A matcher on the server name alone never fires. See [Match MCP tools](</docs/en/hooks#match-mcp-tools>) + +### + +​ + +MCP servers + +An MCP server gives Claude tools from an external system. Declare it in `.mcp.json` at the plugin root, in the same shape as a [project `.mcp.json`](</docs/en/mcp#project-scope>). This `.mcp.json` declares one server named `db`: + +.mcp.json + + { + "mcpServers": { + "db": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/server.js"] + } + } + } + +You can also omit the `mcpServers` wrapper and put `db` at the top level of the file. Load the plugin and run `/mcp` to confirm the server appears as `plugin:my-plugin:db`. `claude plugin validate` checks `.mcp.json` and reports a server entry that Claude Code would drop at load time as an error. Requires Claude Code v2.1.281 or later. For where a bad entry shows up at load time, see [MCP servers that don’t start](</docs/en/plugins/troubleshooting#invalid-mcp-server-config-for-and-mcp-servers-that-dont-start>). The `mcpServers` manifest key takes an inline server map, a path to a JSON file, or an array of those. When a manifest server has the same name as one in `.mcp.json`, the manifest server replaces it. + +#### + +​ + +Reach users on claude.ai and Cowork + +A local stdio server, such as the `db` server under MCP servers, runs in Claude Code and in a Cowork session that runs on your machine in the Claude Desktop app, but not on claude.ai. To reach users there too, reference a remote server by its `https://` URL, which claude.ai and Cowork offer to the user as a connector. + +#### + +​ + +Server names, tool names, and reloads + +The server’s names, variable substitution, and reload behavior follow these rules: + + * **Server name** : `plugin:<plugin>:<server>`, so the `db` server in `my-plugin` is `plugin:my-plugin:db` in `/mcp`. Use the same form to name the server in an [`mcp_tool` hook](</docs/en/hooks#mcp-tool-hook-fields>) + * **Tool names** : `mcp__plugin_<plugin>_<server>__<tool>`, so a `query` tool on that `db` server is `mcp__plugin_my-plugin_db__query`. That is the name to use in [permission rules](</docs/en/permissions>) and hook matchers + * **Substitution** : `${CLAUDE_PLUGIN_ROOT}` and the other path variables are substituted in `command`, `args`, and `env`. No quoting is needed in `args`, because each element is passed as one argument + * **Reload** : when the user runs `/reload-plugins` and [the reload applies](</docs/en/plugins/cli-reference#reloads-that-change-mcp-tools>), a server whose configuration is unchanged keeps its connection. A server whose configuration changed reconnects, and one you removed disconnects + +#### + +​ + +Include a packaged MCPB server + +The `mcpServers` key also accepts a packaged server as an [MCPB file](<https://github.com/modelcontextprotocol/mcpb>), whose extension is `.mcpb` or the older `.dxt`. Point the key at the file, as a path inside the plugin or an `https://` URL: + +.claude-plugin/plugin.json + + { + "name": "my-plugin", + "mcpServers": "./servers/db.mcpb" + } + +The server takes its name from the `name` in the bundle’s manifest. For transports and authentication, see [MCP](</docs/en/mcp#plugin-provided-mcp-servers>). + +### + +​ + +LSP servers + +An LSP server gives Claude diagnostics and code navigation for a language. If an [official code intelligence plugin](</docs/en/plugins/code-intelligence>) already covers your language, install that instead of writing one. Otherwise declare the server in `.lsp.json` at the plugin root: + +.lsp.json + + { + "gopls": { + "command": "gopls", + "args": ["serve"], + "extensionToLanguage": { + ".go": "go" + } + } + } + +The file maps each server name directly to its configuration, with no wrapper object around the map. `command` is the binary’s name, with its arguments in `args`. `extensionToLanguage` needs at least one extension, each starting with `.`. `claude plugin validate` doesn’t read this file. When any entry is invalid, the whole file is skipped at load and `Invalid LSP server config for ".lsp.json"` appears in the `/plugin` **Errors** tab. Your plugin configures the connection but doesn’t install the server binary, and each file extension gets one server: + + * **Missing binary** : Claude Code starts `command` by name from the user’s `PATH`. When the binary isn’t there, the server fails to start and `claude --debug` logs `LSP server <name> failed to start` + * **Extension conflicts** : when two enabled servers claim the same extension, the first registered handles those files and the other isn’t used for them, whether the servers come from one plugin or two. The `/plugin` **Errors** tab shows the warning `LSP server "<name>" is not used for <ext> files` + +The `lspServers` manifest key takes the same map inline, a path to a JSON file, or an array of those, and its servers add to the ones in `.lsp.json`. When a manifest server has the same name as one in `.lsp.json`, the manifest server replaces it. For `transport`, timeouts, restarts, and the other fields, see [`lspServers`](</docs/en/plugins/manifest-reference#lspservers>). Send log output to stderr, not stdout. Claude Code reads a server’s stdout as protocol messages only, and accepts message headers up to 64 KiB and a message body up to 32 MiB. Claude Code disconnects a server that exceeds either limit or writes non-protocol output to stdout, and counts the disconnect as a crash for `restartOnCrash` and `maxRestarts`. When you run with `--debug`, Claude Code writes an error naming the cause to the debug log. + +### + +​ + +Executables + +Files in `bin/` at the plugin root are on the `PATH` of the Bash tool’s shell while the plugin is enabled, so Claude can run them as bare commands. Add an executable script: + +bin/hello-plugin + + #!/bin/bash + echo "hello from my-plugin" + +Make it executable with `chmod +x bin/hello-plugin` and load the plugin. When you ask Claude to run `hello-plugin`, the Bash tool result shows the script’s output. Plugin `bin/` directories come after the user’s own `PATH` entries, so a plugin can’t shadow `git`, `ls`, or another system command. claude.ai and Cowork don’t install a plugin that has a top-level `bin/` directory, including one you [distribute through claude.ai organization settings](</docs/en/plugins/host-marketplace#distribute-through-organization-settings>). + +### + +​ + +Default settings + +To set defaults that apply while the plugin is enabled, add a `settings.json` at the plugin root, or put the same object inline in the `settings` manifest key. Two keys take effect, `agent` and `subagentStatusLine`, and every other key is dropped. Set `agent` to run one of the plugin’s own agents as the main thread: + +settings.json + + { + "agent": "security-reviewer" + } + +Load the plugin and start a session. Claude then answers in the main conversation with the `security-reviewer` agent’s system prompt and model. For everything the key controls, see the [`agent` setting](</docs/en/settings-reference#agent>). When the same key is set in more than one place, these rules decide which value applies: + + * **File over manifest** : when both exist and `settings.json` sets at least one supported key, `settings.json` applies and the manifest’s `settings` is ignored + * **User settings over plugin defaults** : across settings sources, plugin defaults are the lowest layer, so a user’s own `agent` in `~/.claude/settings.json` overrides yours + * **Two plugins set the same key** : the value from the plugin loaded last applies, and `claude --debug` logs `overrides setting` + +For the `subagentStatusLine` shape, see [subagent status lines](</docs/en/statusline#subagent-status-lines>). + +### + +​ + +Themes and output styles + +A plugin can include color themes and output styles. Both appear in the same pickers as the user’s own. For either one, setting the manifest key replaces the folder scan. + +Component| Save as| Format| Appears in| Manifest key +---|---|---|---|--- +Theme| `themes/<slug>.json`| The [custom theme file](</docs/en/terminal-config#create-a-custom-theme>) format users write in `~/.claude/themes/`| `/theme`, under the file’s `name`| `experimental.themes` +Output style| `output-styles/<name>.md`| The [custom output style](</docs/en/output-styles#create-a-custom-output-style>) format, with `name` and `description` frontmatter| `/output-style`, as `<plugin>:<name>`| `outputStyles` + +Plugin themes are read-only, so when a user edits one in `/theme`, the edit is saved as a copy in their own themes directory. This theme recolors the prompt accent and error text on the dark preset: + +themes/dracula.json + + { + "name": "Dracula", + "base": "dark", + "overrides": { + "claude": "#bd93f9", + "error": "#ff5555" + } + } + +### + +​ + +Channels + +A [channel](</docs/en/channels>) lets an outside system such as a chat app send messages into a session. In a plugin, a channel is one of the MCP servers plus a `channels` entry that binds to it and can prompt for its own configuration. This manifest binds a channel to a `telegram` server and asks for a bot token: + +.claude-plugin/plugin.json + + { + "name": "my-plugin", + "mcpServers": { + "telegram": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/server.js"], + "env": { "BOT_TOKEN": "${user_config.bot_token}" } + } + }, + "channels": [ + { + "server": "telegram", + "userConfig": { + "bot_token": { + "type": "string", + "title": "Bot token", + "description": "Telegram bot token", + "sensitive": true + } + } + } + ] + } + +`server` must match a key in `mcpServers`. The per-channel `userConfig` takes the same shape as the top-level `userConfig` key. For what the server must implement and how users enable a channel plugin, see [Package as a plugin](</docs/en/channels-reference#package-as-a-plugin>) in the channels reference. For the field table, see [`channels`](</docs/en/plugins/manifest-reference#channels>). + +### + +​ + +Monitors + +A monitor is a shell command that runs in the background for the whole session. What it prints reaches Claude as notifications, so Claude can react to a log or a status change without being asked to watch it. Save the entries in `monitors/monitors.json`: + +monitors/monitors.json + + [ + { + "name": "error-log", + "command": "tail -F ./logs/error.log", + "description": "Application error log" + } + ] + +The command runs in a shell, in the working directory the session started in. A monitor’s command is limited in where it starts and what it can reference: + + * **Interactive sessions only** : plugin monitors start in an interactive session and never in non-interactive mode with the `-p` flag. They also start only where the [Monitor tool](</docs/en/tools-reference#monitor-tool>) is available + * **No user configuration** : `command` gets the path variables and `${ENV_VAR}` from the environment, but never `${user_config.*}`. A monitor that references one doesn’t start, and monitor processes don’t receive `CLAUDE_PLUGIN_OPTION_<KEY>` either + * **Disabling mid-session** : if you disable a plugin mid-session, Claude Code doesn’t stop monitors that are already running. They stop when the session ends + +The `experimental.monitors` manifest key takes the same array inline or a path to a JSON file, and is read instead of `monitors/monitors.json`. For the `when` trigger and the other fields, see [`monitors`](</docs/en/plugins/manifest-reference#monitors>). + +## + +​ + +Ask the user for configuration values + +Declare the values your plugin needs from the user in the `userConfig` manifest key, so users don’t edit `settings.json` themselves. Each option appears in a dialog with its `title` as the label and its `description` beneath it. Set `"sensitive": true` for a token or password. The dialog then masks the input, and the value is stored in secure storage rather than `settings.json`. This manifest asks for an endpoint and a token: + +.claude-plugin/plugin.json + + { + "name": "my-plugin", + "userConfig": { + "api_url": { + "type": "string", + "title": "API URL", + "description": "Base URL of your team's API" + }, + "api_token": { + "type": "string", + "title": "API token", + "description": "Token for your team's API", + "sensitive": true + } + } + } + +### + +​ + +When the configuration dialog appears + +The dialog appears only in the interactive `/plugin` interface. It opens for any option that isn’t set yet when the user does any of the following: + + * Installs the plugin in `/plugin` + * Runs `/plugin install <plugin>@<marketplace>` inside a session + * Enables the plugin from the **Installed** tab in `/plugin` + +To open the same dialog at any time, the user runs `/plugin configure <plugin>@<marketplace>`. The `claude plugin install` shell command never prompts for `userConfig` values. To set values from the shell, pass each one as `--config KEY=VALUE`. When options remain unset, the command prints a `userConfig options not yet set` line that names both ways to set them. [The `userConfig` dialog never appears](</docs/en/plugins/troubleshooting#the-userconfig-dialog-never-appears>) quotes the line. For the option fields, where each value is stored, how a component references a saved value, and which fields reject `${user_config.*}`, see [User configuration](</docs/en/plugins/manifest-reference#user-configuration>). + +## + +​ + +Reference plugin paths and store data + +You don’t know where your plugin will be installed, so refer to its files and data through these variables rather than fixed paths. They’re substituted in skill, command, and agent content, in hook and monitor commands, and in MCP and LSP server configurations. They’re also exported to hook, MCP, and LSP processes: + + * **`${CLAUDE_PLUGIN_ROOT}`** : the plugin’s install directory. Each version has its own [cache directory](</docs/en/plugins/loading#find-plugins-on-disk>), so the path changes when the plugin updates. Don’t write state there + * **`${CLAUDE_PLUGIN_DATA}`** : a directory that survives updates, for `node_modules`, virtual environments, and caches. It resolves to `~/.claude/plugins/data/<id>/` and is created when first referenced + * **`${CLAUDE_PROJECT_DIR}`** : the project root, the same value hooks receive + +In the data directory path, `<id>` is the plugin identifier with every character other than letters, digits, `_`, and `-` replaced by `-`, so `my-plugin@my-marketplace` becomes `my-plugin-my-marketplace`. On Windows, the substituted paths use forward slashes so a shell doesn’t read backslashes as escapes. + +### + +​ + +Install dependencies into the data directory + +For a marketplace-installed plugin, Claude Code installs eligible [Node.js package dependencies](</docs/en/plugins/loading#node-js-package-dependencies>) automatically when it caches the plugin, so you may not need to install them yourself. When you do, this `SessionStart` hook installs `node_modules` into `${CLAUDE_PLUGIN_DATA}` on first run and again after an update changes `package.json`: + +hooks/hooks.json + + { + "hooks": { + "SessionStart": [ + { + "hooks": [ + { + "type": "command", + "command": "diff -q \"${CLAUDE_PLUGIN_ROOT}/package.json\" \"${CLAUDE_PLUGIN_DATA}/package.json\" >/dev/null 2>&1 || (cd \"${CLAUDE_PLUGIN_DATA}\" && cp \"${CLAUDE_PLUGIN_ROOT}/package.json\" . && npm install) || rm -f \"${CLAUDE_PLUGIN_DATA}/package.json\"" + } + ] + } + ] + } + } + +After the first session, `~/.claude/plugins/data/<id>/node_modules` exists. An MCP server can then set `NODE_PATH` to `${CLAUDE_PLUGIN_DATA}/node_modules` in its `env`. For which fields substitute which variable, see [Environment variables](</docs/en/plugins/manifest-reference#environment-variables>). + +## + +​ + +Next steps + + * [Plugin manifest reference](</docs/en/plugins/manifest-reference>): `plugin.json` fields, path rules, and the standard layout + * [Test plugins with evals](</docs/en/plugin-evals>): check that the components you added change Claude’s behavior the way you intend + * [Publish and distribute a plugin](</docs/en/plugins/publish>): version the plugin and put it in a marketplace + * [Troubleshoot plugins](</docs/en/plugins/troubleshooting>): what to do when a component doesn’t load or a hook doesn’t fire
modified Manage costs effectively View current →
--- a/costs.md +++ b/costs.md @@ -286,7 +286,7 @@ Install code intelligence plugins for typed languages -[Code intelligence plugins](</docs/en/discover-plugins#code-intelligence>) give Claude precise symbol navigation instead of text-based search, reducing unnecessary file reads when exploring unfamiliar code. A single “go to definition” call replaces what might otherwise be a grep followed by reading multiple candidate files. Installed language servers also report type errors automatically after edits, so Claude catches mistakes without running a compiler. +[Code intelligence plugins](</docs/en/plugins/code-intelligence>) give Claude precise symbol navigation instead of text-based search, reducing unnecessary file reads when exploring unfamiliar code. A single “go to definition” call replaces what might otherwise be a grep followed by reading multiple candidate files. Installed language servers also report type errors automatically after edits, so Claude catches mistakes without running a compiler. ### @@ -399,7 +399,7 @@ * **Conversation summarization** : Background jobs that summarize previous conversations for the `claude --resume` feature * **Command processing** : Some commands like `/usage` may generate requests to check status -These background processes consume a small amount of tokens (typically under $0.04 per session) even without active interaction. +These background processes consume a small amount of tokens (typically under $0.04 per session) even without active interaction. When prompt suggestions are on, Claude Code also sends a short request to the model your session is using after Claude responds, to [suggest your next prompt](</docs/en/interactive-mode#prompt-suggestions>). That request reuses the conversation’s prompt cache, so it is mostly cache reads plus a few output tokens. Claude Code [skips it while your account is close to or at its usage limit](</docs/en/interactive-mode#when-claude-code-skips-suggestions>). To stop these requests, [turn prompt suggestions off](</docs/en/interactive-mode#turn-prompt-suggestions-off>). ##
added Create a Claude Code plugin View current →
Show diff (413 lines)
--- a/create.md +++ b/create.md @@ -0,0 +1,410 @@ +A plugin is a directory of skills, agents, hooks, and MCP servers, plus a `plugin.json` file, called the manifest, that names the plugin. Claude Code loads the directory as one unit, so you can share it with teammates, install it in several projects, or publish it to a marketplace. This page is for people writing their own plugins. + +These cases are covered on other pages: + + * **Installing someone else’s plugin** : see [Install plugins](</docs/en/plugins/install>) + * **Not sure you need a plugin** : see [Decide whether you need a plugin](</docs/en/plugins/overview#decide-whether-you-need-a-plugin>) on the overview + * **Your plugin’s users are on claude.ai or in Cowork** : the same folder installs there with a different subset of components. See [Plugins on claude.ai and in Cowork](<https://claude.com/docs/plugins/overview>) + +Start from the section that matches what you already have: + + * **Nothing yet** : follow Create your first plugin, then Develop without a marketplace and Test and debug. + * **Files under`.claude/` already**: do the first-plugin walkthrough once to learn the layout, then follow Convert an existing `.claude/` setup. + +## + +​ + +Decide when to use a plugin + +Skills, agents, hooks, and MCP servers all work standalone in your project or home directory. Keep that standalone setup while it serves one project or only you. Make a plugin when you want to share the setup with teammates, install it in several projects, or publish versioned releases. When you move standalone skills, agents, hooks, and MCP config into a plugin, their location and names change: + + * **Where the files go** : under the plugin’s own directory, called the plugin root, as `skills/`, `agents/`, `hooks/hooks.json`, and `.mcp.json`. + * **How they’re named** : plugin skills and agents get the plugin name as a prefix, such as `/my-plugin:hello`, so two plugins can each provide a `hello` skill without colliding. + +To move an existing setup into a plugin, see Convert an existing `.claude/` setup. + +## + +​ + +Create your first plugin + +In this walkthrough, you create a plugin whose only component is one skill, a greeting, and run it with `--plugin-dir`, which loads a plugin for one session without installing it. A plugin can hold any mix of [components](</docs/en/plugins/components>), such as skills, agents, hooks, and MCP servers, and none is required; one skill is the smallest example that shows the layout. You need Claude Code [installed and signed in](</docs/en/quickstart#step-1-install-claude-code>). Open a terminal in the directory where you want to keep the plugin, such as `~/projects`, and run the commands in these steps from it. You can keep a plugin anywhere, because you pass its path to Claude Code when you start a session. + +1 + +Create the plugin directory + +Create the plugin directory, with a `.claude-plugin/` folder inside it to hold the manifest: + + mkdir -p my-first-plugin/.claude-plugin + +2 + +Write the manifest + +The [manifest](</docs/en/plugins/manifest-reference>) is a JSON file named `plugin.json` that tells Claude Code the plugin’s name and describes it. Save this one as `my-first-plugin/.claude-plugin/plugin.json`: + +my-first-plugin/.claude-plugin/plugin.json + + { + "name": "my-first-plugin", + "description": "A greeting plugin to learn the basics", + "version": "1.0.0", + "author": { + "name": "Your Name" + } + } + +The four fields do this: + + * **`name`** : required. It identifies the plugin and becomes the prefix on every skill and agent the plugin provides. Don’t put spaces in it. + * **`description`** : the text users see for the plugin in `/plugin`. + * **`version`** : optional. Setting it keeps users on that version until you change it; [Release a new version](</docs/en/plugins/host-marketplace#release-a-new-version>) says when to set or omit it. + * **`author`** : who to credit. `name` is required inside it; `email` and `url` are optional. + +Every other field is on the [manifest reference](</docs/en/plugins/manifest-reference#fields>).Only `plugin.json` goes inside `.claude-plugin/`. The skill you add next goes directly under `my-first-plugin/`, next to that folder. + +3 + +Add a skill + +This plugin’s one component is a skill. Each skill is a directory under `skills/` that contains a `SKILL.md` file. Create the skill’s directory: + + mkdir -p my-first-plugin/skills/hello + +Then create `my-first-plugin/skills/hello/SKILL.md` with this content: + +my-first-plugin/skills/hello/SKILL.md + + --- + name: hello + description: Greet the user with a friendly message + disable-model-invocation: true + --- + + Greet the user warmly and ask how you can help them today. + +The `disable-model-invocation: true` line means Claude doesn’t run the skill on its own, so only you trigger it. Remove that line from a skill you want Claude to run on its own. The skill’s command combines the plugin name and the skill’s name, so you run this one as `/my-first-plugin:hello`. For the other frontmatter fields, see the [skill frontmatter reference](</docs/en/skills#frontmatter-reference>). + +4 + +Validate the plugin + +Check the manifest and the skill’s frontmatter before you run anything: + + claude plugin validate ./my-first-plugin + +The command prints the manifest path it checked and `✔ Validation passed`. If it prints `✘ Validation failed` instead, each line above that result line names the field to fix. Look up each message under [`claude plugin validate` reports errors](</docs/en/plugins/troubleshooting#claude-plugin-validate-reports-errors>). + +5 + +Run Claude Code with the plugin + +Start a session with the plugin loaded: + + claude --plugin-dir ./my-first-plugin + +Once Claude Code starts, run the skill: + + /my-first-plugin:hello + +Claude replies with a greeting. + +The plugin loads only in sessions you start with `--plugin-dir`. To keep working on it without the flag, or to test a `.zip` build, see Develop without a marketplace. + +### + +​ + +Share your plugin + +A plugin you built with Create your first plugin exists only on your machine. When it’s ready for other people, there are three ways to get it to them: + + * **Send it to a few people directly** : give them the plugin’s directory or a `.zip` of it, and nothing needs to be published. See [Share a plugin without a marketplace](</docs/en/plugins/publish#share-a-plugin-without-a-marketplace>). + * **List it in your own marketplace** : teammates add your marketplace once and install the plugin by name, and they receive your updates. See [Publish through your own marketplace](</docs/en/plugins/publish#publish-through-your-own-marketplace>). + * **Submit it to Anthropic’s community marketplace** : once it’s listed, anyone who adds that marketplace can install it. See [Submit to the community marketplace](</docs/en/plugins/publish#submit-to-the-community-marketplace>). + +### + +​ + +Plugin layout + +Each kind of [component](</docs/en/plugins/components>), such as skills, agents, hooks, and MCP servers, goes in a fixed directory under the plugin root, which is the directory you pass to `--plugin-dir`. Add only the directories you use. To click through a complete plugin directory and read what each file does, open the [plugin explorer](</docs/en/plugins/components#explore-the-plugin-directory>). The table lists the directories most plugins start with, and the [full layout](</docs/en/plugins/manifest-reference#standard-layout>) lists the rest. + +Location| Contents +---|--- +`.claude-plugin/plugin.json`| The manifest. When you load a plugin with `--plugin-dir` and it has no manifest, Claude Code names the plugin after its directory +`skills/`| One `<name>/SKILL.md` directory per skill +`commands/`| Flat Markdown files, the older form of skills. Use `skills/` for new plugins +`agents/`| One Markdown file per subagent +`hooks/hooks.json`| Hook configuration: a top-level `"hooks"` key whose value has the same shape as `hooks` in a settings file +`.mcp.json`| MCP server definitions + +Only `plugin.json` goes inside `.claude-plugin/`. Components saved there don’t load.The plugin root is the plugin’s own directory, not `~/.claude/` itself. A `.mcp.json` saved at `~/.claude/.mcp.json` doesn’t load. + +## + +​ + +Develop without a marketplace + +You don’t need a [marketplace](</docs/en/plugins/overview#get-plugins-from-a-marketplace>) to run a plugin you’re writing. Load it directly from disk or a URL instead: + + * `--plugin-dir`: loads a directory or `.zip` archive for one session. + * `--plugin-url`: fetches a `.zip` archive from a URL for one session. + * `claude plugin init`: scaffolds a plugin under `~/.claude/skills/` that loads every session. + +If two plugins loaded in different ways share a name, see [Name conflicts](</docs/en/plugins/loading#name-conflicts>) for which one Claude Code keeps. + +### + +​ + +Load a plugin for one session + +You can load a plugin for a single session in three ways: from a directory or `.zip` archive on disk with `--plugin-dir`, from a URL with `--plugin-url`, or from an environment variable when you can’t add a flag. Each plugin loads for that session only, and nothing is written to your settings for it. When you edit the plugin’s files during the session, run `/reload-plugins` to load the changes. + +#### + +​ + +From a directory or `.zip` + +When you start `claude` from your shell, pass `--plugin-dir` with the plugin’s root directory or a `.zip` archive of it. Repeat the flag to load several plugins: + + claude --plugin-dir ./my-first-plugin --plugin-dir ./other-plugin.zip + +#### + +​ + +From a folder of plugins + +To load several plugins from one place, pass a folder that holds them, such as `--plugin-dir ./plugins`. Loading a folder of plugins requires Claude Code v2.1.265 or later. If the folder has no `.claude-plugin/` directory and no plugin components at its top level, Claude Code treats it as a folder of plugins. Each immediate subfolder that has a `.claude-plugin/plugin.json` manifest then loads as a separate plugin. Everything else in the folder is skipped without an error, including a subfolder that has no manifest. If a plugin in the folder doesn’t load, check that its subfolder has a `.claude-plugin/plugin.json`. In an interactive session, you can also add and remove plugins in the folder after startup: + + * A subfolder you add loads as a new plugin once its manifest exists. + * When you remove a subfolder, its plugin unloads. + +A message appears in the session for each of these changes. If loading or unloading a plugin mid-conversation would [invalidate the prompt cache](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>), the change is held instead, and the message tells you to run `/reload-plugins` to apply it. + +#### + +​ + +From a URL + +When you start `claude` from your shell, pass `--plugin-url` with the address of a `.zip` archive, such as a build artifact your CI publishes: + + claude --plugin-url https://example.com/my-first-plugin.zip + +Claude Code downloads the archive at startup. To load several, repeat the flag or pass the URLs space-separated in one quoted argument. Point the flag only at archives you control or trust. If Claude Code can’t fetch the archive, or the archive is invalid, it starts without the plugin and records a plugin load error that you can review in the `/plugin` manager’s **Errors** tab. + +#### + +​ + +From an environment variable + +To load plugins in a session where you can’t add the `--plugin-dir` flag, list their absolute paths in the [`CLAUDE_CODE_PLUGIN_DIRS`](</docs/en/env-vars#variables>) environment variable instead. Claude Code loads each path as it loads a `--plugin-dir` path. These plugins load in addition to any you pass with `--plugin-dir`. [Project and local settings can’t set this variable](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). `CLAUDE_CODE_PLUGIN_DIRS` requires Claude Code v2.1.280 or later. Managed settings can turn off `--plugin-dir` and `CLAUDE_CODE_PLUGIN_DIRS`. See [Flags that load a plugin for one session](</docs/en/plugins/cli-reference#flags-that-load-a-plugin-for-one-session>). To test a plugin together with a plugin it depends on, see [Test a plugin and its dependency locally](</docs/en/plugins/dependencies#test-a-plugin-and-its-dependency-locally>). + +### + +​ + +Make a plugin load in every session + +Your personal skills directory is `~/.claude/skills/`. Claude Code loads any folder there that contains a `.claude-plugin/plugin.json` as a plugin in every session, with no flag and no install step. `claude plugin init` scaffolds one of these plugins for you. + +#### + +​ + +Scaffold the plugin with `claude plugin init` + +`claude plugin init` writes a starter plugin under `~/.claude/skills/`. Requires Claude Code v2.1.157 or later. Scaffold one from your shell: + + claude plugin init my-tool + +The command creates `~/.claude/skills/my-tool/` with a `.claude-plugin/plugin.json` and a root `SKILL.md`. It prints `✔ Created plugin "my-tool" at ~/.claude/skills/my-tool` followed by `It will auto-load next session as my-tool@skills-dir. Run /reload-plugins to load it now.` Pass `--with skills` to have `claude plugin init` scaffold a skill under `skills/` for you. The other `--with` values are on the [plugin commands reference](</docs/en/plugins/cli-reference#plugin-init>). + +#### + +​ + +Name the plugin’s skills + +The root skill at `~/.claude/skills/my-tool/SKILL.md` is also a personal skill, so you invoke it as `/my-tool`, not `/my-tool:my-tool`. Skills you add under `skills/` inside the plugin get the plugin-name prefix, such as `/my-tool:example`. + +#### + +​ + +Stop loading the plugin + +To stop loading a scaffolded plugin, delete its directory, or run `claude plugin disable my-tool@skills-dir` in your shell with the `my-tool@skills-dir` name that `claude plugin init` printed. In the ID `my-tool@skills-dir`, `skills-dir` stands where a marketplace name would, because the plugin loads from your skills directory rather than from a marketplace. + +#### + +​ + +Share the plugin through a repository + +`claude plugin init` writes the plugin to your personal skills directory at `~/.claude/skills/`, so it loads for you in every project. To make a plugin load for everyone in one repository, create the same layout yourself at `<project>/.claude/skills/<name>/`, including its `.claude-plugin/plugin.json`. See [Plugins shared through a repository](</docs/en/plugins/loading#plugins-shared-through-a-repository>) for the conditions under which Claude Code loads it. + +## + +​ + +Test and debug + +When a change to your plugin doesn’t show up, work through these checks in order. Each one tells you what Claude Code did with the plugin: + + 1. In your shell, run `claude plugin validate <path>`. It checks the manifest and the frontmatter of every skill, agent, and command file, and exits `0` on `Validation passed`. Add `--strict` to fail on warnings too. Exit codes and directory handling are on the [plugin commands reference](</docs/en/plugins/cli-reference#plugin-validate>). + 2. In the running session, run `/reload-plugins` to apply edits you made on disk. It prints one `Reloaded:` line with counts. Then confirm a skill loaded by typing its `/plugin-name:skill` command, or by finding the plugin in the `/plugin` **Installed** tab. + 3. In the same session, run `/plugin`. The **Installed** tab lists your plugin and, in the plugin’s details, the components Claude Code found. The **Errors** tab lists what failed to load and why, such as a path in your manifest that doesn’t exist. + 4. Back in your shell, run `claude plugin list`. It prints session-only and skills-directory plugins in their own sections with `Status: ✔ loaded` or the load error. To include the plugin you’re developing, pass `--plugin-dir` with its path before `plugin list`. + +To check an MCP server, run `/mcp` in the session to see the server’s status. When the server is healthy, `/mcp` lists it as connected. If it isn’t, see [MCP servers that don’t start](</docs/en/plugins/troubleshooting#invalid-mcp-server-config-for-and-mcp-servers-that-dont-start>). To check a hook, trigger the event it matches. For example, ask Claude to edit a file to trigger a `PostToolUse` hook. Then read the [debug log](</docs/en/hooks#debug-hooks>), which shows which hooks matched, their exit codes, and their output. The next sections cover the failures you’re most likely to hit while developing, and the [troubleshooting page](</docs/en/plugins/troubleshooting#build-a-plugin>) has the full entry for each. + +### + +​ + +A component path isn’t found + +The **Errors** tab of `/plugin` shows `<component> path not found: <path>`, for example `commands path not found`. A component path in your manifest, such as `commands`, `skills`, `agents`, or `hooks`, points at nothing. Fix the path or create the directory, then run `/reload-plugins` in the session. See [`commands path not found`](</docs/en/plugins/troubleshooting#commands-path-not-found>). + +### + +​ + +`--plugin-dir` at a marketplace root doesn’t load the plugins under `plugins/` + +`--plugin-dir` takes the plugin’s root directory, the one that contains `.claude-plugin/plugin.json` and the component directories such as `skills/`. If you point it at a marketplace root instead, Claude Code doesn’t read `marketplace.json`, so a plugin under `plugins/` doesn’t load, and you see no error. Point the flag at one plugin’s folder, or add the marketplace. See [the troubleshooting entry](</docs/en/plugins/troubleshooting#plugin-dir-loads-a-plugin-with-no-components>). + +### + +​ + +The plugin loads but its skills are missing + +The `skills/` directory is inside `.claude-plugin/`, or a `skills` entry in the manifest points at a file. Move `skills/` to the plugin root, point each `skills` entry at a directory that contains `SKILL.md`, and run `/reload-plugins` in the session. See [Plugin loads but its skills are missing](</docs/en/plugins/troubleshooting#plugin-loads-but-its-skills-are-missing>). + +### + +​ + +The `userConfig` dialog never appears + +The dialog for your plugin’s [`userConfig`](</docs/en/plugins/components#user-configuration>) options is part of installing through `/plugin` in a session. Loading with `--plugin-dir` doesn’t show it, and neither does `claude plugin install` in the shell. With the plugin loaded, run `/plugin configure <plugin-name>` in the session to open it. See [The `userConfig` dialog never appears](</docs/en/plugins/troubleshooting#the-userconfig-dialog-never-appears>). + +### + +​ + +Check that the plugin changes Claude’s behavior + +A plugin that loads without errors can still fail to steer Claude the way you intend. `claude plugin eval`, which you run in your shell, runs your test cases with and without the plugin and scores the difference. See [Test plugins with evals](</docs/en/plugin-evals>), starting with [Create your first eval suite](</docs/en/plugin-evals#create-your-first-eval-suite>). + +## + +​ + +Convert an existing `.claude/` setup + +If you already have skills, agents, or hooks under a project’s `.claude/` directory, you can move them into a plugin without rewriting them. Run the commands in these steps from the project root, which is the directory that contains `.claude/`, because the `cp` paths are relative to it. + +1 + +Create the plugin structure + +Create the plugin directory and its `.claude-plugin/` folder alongside `.claude/`. You can move the plugin anywhere afterwards. + + mkdir -p my-plugin/.claude-plugin + +Create `my-plugin/.claude-plugin/plugin.json`: + +my-plugin/.claude-plugin/plugin.json + + { + "name": "my-plugin", + "description": "Migrated from standalone configuration", + "version": "1.0.0" + } + +2 + +Copy your existing files + +Copy each configuration directory you have to the plugin root, and skip the command for any directory you don’t have. + + cp -r .claude/commands my-plugin/ + + cp -r .claude/agents my-plugin/ + + cp -r .claude/skills my-plugin/ + +Run `ls -a my-plugin` to confirm that each directory you copied appears next to `.claude-plugin`. + +3 + +Move your hooks + +If you have hooks in `.claude/settings.json` or `.claude/settings.local.json`, create a hooks directory: + + mkdir -p my-plugin/hooks + +Create `my-plugin/hooks/hooks.json` and copy the `hooks` object from your settings file into it. The format is the same.This example shows the shape with one hook that runs a linter on each file Claude writes or edits. Replace the example with your own `hooks` object. + +my-plugin/hooks/hooks.json + + { + "hooks": { + "PostToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [{ "type": "command", "command": "jq -r '.tool_input.file_path' | xargs npm run lint:fix" }] + } + ] + } + } + +4 + +Test the migrated plugin + +Load the plugin for a session: + + claude --plugin-dir ./my-plugin + +Check each component under its new name: + + * **Skills** : run `/my-plugin:deploy` for a skill that was `/deploy`. + * **Subagents** : ask Claude to use the `my-plugin:reviewer` agent for an agent that was `reviewer`. + * **Hooks** : trigger the event each hook matches. + +If something is missing, work through Test and debug. + +While the originals are still under `.claude/`, they stay loaded alongside the plugin’s copies: + + * **Skills and agents** : the two sets don’t collide, because the plugin’s skills and agents carry the `my-plugin:` prefix. `/deploy` and `/my-plugin:deploy` both work, and Claude sees `reviewer` and `my-plugin:reviewer` as two subagents. + * **Hooks** : hooks have no prefix, so a hook that is in both your settings file and `hooks/hooks.json` runs twice each time its event fires. + +After you’ve confirmed the plugin works, delete the originals from `.claude/` and remove the `hooks` object from your settings file. + +## + +​ + +Next steps + + * [Plugin components](</docs/en/plugins/components>): add agents, hooks, MCP servers, LSP servers, and user configuration to your plugin + * [Test plugins with evals](</docs/en/plugin-evals>): write eval cases and run them with `claude plugin eval` to check how reliably the plugin guides Claude’s behavior + * [Publish a plugin](</docs/en/plugins/publish>): version it, put it in a marketplace, and submit it to the community marketplace + * [Plugins on claude.ai and in Cowork](<https://claude.com/docs/plugins/overview>): the same plugin folder installs on claude.ai and in Cowork. Some components are Claude Code-only + * [Plugin manifest reference](</docs/en/plugins/manifest-reference>): every `plugin.json` field, path rule, and directory + * [Skills](</docs/en/skills>): write the skills your plugin provides + * [Anthropic’s plugins in the claude-code repository](<https://github.com/anthropics/claude-code/tree/main/plugins>): complete worked examples of the layout on this page, such as `feature-dev` and `code-review`
added Create a marketplace View current →
Show diff (238 lines)
--- a/create-marketplace.md +++ b/create-marketplace.md @@ -0,0 +1,235 @@ +A plugin marketplace is a directory or repository with a `.claude-plugin/marketplace.json` file that lists your plugins and where to fetch each one. You push the directory to a git host, and anyone with access registers it in Claude Code with one command and installs your plugins from it. Create your own marketplace when you want a group you choose, such as your team or your organization, to install your plugins and keep receiving your updates from a catalog you control. The repository can be private, it can list as many plugins as you like, and an administrator can [require it on every machine](</docs/en/plugins/org>). + +These cases are covered on other pages: + + * **Sharing one plugin with a few people** : send them the plugin’s directory or a `.zip` of it. See [Share a plugin without a marketplace](</docs/en/plugins/publish#share-a-plugin-without-a-marketplace>). + * **Offering a plugin to everyone** : submit it to Anthropic’s community marketplace. See [Submit to the community marketplace](</docs/en/plugins/publish#submit-to-the-community-marketplace>). + * **Using a plugin yourself** : load it with `--plugin-dir` or save it in your skills directory. See [Develop without a marketplace](</docs/en/plugins/create#develop-without-a-marketplace>). + +Start with Create a marketplace to build one on your own machine and install a plugin from it, then add more plugin entries. + +## + +​ + +Create a marketplace + +The following steps create a marketplace on your machine, add a plugin to it, register it in Claude Code, and install the plugin from it. That is the whole loop, and it’s the same loop your users go through once you host the marketplace somewhere they can reach. Run every command in your shell, from the directory where you want `my-marketplace/` created. You need a plugin to list. The example uses `my-first-plugin` from [Create your first plugin](</docs/en/plugins/create#create-your-first-plugin>), a plugin with one skill that you run as `/my-first-plugin:hello`; build it first if you don’t have a plugin yet. To use a plugin of your own instead, substitute its directory and its `name` wherever the steps say `my-first-plugin`. For what a plugin directory can contain, see the [plugin directory explorer](</docs/en/plugins/components#explore-the-plugin-directory>). + +1 + +Set up the marketplace directory + +A marketplace is a directory with a `.claude-plugin/marketplace.json` file, plus the plugins it lists. Create the marketplace directory and its `.claude-plugin/` folder, then copy your plugin in under `plugins/`: + + mkdir -p my-marketplace/.claude-plugin my-marketplace/plugins + cp -r my-first-plugin my-marketplace/plugins/ + +Check that the plugin is valid where it now sits, so that any later error is about the marketplace and not the plugin: + + claude plugin validate ./my-marketplace/plugins/my-first-plugin + +The last line of the output reads `✔ Validation passed`. + +2 + +Create the marketplace file + +Save `marketplace.json` at `my-marketplace/.claude-plugin/marketplace.json`. The file requires a `name`, an `owner`, and a `plugins` array.Each object in `plugins` is a plugin entry and needs a `name` and a `source`. Write the entry’s `source` as a path from the marketplace root. The root is `my-marketplace/`, the directory that contains `.claude-plugin/`. + +my-marketplace/.claude-plugin/marketplace.json + + { + "name": "my-marketplace", + "description": "Plugins for my team", + "owner": { + "name": "Your Name" + }, + "plugins": [ + { + "name": "my-first-plugin", + "source": "./plugins/my-first-plugin", + "description": "A greeting plugin to learn the basics" + } + ] + } + +3 + +Validate the marketplace + +Run `claude plugin validate` on the marketplace directory to check the JSON syntax, the required fields, and each plugin entry in its `.claude-plugin/marketplace.json`. + + claude plugin validate ./my-marketplace + +For the file as written in step 2, the last line of the output reads `✔ Validation passed`. + +4 + +Add the marketplace and install the plugin + +Register the directory as a marketplace. + + claude plugin marketplace add ./my-marketplace + +The command prints `✔ Successfully added marketplace: my-marketplace (declared in user settings)`, which means the marketplace is recorded in your user settings file.Install the plugin. The install id is the entry’s `name`, an `@`, and the marketplace `name`. + + claude plugin install my-first-plugin@my-marketplace + +The command prints `✔ Successfully installed plugin: my-first-plugin@my-marketplace (scope: user)`.Inside a session, `/plugin marketplace add ./my-marketplace` registers the marketplace the same way. `/plugin install my-first-plugin@my-marketplace` opens the plugin’s details in the `/plugin` panel, where you install it. For that flow, see [Install and manage plugins](</docs/en/plugins/install>). + +5 + +Confirm the plugin loaded + +List installed plugins. + + claude plugin list + +The output lists `my-first-plugin@my-marketplace` with `Status: ✔ enabled`.To see what the plugin loaded, show its details. + + claude plugin details my-first-plugin + +The `Component inventory` section reads `Skills (1) hello`.To run the skill, start a session and enter `/my-first-plugin:hello`. Claude greets you. The command has the plugin’s name as a prefix, as every plugin skill’s name does. + +## + +​ + +Add plugin entries + +Every plugin you distribute is one object in the `plugins` array of `marketplace.json`. To add a second plugin, add a second object. These fields cover most entries: + + * `name`: the identifier people type before `@` when they install. It can’t contain spaces. + * `source`: where Claude Code fetches the plugin from. Write a relative path string for a plugin inside the marketplace directory, as in the walkthrough, or a source object for a plugin outside it. See Choose a plugin source. + * `description`: the line people see next to the plugin when they browse your marketplace in `/plugin`. + +For the full field list, see [Plugin entries](</docs/en/plugins/marketplace-reference#plugin-entries>). An entry can also set any [`plugin.json`](</docs/en/plugins/manifest-reference>) field. For when an entry’s `plugin.json` fields apply to a plugin that has its own `plugin.json`, see [Entry and plugin.json](</docs/en/plugins/marketplace-reference#entry-and-plugin-json>). + +## + +​ + +Rules for plugin entries + +Most failed installs from a new marketplace come from a relative path written from the wrong directory, or from an entry name that differs from the `name` in the plugin’s `plugin.json`. + +### + +​ + +Write relative paths from the marketplace root + +The marketplace root is the directory that contains `.claude-plugin/`. In the walkthrough, that’s `my-marketplace/`, so the entry’s `source` is `"./plugins/my-first-plugin"`. The path doesn’t start inside `.claude-plugin/`, so don’t use `..` to leave it. A path with `..` and a path to a missing directory fail at different commands: + + * **A path with`..`**: `claude plugin validate` reports the entry as invalid. The message begins `Path contains "..": ./../plugins/my-first-plugin`. + * **A path to a directory that doesn’t exist** : `claude plugin validate` passes. `claude plugin install` fails with `Source path does not exist: <path>`, and `<path>` is the absolute location Claude Code checked. + +### + +​ + +Keep the entry name and the manifest name the same + +A marketplace plugin has an entry `name` in `marketplace.json` and a `name` in its own `plugin.json`, called the manifest name. Each name appears in different places: + + * **Entry name** : the install id, `<entry-name>@<marketplace>`. It’s what people type to install, what `claude plugin list` shows, and the key Claude Code writes under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>) in their settings file. + * **Manifest name** : the prefix on the plugin’s skills, and the name `claude plugin details` takes. + +When the two names differ and someone installs by the manifest name, Claude Code reports `Plugin "<manifest-name>" not found in marketplace "<marketplace>"`. Keep the two names the same. For more on how Claude Code uses the two names, see [Plugin loading reference](</docs/en/plugins/loading#find-where-a-plugin-came-from>). + +## + +​ + +Choose a plugin source + +Each plugin entry in `marketplace.json` has a `source` that tells Claude Code where to fetch that one plugin. Pick the source by where the plugin’s files are stored. The table lists the sources most marketplace owners use. + +Source| Use it when| Minimal `source` value +---|---|--- +Relative path| The plugin’s files are inside the marketplace directory itself| `"./plugins/my-first-plugin"` +`github`| The plugin is a GitHub repository of its own| `{ "source": "github", "repo": "your-org/my-first-plugin" }` +`git-subdir`| The plugin is a subdirectory of some other repository, such as a monorepo| `{ "source": "git-subdir", "url": "your-org/monorepo", "path": "tools/my-first-plugin" }` + +In a `git-subdir` source, `url` takes a git URL or an `owner/repo` GitHub shorthand. A plugin can also come from one of these source types: + + * `url`: a git repository by URL, on any host + * `archive`: a zip file downloaded over HTTPS + * `npm`: an npm package + * `command`: a directory produced by running a command on the machine where the plugin is installed + +For the fields of every source type, and for pinning a git-based source to a `ref` or `sha`, see [Plugin sources](</docs/en/plugins/marketplace-reference#plugin-sources>). + +## + +​ + +Validate and test + +As you add plugins, run `claude plugin validate ./my-marketplace` in your shell after every edit, and install from the marketplace on your own machine before you share it. Validation and installation catch different problems. + +### + +​ + +Problems that validation reports + +`claude plugin validate` reads only files inside the marketplace directory. It reports: + + * JSON syntax errors, as `json: Invalid JSON syntax: <reason>` + * Missing required fields, such as `owner: Invalid input` + * A marketplace name with spaces, non-ASCII characters, or a form that imitates an official Anthropic marketplace, such as `claude-official` + * A relative `source` that contains `..` + * Unknown fields at the top level or in a plugin entry, as warnings + * Problems in the `plugin.json` of each relative-path plugin, as `plugins[N] plugin.json → <field>: <message>` + +For every message `validate` can print, see [Validation messages](</docs/en/plugins/marketplace-reference#validation-messages>). For its flags and exit codes, see [`plugin validate`](</docs/en/plugins/cli-reference#plugin-validate>). + +### + +​ + +Problems that surface when you add or install + +Problems that `claude plugin validate` doesn’t report appear when you add the marketplace or install from it: + + * **When you add the marketplace** : the exact [official marketplace names](</docs/en/plugins/marketplace-reference#reserved-names>), such as `claude-plugins-official`, pass validation. When you add a marketplace with one of those names, Claude Code refuses it with a message that starts `The name '<name>' is reserved for official Anthropic marketplaces`. + * **When you install a plugin** : + * Claude Code first fetches a `github`, `git-subdir`, or other remote source when you install the plugin, so a wrong `repo` or `path` appears then. + * A relative `source` whose directory doesn’t exist also fails at install, with `Source path does not exist: <path>`. + +### + +​ + +Test an edit to a plugin + +In the walkthrough, you added `my-marketplace` from a local directory with a relative-path `source`. With that setup, Claude Code reads the plugin’s files directly from `my-marketplace/plugins/`. Your edits take effect at the next session start or when you run `/reload-plugins` in a session, with no change to the plugin’s `version`. People who install from your hosted marketplace get a copy in the plugin cache instead. For how they receive a new version, see [Keep users up to date](</docs/en/plugins/host-marketplace#keep-users-up-to-date>). + +### + +​ + +Remove the marketplace to start over + +To remove everything and start over, run `claude plugin marketplace remove my-marketplace` in your shell. The command removes the marketplace and uninstalls its plugins. + +## + +​ + +Host your marketplace + +Once you can install a plugin from the marketplace on your own machine, as in Create a marketplace, push the marketplace directory to a git host. Your teammates then run `claude plugin marketplace add <owner>/<repo>` in their shell for a GitHub repository, or the same command with the repository URL. They then install a plugin by name as in the walkthrough. For private-repository access, updates, versioning, and renaming or removing entries, see [Host and maintain a marketplace](</docs/en/plugins/host-marketplace>). + +## + +​ + +Next steps + + * [Host and maintain a marketplace](</docs/en/plugins/host-marketplace>): pick a host, keep users up to date, and rename or remove plugins safely + * [Marketplace reference](</docs/en/plugins/marketplace-reference>): `marketplace.json` fields and source types + * [Manage plugins for your organization](</docs/en/plugins/org>): require your marketplace and its plugins on every machine + * [Suggest plugins by relevance](</docs/en/plugins/relevance>): have Claude Code suggest a plugin from your marketplace when a session matches
modified Debug your configuration View current →
--- a/debug-your-config.md +++ b/debug-your-config.md @@ -89,7 +89,7 @@ Hook never fires| `matcher` is a JSON array instead of a string| Use a single string with `|` to match multiple tools, for example `"Edit|Write"`. See [matcher patterns](</docs/en/hooks#matcher-patterns>). Hook never fires| `matcher` uses `,` as a separator on a version before v2.1.191| Claude Code v2.1.191 or later treats `,` as a list separator like `|`. Earlier versions evaluate a comma as a literal character, so `"Edit,Write"` matches nothing. Use `|` instead, or upgrade Claude Code. Hook never fires| `matcher` value is lowercase, for example `"bash"`| Matching is case-sensitive. Tool names are capitalized: `Bash`, `Edit`, `Write`, `Read`. -Hook never fires| Hooks are defined in a standalone file instead of `settings.json`| There is no standalone hooks file for project or user config. Define hooks under the `"hooks"` key in `settings.json`. Only [plugins](</docs/en/plugins-reference#hooks>) load a separate `hooks/hooks.json`. See [hook configuration](</docs/en/hooks>). +Hook never fires| Hooks are defined in a standalone file instead of `settings.json`| There is no standalone hooks file for project or user config. Define hooks under the `"hooks"` key in `settings.json`. Only [plugins](</docs/en/plugins/components#hooks>) load a separate `hooks/hooks.json`. See [hook configuration](</docs/en/hooks>). Permissions, hooks, or env set globally are ignored| Configuration was added to `~/.claude.json`| `~/.claude.json` holds app state and UI toggles. `permissions`, `hooks`, and `env` belong in `~/.claude/settings.json`. These are two different files. A `settings.json` value seems ignored| The same key is set in `settings.local.json`| `settings.local.json` overrides `settings.json`, and both override `~/.claude/settings.json`. See [settings precedence](</docs/en/settings#settings-precedence>). Skill doesn’t appear in `/skills`| Skill file is at `.claude/skills/name.md` instead of in a folder| Use a folder with `SKILL.md` inside: `.claude/skills/name/SKILL.md`.
added Plugin dependencies View current →
Show diff (224 lines)
--- a/dependencies.md +++ b/dependencies.md @@ -0,0 +1,221 @@ +A plugin dependency is another plugin that your plugin relies on, such as one whose MCP server or skill it calls. Each dependency tracks the latest version its marketplace provides unless you declare a version constraint, a semantic-version range such as `^2.0` or `~2.1.0` that you’ve tested against. This page is for plugin authors who declare dependencies in `plugin.json` and for marketplace maintainers who tag releases. + +These cases are covered on other pages: + + * **Installing a plugin that has dependencies** : see [Manage installed plugins](</docs/en/plugins/install#manage-installed-plugins>) + * **Reading a dependency error** : see [Dependency errors](</docs/en/plugins/troubleshooting#dependency-errors>) + * **Declaring the npm and Bun packages that your plugin’s own code needs** : see [Node.js package dependencies](</docs/en/plugins/loading#node-js-package-dependencies>) + +To add a constraint, start at Declare a dependency with a version constraint. If you maintain a plugin that others depend on, tag your releases so their constraints can resolve. + +## + +​ + +Declare dependencies + +Without a version constraint, a dependency moves to each new release its marketplace publishes the next time users update. If that release renames an MCP tool your plugin calls, your plugin breaks for everyone who updates. With a constraint such as `~2.1.0` on a dependency from a git-backed source, users who have your plugin installed keep receiving `2.1.x` patches of the dependency and never move to `2.2`. To upgrade on your own schedule, test against a newer release and then publish a new version of your plugin with a wider constraint. + +### + +​ + +Declare a dependency with a version constraint + +List dependencies in the `dependencies` array of your plugin’s `.claude-plugin/plugin.json`. The following manifest declares one unversioned dependency and one constrained dependency: + +.claude-plugin/plugin.json + + { + "name": "deploy-kit", + "version": "3.1.0", + "dependencies": [ + "audit-logger", + { "name": "secrets-vault", "version": "~2.1.0" } + ] + } + +An entry can be a string: the plugin name alone, such as `"audit-logger"` in this manifest, or `"name@marketplace"` to resolve it in another marketplace. With a bare string, your plugin depends on whatever version that plugin’s marketplace provides. To set a version constraint, use an object with these fields, each a string: + +Field| Description +---|--- +`name`| The dependency’s plugin name, as it appears in its marketplace entry. Claude Code looks it up in the same marketplace as the declaring plugin unless you set `marketplace`. Required. +`version`| A [semantic-version range](<https://github.com/npm/node-semver#ranges>) such as `~2.1.0`, `^2.0`, `>=1.4`, or `=2.1.0`. The dependency installs at the highest git tag that satisfies this range, so the dependency’s maintainer must tag releases. +`marketplace`| A different marketplace to resolve `name` in. An allowlist controls cross-marketplace dependencies, described in Depend on a plugin from another marketplace. + +A range doesn’t match pre-release versions such as `2.0.0-beta.1` unless you opt in with a pre-release suffix such as `^2.0.0-0`. + +### + +​ + +Bundle plugins for a team + +To let engineers install a curated set of plugins with one command, publish a plugin whose manifest contains a `name` and a `dependencies` array. A plugin manifest needs only `name`, so this is a valid plugin, and installing it installs every dependency. For example, a platform team can publish role-specific bundles in an internal marketplace so engineers run one `claude plugin install` instead of installing each plugin separately: + +.claude-plugin/plugin.json + + { + "name": "backend-standard", + "version": "1.0.0", + "description": "Standard plugin set for backend engineers", + "dependencies": [ + "secrets-vault", + "deploy-kit", + { "name": "db-migrate", "version": "^3.0" }, + "oncall-runbook" + ] + } + +To add a plugin to the standard set later, publish a new `backend-standard` version with the extra dependency. When the marketplace doesn’t [auto-update by default](</docs/en/plugins/loading#which-marketplaces-and-plugins-auto-update>), engineers either turn on auto-update for the marketplace or update manually: + + * **Turn on auto-update for the marketplace** : the next auto-update moves the bundle to the new version and installs any dependencies it adds. + * **Update manually** : run `claude plugin update backend-standard` in a shell, then `/reload-plugins` in an open session to install the newly added dependencies. + +For the engineer-side steps, see [Keep plugins updated](</docs/en/plugins/install#keep-plugins-updated>). To deploy a bundle to everyone in an organization, an administrator adds it to `enabledPlugins` in managed settings. See [Pre-install and require plugins](</docs/en/plugins/org#pre-install-and-require-plugins>). + +### + +​ + +Depend on a plugin from another marketplace + +By default, Claude Code doesn’t install a dependency from a different marketplace than the declaring plugin’s own, unless the user already has that dependency installed and enabled at the same scope. This default prevents one marketplace from silently installing plugins from a source the user hasn’t reviewed. To allow the install, add the target marketplace’s name to `allowCrossMarketplaceDependenciesOn` in the root marketplace’s `marketplace.json`. The root marketplace is the one that hosts the plugin the user is installing. Only the root marketplace’s allowlist applies. The following `marketplace.json` allows `deploy-kit` to depend on a plugin from `your-shared-marketplace`: + +.claude-plugin/marketplace.json + + { + "name": "your-marketplace", + "owner": { "name": "Your Org" }, + "allowCrossMarketplaceDependenciesOn": ["your-shared-marketplace"], + "plugins": [ + { + "name": "deploy-kit", + "source": "./deploy-kit", + "dependencies": [ + { "name": "audit-logger", "marketplace": "your-shared-marketplace" } + ] + } + ] + } + +If `allowCrossMarketplaceDependenciesOn` is missing or doesn’t include the target marketplace, Claude Code doesn’t install the dependency. When the dependency is declared in the marketplace entry, the install itself is refused with a message that starts `Dependency "audit-logger@your-shared-marketplace" (required by deploy-kit@your-marketplace) is in marketplace "your-shared-marketplace", which is not in the allowlist` and names the field to set. When it’s declared in `plugin.json`, the install completes without the dependency and your plugin then fails to load. The allowlist check doesn’t apply to a dependency that is already enabled. If a user installs `audit-logger` from `your-shared-marketplace` themselves first, at the same scope, `deploy-kit` then installs without any change to the allowlist. + +### + +​ + +Test a plugin and its dependency locally + +If you’re developing a plugin and the plugin it depends on at the same time, start Claude Code from your shell and load both with [`--plugin-dir`](</docs/en/plugins/cli-reference#flags-that-load-a-plugin-for-one-session>): + + claude --plugin-dir ./my-dependency --plugin-dir ./my-plugin + +The local copy of the dependency satisfies your plugin’s dependency entry, so you don’t need to install the dependency from its marketplace. + + * **No`version` needed**: the local `plugin.json` doesn’t need a `version` either, because a version constraint isn’t checked against a local copy. + * **Entries that name a marketplace** : an entry that names a marketplace also matches the local copy on Claude Code v2.1.242 or later. + +Until you install the dependency from its marketplace, your plugin stops loading whenever the local copy is disabled or absent: + + * **You disabled the local copy** : your plugin is disabled at the next plugin load, with an error that ends `is disabled — enable it or remove the dependency`. When the error names the dependency as `<name>@inline`, that identifier refers to the `--plugin-dir` copy. + * **You started a session without the dependency’s`--plugin-dir` flag**: the error reports the dependency as not installed. Pass the flag again, or install the dependency from its marketplace. + +When both plugins are in one parent folder, you can pass that folder to `--plugin-dir` once. If the folder isn’t itself a plugin, Claude Code loads each child folder that has a `.claude-plugin/plugin.json`. Requires Claude Code v2.1.265 or later. + +## + +​ + +Release a plugin that others depend on + +If you maintain a plugin that other plugins depend on with a version constraint, tag its releases so those constraints can resolve. A constraint resolves against git tags on the repository that hosts the plugin. Tag the repository that the plugin’s [plugin source](</docs/en/plugins/marketplace-reference#plugin-sources>) in `marketplace.json` points at: + + * **`github`, `url`, or `git-subdir` source**: the plugin’s own repository, so the plugin’s author creates the tags + * **Relative path such as`./plugins/secrets-vault`**: the marketplace repository, so the marketplace maintainer creates the tags + +### + +​ + +Create a release tag + +Tag each release as `<plugin-name>--v<version>`, where `<version>` matches the `version` field in that commit’s `plugin.json`. The plugin-name prefix lets one marketplace repository host several plugins with independent version histories. Create the tag from the plugin directory, with an `origin` remote configured to receive the pushed tag, using [`claude plugin tag`](</docs/en/plugins/cli-reference#plugin-tag>): + + claude plugin tag --push + +The command builds the tag name from the plugin’s manifest. Before creating the tag, it runs these checks: + + * Validates the plugin + * Checks that `plugin.json` and the marketplace entry agree on the version, when the plugin directory is inside a marketplace checkout + * Requires a clean working tree under the plugin directory + * Refuses if the tag already exists + +A successful run prints `Created tag secrets-vault--v2.1.0`. With `--push`, it also prints `Pushed to origin`. Without `--push`, it prints the `git push` command to run yourself. Pass `--dry-run` to see the plan without creating anything. The [`claude plugin tag` reference](</docs/en/plugins/cli-reference#plugin-tag>) lists the remaining flags. You can also run `git tag secrets-vault--v2.1.0` directly, as long as you keep the `version` in `plugin.json` and in the marketplace entry in sync yourself. + +### + +​ + +Constrain a dependency that has a non-git source + +Tag-based resolution applies only to git-backed sources. For a dependency with an `npm`, `archive`, or `command` [plugin source](</docs/en/plugins/marketplace-reference#plugin-sources>), the constraint doesn’t control which version is fetched. It’s still checked when the plugin loads, and the dependent plugin is disabled if the installed version doesn’t satisfy it. For `npm`, `archive`, and `command` sources, the version checked is the `version` in the dependency’s `plugin.json`. Set one there before you constrain that dependency, because a `plugin.json` that sets no version satisfies no constraint. Claude Code never installs a dependency with a `command` source itself, so users [install it first](</docs/en/plugins/marketplace-reference#command-plugin-source>). It also never runs a dependency’s [`headersHelper`](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>), so users also install a dependency whose marketplace entry sets one before they install your plugin. Besides `claude plugin install`, these operations also install any missing declared dependency, and the `command` and `headersHelper` limits apply to them too: + + * `/reload-plugins` + * Auto-update of the dependent plugin’s marketplace + * Re-running `claude plugin install` on the dependent plugin + * `claude plugin marketplace add` + +## + +​ + +How dependencies behave for your users + +These sections describe how Claude Code resolves, checks, and combines the constraints you declare once your plugin is installed alongside others. + +### + +​ + +How a constraint resolves against tags + +When a user installs a plugin that declares `{ "name": "secrets-vault", "version": "~2.1.0" }`, the dependency installs from the highest `secrets-vault--v` tag that satisfies `~2.1.0` on the repository that hosts `secrets-vault`. When no tag satisfies the range, the install either fails or uses the marketplace’s current copy: + + * **Plugin with its own repository** : the install fails with a message containing `Dependency "secrets-vault@your-marketplace" has no git tag satisfying`. + * **Plugin referenced by a relative path** : the install uses the marketplace’s current copy instead, and the constraint is checked when the plugin loads. If that copy is outside the range, the dependent plugin stays disabled and `claude plugin list` shows `Requires "secrets-vault@your-marketplace" ~2.1.0, installed 3.0.0`. + +For a plugin the marketplace references by a relative path, a marketplace you added as a local folder path also resolves constraints against that folder’s git tags, when the folder is a git repository. This requires Claude Code v2.1.196 or later. A local folder that isn’t a git repository has no tags, so Claude Code installs the dependency from the folder’s current contents instead. + +### + +​ + +Confirm the resolved version + +To confirm which version a constraint resolved to, run `claude plugin list` in your shell. A tag-resolved dependency shows its version with a 12-character commit suffix, such as `2.1.0-8713c5b11005`. Constraint checks use the tag’s version rather than the `version` in `plugin.json`, even if `plugin.json` at that commit lags behind. If you force-move a tag to a different commit, the next install fetches that commit’s content instead of reusing a stale cached copy. See [Versions and updates](</docs/en/plugins/loading#versions-and-updates>) for how a plugin’s version becomes its cache key. + +### + +​ + +Combine constraints from several plugins + +When several installed plugins constrain the same dependency, the dependency resolves to the highest version that satisfies all of their ranges. Common combinations resolve like this: + +Plugin A requires| Plugin B requires| Result +---|---|--- +`^2.0`| `>=2.1`| One install at the highest `2.x` tag at or above `2.1.0`. Both plugins load. +`~2.1`| `~3.0`| Installing plugin B fails with a `has conflicting version requirements` message. Plugin A and the dependency stay as they were. +`=2.1.0`| none| The dependency stays at `2.1.0`. Auto-update skips newer versions while plugin A is installed. + +Auto-update fetches a constrained dependency at the highest git tag that satisfies every installed plugin’s range, rather than at the marketplace’s latest version. If the installed plugins’ ranges don’t overlap, auto-update leaves that dependency at its current version, and the `/plugin` **Errors** tab shows an entry naming the constraining plugin. If they overlap but no tag falls in the range, auto-update fetches the marketplace’s current copy and skips the update when that copy’s `version` falls outside any installed plugin’s range. When a user uninstalls the last plugin that constrains a dependency, the dependency is no longer constrained to a version range and resumes tracking its marketplace entry on the next update. + +## + +​ + +See also + + * [`claude plugin prune`](</docs/en/plugins/cli-reference#plugin-prune>): remove auto-installed dependencies no plugin needs anymore + * [Host a marketplace](</docs/en/plugins/host-marketplace>): release channels and recommending other plugins
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -434,7 +434,7 @@ Extend Claude Code -Connect external services, add reusable workflows, customize Claude’s behavior, and configure preview servers. To manage connectors, skills, and plugins in one place, click **Customize** in the sidebar. The [Cowork](<https://claude.com/product/cowork>) tab in the Desktop app sources its skills, plugins, and connectors from this Customize configuration, which syncs through your claude.ai account, not from the CLI’s `~/.claude` directory. Claude Code also loads the skills and plugins enabled for your claude.ai account in terminal sessions where you sign in with the same account. See [Skills synced from claude.ai](</docs/en/skills#how-synced-skills-behave>) and [Plugins synced from claude.ai](</docs/en/plugins-reference#synced-plugins>). +Connect external services, add reusable workflows, customize Claude’s behavior, and configure preview servers. To manage connectors, skills, and plugins in one place, click **Customize** in the sidebar. The [Cowork](<https://claude.com/product/cowork>) tab in the Desktop app sources its skills, plugins, and connectors from this Customize configuration, which syncs through your claude.ai account, not from the CLI’s `~/.claude` directory. Claude Code also loads the skills and plugins enabled for your claude.ai account in terminal sessions where you sign in with the same account. See [Skills synced from claude.ai](</docs/en/skills#how-synced-skills-behave>) and [Plugins synced from claude.ai](</docs/en/plugins/loading#synced-plugins>). ### @@ -450,7 +450,7 @@ Use skills -[Skills](</docs/en/skills>) extend what Claude can do. Claude loads them automatically when relevant, or you can invoke one directly: type `/` in the prompt box or click the **+** button and select **Slash commands** to browse what’s available. This includes [built-in commands](</docs/en/commands>), your [custom skills](</docs/en/skills#create-your-first-skill>), project skills from your codebase, and skills from any [installed plugins](</docs/en/plugins>). Select one and it appears highlighted in the input field. Type your task after it and send as usual. You can send a command while Claude is working, the same as any other message, and the session returns to idle once the turn finishes. Before v2.1.206, a command sent mid-turn could leave the session showing as running and messages you sent afterward weren’t delivered. Local sessions load your personal skills from `~/.claude/skills/`. An SSH session reads `~/.claude/skills/` from the remote host’s home directory, not from your machine. Local and cloud sessions also load the skills enabled for your claude.ai account. Cloud sessions load them instead of `~/.claude/skills/`, as [Skills in Cowork and cloud sessions](</docs/en/skills#skills-in-cowork-and-cloud-sessions>) describes. +[Skills](</docs/en/skills>) extend what Claude can do. Claude loads them automatically when relevant, or you can invoke one directly: type `/` in the prompt box or click the **+** button and select **Slash commands** to browse what’s available. This includes [built-in commands](</docs/en/commands>), your [custom skills](</docs/en/skills#create-your-first-skill>), project skills from your codebase, and skills from any [installed plugins](</docs/en/plugins/install>). Select one and it appears highlighted in the input field. Type your task after it and send as usual. You can send a command while Claude is working, the same as any other message, and the session returns to idle once the turn finishes. Before v2.1.206, a command sent mid-turn could leave the session showing as running and messages you sent afterward weren’t delivered. Local sessions load your personal skills from `~/.claude/skills/`. An SSH session reads `~/.claude/skills/` from the remote host’s home directory, not from your machine. Local and cloud sessions also load the skills enabled for your claude.ai account. Cloud sessions load them instead of `~/.claude/skills/`, as [Skills in Cowork and cloud sessions](</docs/en/skills#skills-in-cowork-and-cloud-sessions>) describes. ### @@ -458,7 +458,7 @@ Install plugins -[Plugins](</docs/en/plugins>) are reusable packages that add skills, agents, hooks, MCP servers, and LSP configurations to Claude Code. You can install plugins from the desktop app without using the terminal. For local and SSH sessions, click the **+** button next to the prompt box and select **Plugins** to see your installed plugins and their skills. To add a plugin, select **Add plugin** from the submenu to open the plugin browser, which shows available plugins from your configured [marketplaces](</docs/en/plugin-marketplaces>) including the official Anthropic marketplace. Select **Manage plugins** to enable, disable, or uninstall plugins. You can scope plugins to your user account, a specific project, or local-only. If your organization manages plugins centrally, those plugins are available in desktop sessions the same way they are in the CLI. The plugin browser is not available in cloud sessions, and plugins you install from the desktop app aren’t available for cloud sessions. A cloud session also doesn’t install plugins that the repository’s `.claude/settings.json` declares, as [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>) explains. To use a plugin in a cloud session, enable it for your claude.ai account so Claude Code loads it as a [synced plugin](</docs/en/plugins-reference#synced-plugins>). Plugins aren’t available in WSL sessions. For the full plugin reference including creating your own plugins, see [plugins](</docs/en/plugins>). +[Plugins](</docs/en/plugins/overview>) are reusable packages that add skills, agents, hooks, MCP servers, and LSP configurations to Claude Code. You can install plugins from the desktop app without using the terminal. For local and SSH sessions, click the **+** button next to the prompt box and select **Plugins** to see your installed plugins and their skills. To add a plugin, select **Add plugin** from the submenu to open the plugin browser, which shows available plugins from your configured [marketplaces](</docs/en/plugins/overview>) including the official Anthropic marketplace. Select **Manage plugins** to enable, disable, or uninstall plugins. You can scope plugins to your user account, a specific project, or local-only. If your organization manages plugins centrally, those plugins are available in desktop sessions the same way they are in the CLI. The plugin browser is not available in cloud sessions, and plugins you install from the desktop app aren’t available for cloud sessions. A cloud session also doesn’t install plugins that the repository’s `.claude/settings.json` declares, as [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>) explains. Plugins aren’t available in WSL sessions. For the full plugin reference including creating your own plugins, see [plugins](</docs/en/plugins/overview>). ### @@ -935,7 +935,7 @@ Permission modes| All modes including `dontAsk`| Manual, Accept edits, Plan, and Auto. Bypass permissions appears in the mode selector once enabled: through the Settings toggle on Pro and Max plans, or through organization policy on Team and Enterprise plans [Third-party providers](</docs/en/third-party-integrations>)| Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry| Anthropic’s API by default. For gateway routing, see [connect the desktop app to a gateway](</docs/en/llm-gateway-connect#desktop-app>). To run the Code tab on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway, see [Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/overview>). [MCP servers](</docs/en/mcp>)| Configure in settings files| Connectors UI for local and SSH sessions, or settings files -[Plugins](</docs/en/plugins>)| `/plugin` command| Plugin manager UI +[Plugins](</docs/en/plugins/overview>)| `/plugin` command| Plugin manager UI @mention files| Text-based| With autocomplete; local and SSH sessions only File attachments| Not available| Images, PDFs Session isolation| [`--worktree`](</docs/en/cli-reference>) flag| **worktree** option when starting a session
modified Environment variables View current →
Show diff (109 lines)
--- a/env-vars.md +++ b/env-vars.md @@ -90,7 +90,7 @@ Precedence -Some behaviors have both an environment variable and a dedicated settings key, and which one Claude Code reads first differs per key. For `ANTHROPIC_MODEL` and `CLAUDE_CODE_AUTO_CONNECT_IDE`, Claude Code reads the variable first and uses the `model` or `autoConnectIde` setting only when the variable is unset. For the pair you’re setting, check the variable’s row below and the key’s entry on the [settings reference](</docs/en/settings-reference>). When the same variable is set in both your shell and a settings file `env` block, the settings file value applies. Claude Code writes each `env` entry into the process environment, replacing the value inherited from the shell. The [`env` setting](</docs/en/settings-reference#when-claude-code-applies-env-values>) says when it applies them. A few variables are special-cased; the [`env` setting](</docs/en/settings-reference#env>) lists the exceptions. In a settings file you can set a variable but you can’t remove one. To override a variable you can’t unset, such as a stale `CLAUDE_CODE_USE_VERTEX` exported by a shell profile you don’t control, set it to an empty string in the `env` block: `"CLAUDE_CODE_USE_VERTEX": ""`. Claude Code treats the empty value as unset for provider selection. Subprocesses still inherit the empty value. Between settings files, `env` values follow [settings precedence](</docs/en/settings#settings-precedence>), so a managed settings entry overrides the same variable in user or project settings. How an environment variable interacts with CLI flags and in-session commands varies per feature: `--model` and `/model` override `ANTHROPIC_MODEL`, while `CLAUDE_CODE_EFFORT_LEVEL` overrides `--effort` and `/effort`. When a variable interacts with another configuration source, its row in the Variables list states the precedence or links to the page that documents it. Claude Code reads shell environment variables at startup, so changes to them take effect the next time you launch `claude`. Variables set under the `env` key in settings files are reapplied to a running session when the file changes, with the startup-only exception described in In settings files. +Some behaviors have both an environment variable and a dedicated settings key, and which one Claude Code reads first differs per key. For `ANTHROPIC_MODEL` and `CLAUDE_CODE_AUTO_CONNECT_IDE`, Claude Code reads the variable first and uses the `model` or `autoConnectIde` setting only when the variable is unset. For the pair you’re setting, check the variable’s row below and the key’s entry on the [settings reference](</docs/en/settings-reference>). When the same variable is set in both your shell and a settings file `env` block, the settings file value applies. Claude Code writes each `env` entry into the process environment, replacing the value inherited from the shell. The [`env` setting](</docs/en/settings-reference#when-claude-code-applies-env-values>) says when it applies them. A few variables are special-cased; the [`env` setting](</docs/en/settings-reference#env>) lists the exceptions. In a settings file you can set a variable but you can’t remove one. To override a variable you can’t unset, such as a stale `CLAUDE_CODE_USE_VERTEX` exported by a shell profile you don’t control, set it to an empty string in the `env` block: `"CLAUDE_CODE_USE_VERTEX": ""`. Claude Code treats the empty value as unset for provider selection. Subprocesses still inherit the empty value. Between settings files, `env` values follow [settings precedence](</docs/en/settings#settings-precedence>), so a managed settings entry overrides the same variable in user or project settings. Project and local settings can’t set some variables, such as `CLAUDE_CONFIG_DIR` and the OpenTelemetry exporter variables. [Variables Claude Code ignores in `env`](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) lists them, along with the OpenTelemetry off values that still apply. How an environment variable interacts with CLI flags and in-session commands varies per feature: `--model` and `/model` override `ANTHROPIC_MODEL`, while `CLAUDE_CODE_EFFORT_LEVEL` overrides `--effort` and `/effort`. When a variable interacts with another configuration source, its row in the Variables list states the precedence or links to the page that documents it. Claude Code reads shell environment variables at startup, so changes to them take effect the next time you launch `claude`. Variables set under the `env` key in settings files are reapplied to a running session when the file changes, with the startup-only exception described in In settings files. ## @@ -193,7 +193,7 @@ `CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS`| When `CLAUDE_AUTO_BACKGROUND_TASKS` is enabled, seconds between reminders to Claude to check on [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) that are still running. Accepts a plain integer from `1` to `86400` only; any other value or spelling reads as unset. When unset, there are no check-in reminders. Requires Claude Code v2.1.248 or later `CLAUDE_CODE_AUTO_COMPACT_WINDOW`| Set the [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) in tokens, from `100000` to `1000000`. Accepts a plain integer such as `500000` only: a value like `500k` reads as `500` and clamps to the 100K minimum. The effective window is also capped at the model’s context window. Takes precedence over the `/autocompact` command, the `--autocompact` flag, and the `autoCompactWindow` setting. The status line’s `used_percentage` always measures against the model’s full context window, so once this variable is set, that percentage no longer indicates when compaction will run `CLAUDE_CODE_AUTO_CONNECT_IDE`| Override automatic [IDE connection](</docs/en/vs-code>). By default, Claude Code connects automatically when launched inside a supported IDE’s integrated terminal. Set to `false` to prevent this. Set to `true` to force a connection attempt when auto-detection fails, such as when tmux obscures the parent terminal. Takes precedence over the [`autoConnectIde`](</docs/en/settings-reference#autoconnectide>) global config setting -`CLAUDE_CODE_AUTO_MODE_SERVER`| Controls whether Claude Code asks the server to [review auto mode actions](</docs/en/permission-modes#server-side-classifier-review>). When unset, Claude Code asks the server on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS, and when you point `ANTHROPIC_BASE_URL` at an LLM gateway or proxy. Set to `0` to use Claude Code’s own classifier requests instead. Not read on a direct connection to the Anthropic API. Requires Claude Code v2.1.271 or later; asking the server by default requires v2.1.278 or later +`CLAUDE_CODE_AUTO_MODE_SERVER`| Controls whether Claude Code asks the server to [review auto mode actions](</docs/en/permission-modes#server-side-classifier-review>). Set to `0` to use Claude Code’s own classifier requests instead. On a direct connection to the Anthropic API, requires v2.1.281 or later. The linked section lists which sessions ask the server when the variable is unset, and from which version. Requires Claude Code v2.1.271 or later `CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`| Time in milliseconds Claude Code waits for the AWS default credential provider chain to produce credentials before the request fails with [`AWS default-chain credential resolve timed out`](</docs/en/errors#aws-default-chain-credential-resolve-timed-out>) (default: `60000`). Raise it when a step in your chain legitimately needs longer, such as a browser-based SSO sign-in with MFA through a wrapper like `aws-vault`. Applies wherever Claude Code signs with the default chain: [Amazon Bedrock](</docs/en/amazon-bedrock#credential-caching-and-resolution-timeout>), [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and the [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>). Requires Claude Code v2.1.207 or later `CLAUDE_CODE_BASH_EDIT_DIFF`| Set to `0` to turn off the [diff of the files that changed while a Bash command ran](</docs/en/hooks#bash>), or `1` to record it in every permission mode. Takes precedence over the [`bashEditDiffEnabled`](</docs/en/settings-reference#basheditdiffenabled>) setting. Requires Claude Code v2.1.269 or later `CLAUDE_CODE_BG_TASKS_REPORT_RUNNING`| Set to `0` to make a non-interactive session report an idle status to its host at every turn end, even while background work is still running. By default, the session keeps reporting a running status past turn end while background work such as a background agent or a [workflow](</docs/en/workflows>) run is still live. This keeps a host that watches the status, such as a remote session list, from announcing that Claude is waiting for your input mid-work. Background shell commands, such as a dev server, don’t hold the running status. The running-status default and the `0` opt-out require Claude Code v2.1.269 or later; on earlier versions, set `1` to hold the running status @@ -235,7 +235,7 @@ `CLAUDE_CODE_DISABLE_MOUSE`| Set to `1` to disable mouse tracking in [fullscreen rendering](</docs/en/fullscreen>). Keyboard scrolling with `PgUp` and `PgDn` still works. Use this to keep your terminal’s native copy-on-select behavior `CLAUDE_CODE_DISABLE_MOUSE_CLICKS`| Set to `1` to disable click, drag, and hover handling in [fullscreen rendering](</docs/en/fullscreen>) while keeping mouse-wheel scrolling. Use this when you want wheel scroll to work inside Claude Code but don’t want clicks to position the cursor, expand tool output, or open links. `CLAUDE_CODE_DISABLE_MOUSE` takes precedence when both are set. Requires Claude Code v2.1.195 or later `CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION`| Set to `1` to stop Claude Code from re-reading the [mTLS client certificate and key](</docs/en/network-config#mtls-authentication>) when an API request fails with a connection-level error, such as a connection reset or a TLS handshake error. With the reload disabled, Claude Code loads rotated files only when it next applies settings or at the next startup. Requires Claude Code v2.1.232 or later -`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`| Set to any non-empty value, such as `1`, to disable nonessential network traffic: auto-updates, telemetry, error reporting, the `/feedback` command, [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>), release notes, the [PR and MR status badge](</docs/en/interactive-mode#pr-review-status>) checks, and availability checks such as the [fast mode](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>) check. It also stops the [background runs of plugin `command` sources](</docs/en/plugin-marketplaces#when-claude-code-re-runs-the-command>), which are local commands rather than network traffic, because they can trigger dependency installs. **Setting it to`0` or `false` still disables this traffic**, unlike most on/off variables; unset the variable to allow it again. Also disables feature-flag fetching, which makes [Remote Control](</docs/en/remote-control#requirements>) and the other features that need feature-flag fetching unavailable. Official plugin marketplace auto-install isn’t covered; disable it with `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`. Doesn’t affect [gateway model discovery](</docs/en/llm-gateway-connect#add-gateway-models-to-the-model-picker>), which has its own opt-in +`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`| Set to any non-empty value, such as `1`, to disable nonessential network traffic: auto-updates, telemetry, error reporting, the `/feedback` command, [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>), release notes, the [PR and MR status badge](</docs/en/interactive-mode#pr-review-status>) checks, and availability checks such as the [fast mode](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>) check. It also stops the [background runs of plugin `command` sources](</docs/en/plugins/loading#when-a-command-source-re-runs>), which are local commands rather than network traffic, because they can trigger dependency installs. **Setting it to`0` or `false` still disables this traffic**, unlike most on/off variables; unset the variable to allow it again. Also disables feature-flag fetching, which makes [Remote Control](</docs/en/remote-control#requirements>) and the other features that need feature-flag fetching unavailable. Official plugin marketplace auto-install isn’t covered; disable it with `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`. Doesn’t affect [gateway model discovery](</docs/en/llm-gateway-connect#add-gateway-models-to-the-model-picker>), which has its own opt-in `CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK`| Set to `1` to disable the non-streaming fallback when a streaming request fails mid-stream. Streaming errors propagate to the retry layer instead. Useful when a proxy or gateway causes the fallback to produce duplicate tool execution `CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK`| Set to `1` to send the `PushNotification` tool’s desktop notification even while you are typing in or focused on the terminal. By default the tool skips both the desktop notification and the [mobile push](</docs/en/remote-control#mobile-push-notifications>) when it detects recent keyboard activity or terminal focus. This variable disables only that local check, so the server can still suppress the mobile push when it detects that you are active. Requires Claude Code v2.1.193 or later `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`| Set to `1` to disable automatic registration of the official plugin marketplace. Claude Code reads the variable when it is about to register the marketplace, usually during a machine’s first interactive launch. If the variable is set at that point, Claude Code skips the registration permanently. Unsetting the variable later doesn’t undo the skip. Run `claude plugin marketplace add anthropics/claude-plugins-official` to register the marketplace at any time @@ -257,7 +257,7 @@ `CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE`| Removed in v2.1.142, when the [fast mode](</docs/en/fast-mode>) default moved from Opus 4.6 to Opus 4.7 `CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION`| Set to `false` to turn off prompt suggestions, the grayed-out predictions that appear in your prompt input. Takes precedence over the [`promptSuggestionEnabled`](</docs/en/settings-reference#promptsuggestionenabled>) setting, which is what the **Prompt suggestions** toggle in `/config` writes. Claude Code also [pauses suggestions while your account is close to or at its usage limit](</docs/en/interactive-mode#when-claude-code-skips-suggestions>). Set to `true` to keep them on until you reach the limit. Requires Claude Code v2.1.238 or later. See [Prompt suggestions](</docs/en/interactive-mode#prompt-suggestions>) `CLAUDE_CODE_ENABLE_TASKS`| Selects which task-tracking tools Claude Code provides in [sessions that have them](</docs/en/tools-reference#task-tool-availability>). By default, Claude Code provides the Task tools `TaskCreate`, `TaskUpdate`, `TaskGet`, and `TaskList`. Set to `0` to get the legacy `TodoWrite` tool instead. See [Task list](</docs/en/interactive-mode#task-list>) -`CLAUDE_CODE_ENABLE_TELEMETRY`| Set to `1` to enable OpenTelemetry data collection for metrics and logging. Required before configuring OTel exporters. See [Monitoring](</docs/en/monitoring-usage>) +`CLAUDE_CODE_ENABLE_TELEMETRY`| Set to `1` to enable OpenTelemetry data collection for metrics and logging. Required before configuring OTel exporters. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). See [Monitoring](</docs/en/monitoring-usage>) `CLAUDE_CODE_ENABLE_TODO_TOOLS`| Set to `1` to get the task-tracking tools on every model. Without it, Claude Code provides them by default only on the models listed under [Task tool availability](</docs/en/tools-reference#task-tool-availability>). `CLAUDE_CODE_ENABLE_TASKS` still selects the Task tools or `TodoWrite`. Requires Claude Code v2.1.233 or later `CLAUDE_CODE_EXIT_AFTER_STOP_DELAY`| Time in milliseconds to wait after the query loop becomes idle before automatically exiting. Useful for automated workflows and scripts using SDK mode `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS`| Set to `1` to enable [agent teams](</docs/en/agent-teams>). Agent teams are experimental and disabled by default @@ -311,11 +311,11 @@ `CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE`| Set to `1` to let Claude Code run your package manager’s upgrade command in the background when a new version is available. Applies to Homebrew and WinGet installations. Other package managers continue to show the upgrade command without running it. See [Auto updates](</docs/en/setup#auto-updates>) `CLAUDE_CODE_PERFORCE_MODE`| Set to `1` to enable Perforce-aware write protection. When set, Edit, Write, and NotebookEdit fail with a `p4 edit <file>` hint if the target file lacks the owner-write bit, which Perforce clears on synced files until `p4 edit` opens them. This prevents Claude Code from bypassing Perforce change tracking `CLAUDE_CODE_PLUGIN_CACHE_DIR`| Override the plugins root directory. Despite the name, this sets the parent directory, not the cache itself: marketplaces and the plugin cache live in subdirectories under this path. Defaults to `~/.claude/plugins` -`CLAUDE_CODE_PLUGIN_DIRS`| Plugin directories to load for the session, each loaded the way a [`--plugin-dir`](</docs/en/plugins#test-your-plugins-locally>) flag loads it. Separate multiple paths with `:` on Unix or `;` on Windows. Give each path as an absolute path or start it with `~`, because Claude Code skips relative paths. Requires Claude Code v2.1.280 or later -`CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS`| Timeout in milliseconds for git operations when installing or updating plugins (default: 120000). Increase this value for large repositories or slow network connections. See [Git operations time out](</docs/en/plugin-marketplaces#git-operations-time-out>) -`CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE`| Set to `1` to skip the re-clone attempt and keep using the existing marketplace checkout when a marketplace refresh can’t reach or authenticate to the remote. Useful in offline or airgapped environments where re-cloning would fail the same way. See [Marketplace updates fail in offline environments](</docs/en/plugin-marketplaces#marketplace-updates-fail-in-offline-environments>) +`CLAUDE_CODE_PLUGIN_DIRS`| Plugin directories to load for the session, each loaded the way a [`--plugin-dir`](</docs/en/plugins/cli-reference#flags-that-load-a-plugin-for-one-session>) flag loads it. Separate multiple paths with `:` on Unix or `;` on Windows. Give each path as an absolute path or start it with `~`, because Claude Code skips relative paths. Requires Claude Code v2.1.280 or later. See [Load a plugin for one session](</docs/en/plugins/create#load-a-directory-or-archive-for-one-session>) +`CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS`| Timeout in milliseconds for cloning or refreshing a plugin marketplace (default: 120000). Increase this value for large repositories or slow network connections. See [Git clone timed out](</docs/en/plugins/troubleshooting#git-clone-timed-out-after-120s>) +`CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE`| Set to `1` to skip the re-clone attempt and keep using the existing marketplace checkout when a marketplace refresh can’t reach or authenticate to the remote. Useful in offline or airgapped environments where re-cloning would fail the same way. See [Marketplace updates fail in offline environments](</docs/en/plugins/troubleshooting#marketplace-updates-keep-failing-offline>) `CLAUDE_CODE_PLUGIN_PREFER_HTTPS`| Set to `1` to clone GitHub `owner/repo` shorthand sources over HTTPS instead of SSH. Applies to plugin install and update, and to `/plugin marketplace add` and `update`. Useful in CI runners, containers, or any environment without a configured SSH key for `github.com` -`CLAUDE_CODE_PLUGIN_SEED_DIR`| Path to one or more read-only plugin seed directories, separated by `:` on Unix or `;` on Windows. Use this to bundle a pre-populated plugins directory into a container image. Claude Code registers marketplaces from these directories at startup and uses pre-cached plugins without re-cloning. See [Pre-populate plugins for containers](</docs/en/plugin-marketplaces#pre-populate-plugins-for-containers>) +`CLAUDE_CODE_PLUGIN_SEED_DIR`| Path to one or more read-only plugin seed directories, separated by `:` on Unix or `;` on Windows. Use this to bundle a pre-populated plugins directory into a container image. Claude Code registers marketplaces from these directories at startup and uses pre-cached plugins without re-cloning. See [Pre-populate plugins for containers](</docs/en/plugins/org#seed-containers-and-ci>) `CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY`| Set to `1` to stop Claude Code from passing `-ExecutionPolicy Bypass` when spawning PowerShell for tool calls, hooks, and status line commands, and respect the machine’s effective execution policy instead. By default Claude Code bypasses execution policy at process scope so `.ps1` scripts and module imports work on default-Restricted Windows installs. Process-scope bypass never overrides Group Policy `MachinePolicy` or `UserPolicy` regardless of this setting `CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`| Ceiling in milliseconds on idle waiting for background subagents and workflows after the final turn in [non-interactive mode](</docs/en/headless#background-tasks-at-exit>) with the `-p` flag. Idle waiting starts over each time Claude takes a turn to handle a background result. Default: `600000`, or 10 minutes. When idle waiting reaches the ceiling, Claude Code stops waiting for the remaining background tasks and exits. Set to `0` to wait indefinitely. This cap is separate from the five-second grace period that applies to plain background shells. Requires Claude Code v2.1.182 or later `CLAUDE_CODE_PROCESS_WRAPPER`| Launch the processes Claude Code starts from its own binary, such as the background service that hosts [agent view](</docs/en/agent-view>) sessions, through a corporate launcher given as an argv prefix like `/opt/corp/launcher`. Set it in the `env` block of user or [managed settings](</docs/en/managed-settings>), not as a shell export, so the detached background service inherits it; project and local settings can’t set it. Equivalent to the [`processWrapper` setting](</docs/en/settings-reference#processwrapper>), which requires Claude Code v2.1.210 or later; this variable takes precedence when both are set. The VS Code extension configures its own launcher separately through its `claudeProcessWrapper` setting. Ignored on Windows. See [Run Claude Code behind a corporate launcher](</docs/en/corporate-launcher>) for the value format, what the launcher covers, and the contract the launcher must satisfy. Requires Claude Code v2.1.208 or later @@ -328,8 +328,8 @@ `CLAUDE_CODE_REMOTE_SESSION_ID`| Set automatically in [cloud sessions](</docs/en/claude-code-on-the-web>) to the current session’s ID. Read this to construct a link back to the session transcript. See [Link output back to the session](</docs/en/cloud-environments#link-output-back-to-the-session>) `CLAUDE_CODE_RESTRICTED`| Set to `1` to start the session in restricted mode, the same as passing [`--restricted`](</docs/en/cli-reference#cli-flags>). Claude Code ignores this variable in a settings file’s `env` block. Requires Claude Code v2.1.248 or later `CLAUDE_CODE_RESUME_INTERRUPTED_TURN`| Set to `1` to automatically resume if the previous session ended mid-turn. Used in SDK mode so the model continues without requiring the SDK to re-send the prompt. To turn this off, unset the variable or set it to `0`. Before v2.1.221, Claude Code ignored `0` and other falsy values, so setting `0` still triggered the resume in non-interactive mode and unsetting the variable was the only way to turn it off -`CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS`| Maximum age in milliseconds of the last transcript message for a session that ended mid-turn to continue automatically on resume. When the last message is older than this bound, Claude Code skips both the `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` automatic resume and the injected `CLAUDE_CODE_RESUME_PROMPT` continuation message, and the session starts idle so you continue explicitly. Unset or `0` means no bound, except that a turn whose last request failed with an API error resumes only while that error is less than six hours old. A positive value bounds every turn, including those; a negative or non-numeric value applies a one-hour bound. Spawn scripts for long-running agents can set this so a restart against an old transcript doesn’t re-run a stale prompt. Claude Code sets a one-hour bound itself when it restarts a crashed [agent view](</docs/en/agent-view>) session that inherited its conversation from an interactive session. Requires Claude Code v2.1.211 or later -`CLAUDE_CODE_RESUME_PROMPT`| Override the continuation message injected when resuming a session that ended mid-turn. Defaults to `Continue from where you left off.`. Spawn scripts for long-running agents can set this to a more directive boot message. An empty string uses the default +`CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS`| Maximum age in milliseconds of the last transcript message for a session that ended mid-turn to continue automatically on resume. When the last message is older than this bound, Claude Code skips the `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` automatic resume and its `CLAUDE_CODE_RESUME_PROMPT` continuation message, and the session starts idle so you continue explicitly. Unset or `0` means no bound, except that a turn whose last request failed with an API error resumes only while that error is less than six hours old. A positive value bounds every turn, including those; a negative or non-numeric value applies a one-hour bound. Spawn scripts for long-running agents can set this so a restart against an old transcript doesn’t re-run a stale prompt. Claude Code sets a one-hour bound itself when it restarts a crashed [agent view](</docs/en/agent-view>) session that inherited its conversation from an interactive session. Requires Claude Code v2.1.211 or later +`CLAUDE_CODE_RESUME_PROMPT`| Override the continuation message Claude Code sends to Claude when `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` continues an interrupted turn instead of resending its prompt, or when you resume a [deferred tool call](</docs/en/hooks#defer-a-tool-call-for-later>) with `-p`. Defaults to `Continue from where you left off.`. An empty string uses the default `CLAUDE_CODE_RETRY_WATCHDOG`| Set to `1` for unattended sessions such as eval harnesses, CI jobs, or remote workers. Retries `429` and `529` capacity errors indefinitely instead of failing after `CLAUDE_CODE_MAX_RETRIES` attempts. Claude Code fails at once when a standard-speed request gets a `429` that reports a spend limit or exhausted usage credits, even one from a [gateway spend cap](</docs/en/errors#spend-limit-reached>) that resets on a schedule. Before v2.1.239, the watchdog retried these indefinitely. For fast mode requests, see [Handle rate limits](</docs/en/fast-mode#handle-rate-limits>). The watchdog backs off up to 5 minutes between attempts, or until the limit resets when the response carries a rate-limit reset time, so a session that hits a usage limit waits out the remaining window. On v2.1.199 or later it also raises the default retry count for other transient errors, such as server errors, timeouts, and dropped connections, to 300, roughly three hours of backoff, and removes the cap of 15 on `CLAUDE_CODE_MAX_RETRIES` if you set that variable explicitly. Requires Claude Code v2.1.186 or later `CLAUDE_CODE_SAFE_MODE`| Set to `1` to start in safe mode: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto memory do not load, for troubleshooting a broken configuration. Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Equivalent to passing [`--safe-mode`](</docs/en/cli-reference#cli-flags>). Directly spawned child processes inherit the variable `CLAUDE_CODE_SCRIPT_CAPS`| JSON object limiting how many times specific scripts may be invoked per session when `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` is set. Keys are substrings matched against the command text; values are integer call limits. For example, `{"deploy.sh": 2}` allows `deploy.sh` to be called at most twice. Matching is substring-based so shell-expansion tricks like `./scripts/deploy.sh $(evil)` still count against the cap. Runtime fan-out via `xargs` or `find -exec` is not detected; this is a defense-in-depth control @@ -339,7 +339,7 @@ `CLAUDE_CODE_SESSION_ID`| Set automatically to the current session ID in Bash and PowerShell tool subprocesses, [hook command](</docs/en/hooks>) subprocesses, and stdio [MCP server](</docs/en/mcp>) subprocesses. For Bash, PowerShell, and hooks this matches the `session_id` field in the hook JSON input and is updated on `/clear`. An MCP server subprocess retains the ID it was spawned with. On `--resume <session-id>` it receives the resumed ID, matching hooks and Bash. On `--continue` or `--resume` without an explicit ID it may receive the initial startup ID instead. Use to correlate scripts and external tools with the Claude Code session that launched them `CLAUDE_CODE_SHELL`| Set the shell Claude Code uses to run Bash tool commands. Accepts a path to a `bash` or `zsh` binary, for example `/opt/homebrew/bin/bash`. Other shells such as `fish` are not supported. If the value is not a working `bash` or `zsh` path, Claude Code ignores it and falls back to auto-detection. Auto-detection uses your `$SHELL` when it points to `bash` or `zsh`, otherwise it picks the first working `zsh` then `bash` found on your `PATH` and standard install locations `CLAUDE_CODE_SHELL_PREFIX`| Command prefix that wraps shell commands Claude Code spawns: Bash tool calls, [hook](</docs/en/hooks>) commands, [status line](</docs/en/statusline>) commands, and stdio [MCP server](</docs/en/mcp>) startup commands. PowerShell hooks and exec-form hooks run without the prefix. Useful for logging or auditing. Setting a bare executable path such as `/path/to/logger.sh` runs each command as `/path/to/logger.sh '<command>'`. The wrapper receives the command line as a single shell-quoted argument in `$1`, so the wrapper must re-evaluate `$1` with a shell, for example `exec bash -c "$1"`. Treating `$1` as a bare executable path breaks stdio MCP servers that pass arguments such as `npx -y <package>`. For Bash tool calls, `$1` contains the full shell invocation Claude Code assembles, including environment setup, not only the command Claude ran -`CLAUDE_CODE_SIMPLE`| Set to `1` to run with a minimal system prompt and only the Bash, file read, and file edit tools. MCP tools from `--mcp-config` are still available. Disables auto-discovery of hooks, skills, custom commands, subagents, plugins, MCP servers, auto memory, and CLAUDE.md. Skills in a directory you pass with `--add-dir` still load. OAuth tokens and keychain credentials are not read, so Anthropic authentication must come from `ANTHROPIC_API_KEY` or an `apiKeyHelper` in `--settings`. Equivalent to passing [`--bare`](</docs/en/headless#start-faster-with-bare-mode>) +`CLAUDE_CODE_SIMPLE`| Set to `1` to run with a minimal system prompt and only the Bash, file read, and file edit tools. MCP tools from `--mcp-config` are still available. Disables auto-discovery of hooks, skills, custom commands, subagents, installed plugins, MCP servers, auto memory, and CLAUDE.md. Skills in a directory you pass with `--add-dir` still load. OAuth tokens and keychain credentials are not read, so Anthropic authentication must come from `ANTHROPIC_API_KEY` or an `apiKeyHelper` in `--settings`. Equivalent to passing [`--bare`](</docs/en/headless#start-faster-with-bare-mode>) `CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`| Set to `1` to use a shorter system prompt and abbreviated tool descriptions on any model. Set to `0`, `false`, `no`, or `off` to opt out even on models where the experiment or server configuration would otherwise enable it. The full tool set, hooks, MCP servers, and CLAUDE.md discovery remain enabled `CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH`| Skip client-side authentication for [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), for gateways that sign requests themselves `CLAUDE_CODE_SKIP_AWS_CRED_CACHE`| Set to `1` to turn off the in-process cache of credentials resolved from the AWS default credential provider chain, so Claude Code resolves the chain on every API request. With the cache off, an SSO-backed profile requests credentials from IAM Identity Center on every request. See [credential caching and resolution timeout](</docs/en/amazon-bedrock#credential-caching-and-resolution-timeout>). Requires Claude Code v2.1.207 or later @@ -448,12 +448,12 @@ `MCP_TOOL_TIMEOUT`| Timeout in milliseconds for MCP tool execution (default: 100000000, about 28 hours). For an HTTP, SSE, or claude.ai connector server, each request also times out after 60 seconds by default; set this variable, or the per-server `timeout`, above 60000 to raise that per-request limit. A lower value still shortens the overall tool-execution timeout but leaves the per-request limit at 60 seconds. Stdio and WebSocket servers have no per-request timer. A per-server `timeout` field in `.mcp.json` overrides this for that server. A per-server `timeout` of at least 1000 also sets the minimum idle window for that server’s tool calls, so `CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT` never aborts them sooner; this floor requires Claude Code v2.1.203 or later. For the env variable, values below 1000 are floored to one second; for the per-server field, values below 1000 are ignored `NO_PROXY`| List of domains and IPs to which requests will be directly issued, bypassing proxy `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`| Standard OpenTelemetry SDK limit on attribute value length. Claude Code caps content-bearing telemetry attributes at the smaller of this and `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH`, so the truncation marker stays within the SDK limit. Claude Code reads the `OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT` and `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` variants the same way, and the smallest set value applies to all signals. Requires Claude Code v2.1.214 or later. See [Monitoring](</docs/en/monitoring-usage#common-configuration-variables>) -`OTEL_LOG_ASSISTANT_RESPONSES`| Set to `1` to include the model’s response text on `assistant_response` OpenTelemetry log events. When unset, the value of `OTEL_LOG_USER_PROMPTS` is used instead. Set to `0` to keep responses redacted even when `OTEL_LOG_USER_PROMPTS` is set. Requires Claude Code v2.1.193 or later. See [Monitoring](</docs/en/monitoring-usage#assistant-response-event>) +`OTEL_LOG_ASSISTANT_RESPONSES`| Set to `1` to include the model’s response text on `assistant_response` OpenTelemetry log events. When unset, Claude Code uses the value of `OTEL_LOG_USER_PROMPTS` instead. Set to `0` to keep responses redacted even when `OTEL_LOG_USER_PROMPTS` is set. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). Requires Claude Code v2.1.193 or later. See [Monitoring](</docs/en/monitoring-usage#assistant-response-event>) `OTEL_LOG_MANAGED_SETTINGS`| Set to `1` to add the redacted managed settings, and a SHA-256 digest of the settings before redaction, to `managed_settings_resolved` OpenTelemetry log events. Disabled by default. Set it in your shell, user settings, or managed settings; a value in project or local settings doesn’t turn it on. Requires Claude Code v2.1.274 or later. See [Monitoring](</docs/en/monitoring-usage#managed-settings-resolved-event>) `OTEL_LOG_RAW_API_BODIES`| Emit Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events. Set to `1` for inline bodies truncated at the content limit, or `file:<dir>` to write untruncated bodies to disk and emit a `body_ref` path instead. `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` configures the content limit, 60 KB by default. Disabled by default; bodies include the entire conversation history. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). See [Monitoring](</docs/en/monitoring-usage#api-request-body-event>) -`OTEL_LOG_TOOL_CONTENT`| Set to `1` to include tool content in the `tool.output` OpenTelemetry span event. Span attributes carry tool content under [their own gates](</docs/en/monitoring-usage#new-context-gates>). Requires [tracing](</docs/en/monitoring-usage#traces-beta>). Disabled by default to protect sensitive data. See [Monitoring](</docs/en/monitoring-usage#tool-output-span-event>) -`OTEL_LOG_TOOL_DETAILS`| Set to `1` to include tool input arguments, MCP server names, user-authored workflow names, raw error strings on tool failures, the refusal `category` on `api_refusal` events, and other tool details in OpenTelemetry traces and logs. Disabled by default to protect PII. See [Monitoring](</docs/en/monitoring-usage>) -`OTEL_LOG_USER_PROMPTS`| Set to `1` to include user prompt text in OpenTelemetry traces and logs. Disabled by default (prompts are redacted). See [Monitoring](</docs/en/monitoring-usage>) +`OTEL_LOG_TOOL_CONTENT`| Set to `1` to include tool content in the `tool.output` OpenTelemetry span event. Span attributes carry tool content under [their own gates](</docs/en/monitoring-usage#new-context-gates>). Requires [tracing](</docs/en/monitoring-usage#traces-beta>). Disabled by default to protect sensitive data. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>), apart from the off values that section describes. See [Monitoring](</docs/en/monitoring-usage#tool-output-span-event>) +`OTEL_LOG_TOOL_DETAILS`| Set to `1` to include tool input arguments, MCP server names, user-authored workflow names, raw error strings on tool failures, the refusal `category` on `api_refusal` events, and other tool details in OpenTelemetry traces and logs. Disabled by default to protect PII. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>), apart from the off values that section describes. See [Monitoring](</docs/en/monitoring-usage>) +`OTEL_LOG_USER_PROMPTS`| Set to `1` to include user prompt text in OpenTelemetry traces and logs. Disabled by default (prompts are redacted). Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>), apart from the off values that section describes. See [Monitoring](</docs/en/monitoring-usage>) `OTEL_METRICS_INCLUDE_ACCOUNT_UUID`| Set to `false` to exclude account UUID from metrics attributes (default: included). See [Monitoring](</docs/en/monitoring-usage>) `OTEL_METRICS_INCLUDE_ENTRYPOINT`| Set to `true` to include the session entrypoint in metrics attributes (default: excluded). Added in v2.1.152. See [Monitoring](</docs/en/monitoring-usage>) `OTEL_METRICS_INCLUDE_REPOSITORY`| Set to `true` to tag OpenTelemetry metrics and events with `vcs.*` attributes identifying the session’s repository (default: excluded). Requires Claude Code v2.1.269 or later. See [Repository attributes](</docs/en/monitoring-usage#repository-attributes>) @@ -482,7 +482,7 @@ `VERTEX_REGION_CLAUDE_FABLE_5_1`| Override region for Claude Fable 5.1 when using Google Cloud’s Agent Platform. Added in v2.1.257 `VERTEX_REGION_CLAUDE_HAIKU_4_5`| Override region for Claude Haiku 4.5 when using Google Cloud’s Agent Platform -Standard OpenTelemetry exporter variables (`OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_METRIC_EXPORT_INTERVAL`, `OTEL_RESOURCE_ATTRIBUTES`, and signal-specific variants) are also supported. See [Monitoring](</docs/en/monitoring-usage>) for configuration details. +Standard OpenTelemetry exporter variables (`OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_METRIC_EXPORT_INTERVAL`, `OTEL_RESOURCE_ATTRIBUTES`, and signal-specific variants) are also supported. See [Monitoring](</docs/en/monitoring-usage>) for configuration details. Set `CLAUDE_CODE_ENABLE_TELEMETRY` and the OpenTelemetry variables that turn on export, choose its destination, or capture content in your shell, user settings, or managed settings. Claude Code [ignores them in project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>), apart from the off values that section describes. `OTEL_RESOURCE_ATTRIBUTES` and the export interval, timeout, and compression variables, such as `OTEL_METRIC_EXPORT_INTERVAL`, still apply from project and local settings. ## @@ -505,7 +505,7 @@ * [Message sessions beyond this machine](</docs/en/cross-session-messaging#message-sessions-on-other-machines>); messaging between sessions on this machine works with fetching off * Run [`claude import` or the `/import` command](</docs/en/cli-reference#cli-commands>) * Run [`/skill-doctor`](</docs/en/skills#find-unused-skills>) or open its report in the `/plugin` **Stats** tab - * Sync the [skills](</docs/en/skills#where-synced-skills-load>) and [plugins](</docs/en/plugins-reference#synced-plugins>) enabled for your claude.ai account into your terminal sessions + * Sync the [skills](</docs/en/skills#where-synced-skills-load>) and [plugins](</docs/en/plugins/loading#synced-plugins>) enabled for your claude.ai account into your terminal sessions * Use [the advisor tool](</docs/en/advisor#requirements>) * Read or reply to [comments on an artifact](</docs/en/artifacts#collect-comments-on-an-artifact>) * Have Claude Code probe claude.ai connector servers for [MCP protocol revision 2026-07-28](</docs/en/mcp#mcp-client-runtimes>) unless you set `MCP_PROTOCOL_NEGOTIATION=auto`
modified Error reference View current →
Show diff (290 lines)
--- a/errors.md +++ b/errors.md @@ -26,6 +26,8 @@ `Auto mode could not evaluate this action and is blocking it for safety`| Server errors `Auto mode classifier transcript exceeded context window`| Server errors `Agent aborted: auto mode classifier request refused by the safety safeguard`| Server errors +`The server-side auto mode classifier gave no verdict`| Server errors +`Auto mode is unavailable — the server returned no safety verdict for the last 10 responses`| Server errors `Agent terminated early due to an API error`| Server errors `You've hit your session limit` / `You've hit your weekly limit` / `You've hit your Opus limit` / `You've hit your Sonnet limit`| Usage limits `Usage credits required for 1M context`| Usage limits @@ -144,6 +146,8 @@ `API Error: 400 orphaned tool_result in conversation history`| Request errors `API Error: 400 duplicate tool_use ID in conversation history`| Request errors `[Unsupported tool content removed]`| Request errors +`role 'system' must precede an 'assistant' message`| Request errors +`Invalid encrypted_content in search_result block` / `Invalid encrypted_index in text block` / `Failed to decrypt web search result content`| Request errors `server_tool_use.name: Input should be` on every turn of a resumed session| Request errors `<model> can't help with this. Start a new session to continue`| Request errors `Claude Code is unable to respond to this request, which appears to violate our Usage Policy`| Request errors @@ -161,6 +165,7 @@ `Error: Invalid --agents configuration:`| Command-line errors `Error: Settings file exceeds the 2MiB limit`| Command-line errors `The current directory no longer exists (it was deleted or moved)` / `Can't read the current directory`| Command-line errors +`Temp directory <dir> ... Refusing to use it` / `ENOSPC: no space left on device, mkdir '<dir>'`| Command-line errors `couldn't be resolved to a real location, so its skills, commands, and agents weren't loaded`| Command-line errors `Error: Workspace not trusted` when starting Remote Control| Command-line errors ``<flag>` before `remote-control` is not carried over to the sessions Remote Control starts`| Command-line errors @@ -204,6 +209,7 @@ ``plugin eval` is currently in early access` / ``plugin eval` is currently unavailable`| Plugin errors `Marketplace "<name>" is registered from an untrusted source`| Plugin errors `Marketplace "<name>" is already added from a different source`| Plugin errors +`"<name>" is another spelling of "<reserved>", a reserved marketplace name`| Plugin errors `references ${user_config.*} in a shell-form command`| Plugin errors `Monitor "<name>" from plugin <plugin> references ${user_config.*} in its command`| Plugin errors `headersHelper for MCP server '<name>' references ${user_config.*}`| Plugin errors @@ -526,6 +532,35 @@ ​ +The server returned no safety verdict + +Under [server-side classifier review](</docs/en/permission-modes#server-side-classifier-review>), auto mode denies an action when the server gives no verdict for it. The denial names a category in parentheses when Claude Code can determine one, such as `(timed out)`: + + The server-side auto mode classifier gave no verdict (timed out), so auto mode cannot determine the safety of <tool>. + +The rest of the message tells Claude whether one retry can help. Before some of these denials, Claude Code waits so that Claude’s next attempt doesn’t follow at once. During the wait in an interactive session, the spinner shows `Auto mode check unavailable` with a countdown, and pressing `Esc` interrupts the turn. After ten responses in a row with no verdict, auto mode stops the turn: + + Auto mode is unavailable — the server returned no safety verdict for the last 10 responses, so Claude stopped. Send a message to try again, or switch out of auto mode. + +The stop message appears in a different place in each kind of session: + + * In an interactive session, the message appears as a warning in the transcript and the turn ends + * In a [non-interactive](</docs/en/headless>) `-p` run, the run ends and reports an execution error. With the default text output, the message prints on stderr. + * When a [subagent](</docs/en/sub-agents>) hit the limit, the subagent stops before finishing, and Claude receives whatever it produced with a note that auto mode stopped it + +**What to do:** + + * Send another message to have Claude try again. The count of responses starts over. + * If the stop repeats and your requests go through an [LLM gateway or proxy](</docs/en/llm-gateway>), check whether it cuts streaming responses short or rewrites them. [Server-side classifier review](</docs/en/permission-modes#server-side-classifier-review>) says which gateway behavior causes denials, and the [gateway compatibility guide](</docs/en/llm-gateway-protocol#feature-pass-through>) lists what to pass through unchanged. + * Set `CLAUDE_CODE_AUTO_MODE_SERVER=0` before you start Claude Code to use its own classifier requests instead. Before v2.1.281, Claude Code didn’t read the variable on a direct connection to the Anthropic API. + * To approve the actions yourself instead, [switch out of auto mode](</docs/en/permission-modes#switch-permission-modes>) + +Before v2.1.280, Claude Code denied each action from a response without a verdict immediately and never stopped the turn. + +### + +​ + Agent terminated early due to an API error A [subagent](</docs/en/sub-agents>)’s API request failed terminally, for example because a usage limit was reached or retries for a server error ran out, so the subagent stopped before finishing its task. This message requires Claude Code v2.1.199 or later; before then the API error text was returned to Claude as if it were the subagent’s result. @@ -2088,6 +2123,40 @@ ​ +role ‘system’ must precede an ‘assistant’ message + +The API refused the request with a 400 because a system message sits at a position in the conversation it doesn’t accept: + + API Error: 400 messages.6: role 'system' must precede an 'assistant' message or end the array; ... + +Claude Code sends some of its reminder and attachment text as system messages inside the conversation. When the API refuses one’s position, Claude Code retries the request once with that text sent as ordinary user messages instead. The API’s sibling placement wordings, such as `use the top-level 'system' parameter for the initial system prompt`, get the same recovery. When the error does appear, the refused system message isn’t one Claude Code can remove. That usually means a proxy or [LLM gateway](</docs/en/llm-gateway>) between Claude Code and the API added a system message of its own or reordered the conversation. **What to do:** + + * Run `/clear` to start a fresh conversation. If the error returns there too, the cause is on the request path, not in the saved conversation. + * If the error repeats on every turn behind a proxy or gateway configured through [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>), connect without the proxy to confirm the source, and report the error to whoever operates it + +Before v2.1.280, Claude Code didn’t recognize this wording, so the error also appeared when the refused system message was one Claude Code itself sent, and every later turn of the conversation failed the same way. + +### + +​ + +Invalid encrypted_content in search_result block + +The API refused the request with a 400 because the conversation history holds hosted web-search content it can’t decrypt. The wording names the field it can’t read: + + API Error: 400 messages.21.content.0: Invalid `encrypted_content` in `search_result` block + API Error: 400 messages.21.content.3.citations.0: Invalid `encrypted_index` in `text` block + API Error: 400 Failed to decrypt web search result content + +Results from the API’s hosted [web search tool](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool>) carry encrypted fields that only the API can read. The API refuses a request that replays content it can’t decrypt, such as content produced for a different organization. Claude Code’s own [WebSearch tool](</docs/en/tools-reference#websearch-tool-behavior>) records search results as plain text, so these blocks usually reach a conversation through a proxy or [LLM gateway](</docs/en/llm-gateway>) that ran hosted web search itself. The refused blocks stay in the conversation history, so every later turn and `/compact` fail the same way. **What to do:** + + * Run `/clear` or start a new session; the new conversation doesn’t carry the refused blocks + * If you run Claude Code behind a proxy or gateway, report the error to whoever operates it + +### + +​ + Usage Policy refusal The API declined to respond because content in the conversation triggered a [Usage Policy](<https://www.anthropic.com/legal/aup>) check. The message includes a Request ID you can quote to support if you believe the refusal is incorrect. @@ -2286,6 +2355,29 @@ ​ +Temp directory refused or cannot be created + +On macOS and Linux, Claude Code creates a private temp directory at startup, `claude-<uid>` under the system temp directory or the [`CLAUDE_CODE_TMPDIR`](</docs/en/env-vars>) override. When the directory can’t be created, or an entry already at that path fails the safety checks, Claude Code prints the failure to stderr and exits with code 1 rather than start the session: + + ENOSPC: no space left on device, mkdir '/tmp/claude-501' + + Temp directory /tmp/claude-501 is not a directory (may be an attacker-planted symlink). Refusing to use it. Set CLAUDE_CODE_TMPDIR to a directory you control, or ask an administrator to remove it. + + Temp directory /tmp/claude-501 is owned by uid 502, expected 501. Refusing to use it — another user may have pre-created it. Set CLAUDE_CODE_TMPDIR to a directory you control, or ask an administrator to remove it. + + Temp directory /tmp/claude-501 is not readable (its mode may have been altered, or a path component denies search). Refusing to use it — restore its permissions (chmod 0700) or remove it. Set CLAUDE_CODE_TMPDIR to a directory you control, or ask an administrator to remove it. + +**What to do:** + + * For `ENOSPC`, free disk space on the volume that holds the temp directory + * For the `Refusing to use it` forms, remove the named entry itself, not what a link points to, and start Claude Code again; for the `owned by uid` form, only an administrator or that user can remove it + * For `is not readable`, run `chmod 0700` on the named directory, or remove it and start again + * In any of these cases, set [`CLAUDE_CODE_TMPDIR`](</docs/en/env-vars>) to a directory you control and start Claude Code again, leaving the refused path alone + +### + +​ + Directory couldn’t be resolved to a real location You ran `/add-dir` for a subdirectory of your working directory, and Claude Code couldn’t resolve the directory to its real location. You already have file access to a subdirectory of the working directory, so `/add-dir` only loads its skills, commands, and agents. Before loading them, Claude Code checks that the directory’s real location, with any symlinks resolved, is inside the working directory. When Claude Code can’t resolve that location, it loads nothing and shows this message: @@ -2583,7 +2675,7 @@ * A typo, such as `/hepl` for `/help`. [How the command menu matches what you type](</docs/en/commands#how-the-command-menu-matches-what-you-type>) covers picking a close match before you submit * A command that exists but isn’t available in this session because a requirement isn’t met, such as your platform, plan, or authentication method. The troubleshooting entries for [`/web-setup`](</docs/en/web-quickstart#web-setup-shows-no-commands-match-or-unknown-command>) and [`/schedule`](</docs/en/routines#schedule-returns-unknown-command>) walk through two common cases. Some commands answer with their own message when your organization’s policy disables them, such as `Cloud sessions are disabled by your organization's policy` - * A command from a [plugin](</docs/en/plugins>) or [MCP server](</docs/en/mcp#use-mcp-prompts-as-commands>) that isn’t installed or connected in this session + * A command from a [plugin](</docs/en/plugins/overview>) or [MCP server](</docs/en/mcp#use-mcp-prompts-as-commands>) that isn’t installed or connected in this session Claude Code answers an unmatched `/` name this way only in an interactive terminal session. In every other session, it sends the prompt to Claude as a normal message instead, with a note that the command didn’t run and a list of commands Claude can run in the session. Those sessions include: @@ -2893,7 +2985,7 @@ Plugin errors -These errors come from [plugin](</docs/en/plugins>) and [marketplace](</docs/en/plugin-marketplaces>) configuration. For plugin problems that don’t produce one of the messages on this page, such as a marketplace URL that doesn’t load or a plugin that installs but doesn’t appear, see [Plugin troubleshooting](</docs/en/discover-plugins#troubleshooting>). +These errors come from [plugin](</docs/en/plugins/overview>) and [marketplace](</docs/en/plugins/overview>) configuration. For plugin problems that don’t produce one of the messages on this page, such as a marketplace URL that doesn’t load or a plugin that installs but doesn’t appear, see [Plugin troubleshooting](</docs/en/plugins/troubleshooting>). ### @@ -2918,7 +3010,7 @@ Marketplace is registered from an untrusted source -The marketplace is registered under a name that is [reserved for official Anthropic marketplaces](</docs/en/plugin-marketplaces#marketplace-schema>), but its registered source isn’t an `anthropics` GitHub repository. Claude Code re-checks reserved names every time it loads or refreshes a marketplace, so the marketplace and the plugins installed from it stop loading. Before v2.1.205, the name was checked only when the marketplace was added, so an entry registered before its name became reserved kept loading. +The marketplace is registered under a name that is [reserved for official Anthropic marketplaces](</docs/en/plugins/marketplace-reference#marketplace-file>), but its registered source isn’t an `anthropics` GitHub repository. Claude Code re-checks reserved names every time it loads or refreshes a marketplace, so the marketplace and the plugins installed from it stop loading. Before v2.1.205, the name was checked only when the marketplace was added, so an entry registered before its name became reserved kept loading. Marketplace "claude-community" is registered from an untrusted source: The name 'claude-community' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/anthropics/' can use this name. To fix it, remove the marketplace and re-add it from the official source. @@ -2926,7 +3018,26 @@ * If the marketplace is already registered, run `claude plugin marketplace remove <name>`, then add it again from the official `github.com/anthropics` repository * If you publish a third-party marketplace that used the name before it became reserved, rename it and ask users to re-add it from your source - * See the reserved name list under [Marketplace schema](</docs/en/plugin-marketplaces#marketplace-schema>) + * See the reserved name list under [Marketplace schema](</docs/en/plugins/marketplace-reference#marketplace-file>) + +### + +​ + +Marketplace name is another spelling of a reserved name + +The marketplace’s name isn’t itself a reserved name, but Claude Code treats it as another spelling of one. [Reserved names](</docs/en/plugins/marketplace-reference#reserved-name-spellings>) lists which spellings count as a reserved name. Claude Code refuses such a name when you add the marketplace: + + Failed to add marketplace: "claude.code.plugins" is another spelling of "claude-code-plugins", a reserved marketplace name. + +When a marketplace is already registered under such a name, its entry stops loading, and `/plugin`, `claude plugin install`, and `claude plugin update` warn: + + known_marketplaces.json has an entry named "claude.code.plugins", another spelling of the reserved marketplace name "claude-code-plugins", so it is ignored. Remove it with: claude plugin marketplace remove claude.code.plugins + +When the name would need shell quoting, the add-time refusal reads `This marketplace's name is another spelling of "<reserved>", a reserved marketplace name. It is not exactly the reserved name it appears to be.` **What to do:** + + * Rename the marketplace to a name that doesn’t spell a reserved name and add it again + * For the ignored-entry warning, run the `claude plugin marketplace remove` command it gives, or remove the entry from `~/.claude/plugins/known_marketplaces.json` ### @@ -2934,7 +3045,7 @@ Marketplace is already added from a different source -You confirmed adding a marketplace through [`/plugin install <plugin> --marketplace <source>`](</docs/en/discover-plugins#add-a-marketplace-and-install-in-one-command>), and the catalog Claude Code fetched from that source names itself the same as a marketplace you already added from a different source. Claude Code keeps the existing marketplace instead of replacing it, and the plugin isn’t installed. +You confirmed adding a marketplace through [`/plugin install <plugin> --marketplace <source>`](</docs/en/plugins/install#add-a-marketplace-and-install-in-one-command>), and the catalog Claude Code fetched from that source names itself the same as a marketplace you already added from a different source. Claude Code keeps the existing marketplace instead of replacing it, and the plugin isn’t installed. Marketplace "acme-tools" is already added from a different source (github:acme/plugins). To use this source instead, remove that marketplace first with /plugin marketplace remove acme-tools. @@ -2949,7 +3060,7 @@ Plugin command references user_config in a shell command -A plugin hook, [monitor](</docs/en/plugins-reference#monitors>), or MCP [`headersHelper`](</docs/en/mcp#use-dynamic-headers-for-custom-authentication>) command references a `${user_config.KEY}` [plugin option](</docs/en/plugins-reference#user-configuration>), and the substituted string would be passed to a shell. A configured value containing `$(...)`, backticks, or `;` would run as code there, so Claude Code refuses to start the component instead of substituting the value. The check runs on the command template, so the error appears even when no value is configured yet. Before v2.1.207, the value was substituted into the shell command. The wording depends on which surface referenced the option. A shell-form hook reports: +A plugin hook, [monitor](</docs/en/plugins/components#monitors>), or MCP [`headersHelper`](</docs/en/mcp#use-dynamic-headers-for-custom-authentication>) command references a `${user_config.KEY}` [plugin option](</docs/en/plugins/manifest-reference#user-configuration>), and the substituted string would be passed to a shell. A configured value containing `$(...)`, backticks, or `;` would run as code there, so Claude Code refuses to start the component instead of substituting the value. The check runs on the command template, so the error appears even when no value is configured yet. Before v2.1.207, the value was substituted into the shell command. The wording depends on which surface referenced the option. A shell-form hook reports: Hook from plugin formatter@acme-tools references ${user_config.*} in a shell-form command. The substituted value would be re-parsed by the shell. Use exec form instead — {"command": "<executable>", "args": ["${user_config.KEY}", ...]} — or read $CLAUDE_PLUGIN_OPTION_<KEY> from the hook's environment. Command: ./scripts/notify.sh ${user_config.webhook_url} @@ -2973,7 +3084,7 @@ Plugin archive integrity check failed -The plugin’s marketplace entry uses an [`archive` source](</docs/en/plugin-marketplaces#zip-archives>) with a `sha256` pin, and the digest of the downloaded file doesn’t match the pin. Claude Code refuses the install, so nothing changes in the plugin cache. The mismatch has three possible causes: +The plugin’s marketplace entry uses an [`archive` source](</docs/en/plugins/marketplace-reference#archive-plugin-source>) with a `sha256` pin, and the digest of the downloaded file doesn’t match the pin. Claude Code refuses the install, so nothing changes in the plugin cache. The mismatch has three possible causes: * The file at the URL changed after the author computed the pin * The author entered the wrong digest in the marketplace entry @@ -2993,11 +3104,11 @@ Path escapes plugin directory -A plugin component path, declared in the plugin’s `plugin.json` or in its [marketplace entry](</docs/en/plugin-marketplaces#plugin-entries>), resolves outside the plugin’s own directory. Claude Code drops that path and loads the rest of the plugin. The component name in the message, such as `commands` or `hooks`, names the field that declared the path. +A plugin component path, declared in the plugin’s `plugin.json` or in its [marketplace entry](</docs/en/plugins/marketplace-reference#plugin-entries>), resolves outside the plugin’s own directory. Claude Code drops that path and loads the rest of the plugin. The component name in the message, such as `commands` or `hooks`, names the field that declared the path. commands path escapes plugin directory: ./../shared.md -In `claude plugin` command output, the same error reads `Path escapes plugin directory: ./../shared.md (commands)`. Claude Code rejects both a path that points outside the plugin as written, such as `../shared-utils`, and a symlink that leads outside the plugin and isn’t one the [marketplace symlink rules](</docs/en/plugins-reference#share-files-within-a-marketplace-with-symlinks>) allow. For a symlink, the message also says where the path resolves: +In `claude plugin` command output, the same error reads `Path escapes plugin directory: ./../shared.md (commands)`. Claude Code rejects both a path that points outside the plugin as written, such as `../shared-utils`, and a symlink that leads outside the plugin and isn’t one the [marketplace symlink rules](</docs/en/plugins/host-marketplace#share-files-within-a-marketplace-with-symlinks>) allow. For a symlink, the message also says where the path resolves: commands path escapes plugin directory: ./commands/deploy.md — it resolves to /home/user/shared/deploy.md, outside the plugin directory @@ -3010,7 +3121,7 @@ * Move the referenced file inside the plugin directory and point the path at it with a `./` relative path * If the path is a symlink to a file outside the plugin, replace the symlink with a copy of the file * If the message says the path contains a backslash, write the path with forward slashes, for example `./commands/deploy.md` - * To share files with other plugins in the same marketplace, link them with a symlink inside the plugin directory, following the [symlink rules](</docs/en/plugins-reference#share-files-within-a-marketplace-with-symlinks>) + * To share files with other plugins in the same marketplace, link them with a symlink inside the plugin directory, following the [symlink rules](</docs/en/plugins/host-marketplace#share-files-within-a-marketplace-with-symlinks>) ### @@ -3020,7 +3131,7 @@ Claude Code asked the operating system whether a plugin path exists and got an error other than “not found”, so it doesn’t load what the path names. How much of the plugin loads depends on which path failed: - * One of a plugin’s [default component locations](</docs/en/plugins-reference#file-locations-reference>), such as the `skills/` folder, the `monitors/monitors.json` file, or a [`SKILL.md` at the plugin root](</docs/en/plugins-reference#skills>): the plugin’s other components still load + * One of a plugin’s [default component locations](</docs/en/plugins/manifest-reference#standard-layout>), such as the `skills/` folder, the `monitors/monitors.json` file, or a [`SKILL.md` at the plugin root](</docs/en/plugins/components#skills>): the plugin’s other components still load * The plugin’s own directory: nothing from that plugin loads You don’t see this error for a path that doesn’t exist at all. In `/plugin`, the error appears under the plugin and names the path and the code the operating system returned: @@ -3048,12 +3159,12 @@ Marketplace entry path does not stay inside the marketplace directory -The plugin’s [marketplace entry](</docs/en/plugin-marketplaces#plugin-entries>) declares a source path that Claude Code can’t resolve to a location inside the marketplace’s own directory, so the plugin doesn’t install or load. The refusal covers: +The plugin’s [marketplace entry](</docs/en/plugins/marketplace-reference#plugin-entries>) declares a source path that Claude Code can’t resolve to a location inside the marketplace’s own directory, so the plugin doesn’t install or load. The refusal covers: * An entry path that is absolute, climbs out of the marketplace with `..`, or is spelled like a network path * On macOS and Linux, an entry path that contains a backslash anywhere after the leading `./` * An entry in a marketplace fetched from a remote source, such as git or a URL, that reaches its target through a symlink resolving outside the marketplace directory - * A relative entry in a marketplace added from a direct URL to its `marketplace.json`: Claude Code downloads only that file, so no local plugin files exist for the path to name. See [Plugins with relative paths fail in URL-based marketplaces](</docs/en/plugin-marketplaces#plugins-with-relative-paths-fail-in-url-based-marketplaces>) + * A relative entry in a marketplace added from a direct URL to its `marketplace.json`: Claude Code downloads only that file, so no local plugin files exist for the path to name. See [Plugins with relative paths fail in URL-based marketplaces](</docs/en/plugins/troubleshooting#plugins-with-relative-paths-fail-in-url-based-marketplaces>) `claude plugin install` reports the refusal like this: @@ -3066,7 +3177,7 @@ **What to do:** * If you maintain the marketplace, write the entry’s `source` as a plain relative path with forward slashes, such as `./plugins/my-plugin`, and keep any symlink it crosses pointed inside the marketplace directory - * If you added the marketplace from a direct URL, relative entries can’t resolve. Ask the marketplace author to use [another plugin source](</docs/en/plugin-marketplaces#plugin-sources>), or add the marketplace from its git repository instead + * If you added the marketplace from a direct URL, relative entries can’t resolve. Ask the marketplace author to use [another plugin source](</docs/en/plugins/marketplace-reference#plugin-sources>), or add the marketplace from its git repository instead ### @@ -3094,7 +3205,7 @@ Plugin is required by your organization -You ran `claude plugin disable`, or used the `/plugin` **Installed** tab, to turn off a [plugin synced from claude.ai](</docs/en/plugins-reference#synced-plugins>) that your organization marks as required: +You ran `claude plugin disable`, or used the `/plugin` **Installed** tab, to turn off a [plugin synced from claude.ai](</docs/en/plugins/loading#synced-plugins>) that your organization marks as required: Plugin "<name>@synced" is required by your organization and can't be disabled here. Contact your admin to change it.
modified Feature availability View current →
--- a/feature-availability.md +++ b/feature-availability.md @@ -26,7 +26,7 @@ * [CLI](</docs/en/quickstart>) and [Agent SDK](</docs/en/agent-sdk/overview>) * [VS Code](</docs/en/vs-code>) and [JetBrains](</docs/en/jetbrains>) extensions * [Subagents](</docs/en/sub-agents>), [hooks](</docs/en/hooks-guide>), [commands](</docs/en/commands>), and [skills](</docs/en/skills>) - * [CLAUDE.md memory](</docs/en/memory>), [plugins](</docs/en/plugins>), and [MCP servers](</docs/en/mcp>) + * [CLAUDE.md memory](</docs/en/memory>), [plugins](</docs/en/plugins/overview>), and [MCP servers](</docs/en/mcp>) * [Checkpoints](</docs/en/checkpointing>), [sandboxing](</docs/en/sandboxing>), and [Workflows](</docs/en/workflows>) * [OpenTelemetry metrics](</docs/en/monitoring-usage>) and the [managed settings file](</docs/en/managed-settings#delivery-mechanisms>)
modified Extend Claude Code View current →
--- a/features-overview.md +++ b/features-overview.md @@ -21,7 +21,7 @@ * **[Dynamic workflows](</docs/en/workflows>)** run many subagents from a script Claude writes, returning one result * **[Cross-session messaging](</docs/en/cross-session-messaging>)** lets Claude pass a message from one of your sessions to another * **[Hooks](</docs/en/hooks-guide>)** run your script, HTTP request, MCP tool call, prompt, or subagent when Claude Code reaches a lifecycle event - * **[Plugins](</docs/en/plugins>)** and **[marketplaces](</docs/en/plugin-marketplaces>)** package and distribute these features + * **[Plugins](</docs/en/plugins/overview>)** and **[marketplaces](</docs/en/plugins/overview>)** package and distribute these features [Skills](</docs/en/skills>) are the most flexible extension. A skill is a markdown file containing knowledge, workflows, or instructions. You can invoke skills with a command like `/deploy`, or Claude can load them automatically when relevant. Skills can run in your current conversation or in an isolated context via subagents. @@ -46,7 +46,7 @@ **Hook**| Script, HTTP request, MCP tool call, prompt, or subagent triggered by events| Automation that must run on every matching event| Run ESLint after every file edit **[Artifact](</docs/en/artifacts>)**| Publish session output as a private, interactive web page| Output you want to see or share visually rather than as terminal text| An incident timeline that updates as Claude investigates -**[Plugins](</docs/en/plugins>)** are the packaging layer. A plugin bundles skills, hooks, subagents, and MCP servers into a single installable unit. Plugin skills are namespaced (like `/my-plugin:review`) so multiple plugins can coexist. Use plugins when you want to reuse the same setup across multiple repositories or distribute to others via a **[marketplace](</docs/en/plugin-marketplaces>)**. +**[Plugins](</docs/en/plugins/overview>)** are the packaging layer. A plugin bundles skills, hooks, subagents, and MCP servers into a single installable unit. Plugin skills are namespaced (like `/my-plugin:review`) so multiple plugins can coexist. Use plugins when you want to reuse the same setup across multiple repositories or distribute to others via a **[marketplace](</docs/en/plugins/overview>)**. ### @@ -63,10 +63,10 @@ You keep typing the same prompt to start a task| Save it as a user-invocable [skill](</docs/en/skills>) You paste the same playbook or multi-step procedure into chat for the third time| Capture it as a [skill](</docs/en/skills>) You keep copying data from a browser tab Claude can’t see| Connect that system as an [MCP server](</docs/en/mcp>) -Claude reads many files to find where a symbol is defined or used| Install a [code intelligence plugin](</docs/en/discover-plugins#code-intelligence>) for your language +Claude reads many files to find where a symbol is defined or used| Install a [code intelligence plugin](</docs/en/plugins/code-intelligence>) for your language A side task floods your conversation with output you won’t reference again| Route it through a [subagent](</docs/en/sub-agents>) You want something to happen every time without asking| Write a [hook](</docs/en/hooks-guide>) -A second repository needs the same setup| Package it as a [plugin](</docs/en/plugins>) +A second repository needs the same setup| Package it as a [plugin](</docs/en/plugins/overview>) The same triggers tell you when to update what you already have. A repeated mistake or a recurring review comment is a CLAUDE.md edit, not a one-off correction in chat. A workflow you keep tweaking by hand is a skill that needs another revision. @@ -175,7 +175,7 @@ Features can be defined at multiple levels: user-wide, per-project, via plugins, or through managed policies. You can also nest CLAUDE.md files in subdirectories or place skills in specific packages of a monorepo. When the same feature exists at multiple levels, here’s how they layer: * **CLAUDE.md files** are additive: all levels contribute content to Claude’s context simultaneously. Files from your working directory and above load at launch; subdirectories load as you work in them. When instructions conflict, Claude uses judgment to reconcile them. See [how CLAUDE.md files load](</docs/en/memory#how-claude-md-files-load>). - * **Skills and subagents** override by name: when the same name exists at multiple levels, one definition wins based on priority (managed > user > project for skills; managed > CLI flag > project > user > plugin for subagents). Plugin skills are [namespaced](</docs/en/plugins#add-skills-to-your-plugin>) to avoid conflicts. See [skill discovery](</docs/en/skills#resolve-skills-that-share-a-name>) and [subagent scope](</docs/en/sub-agents#choose-the-subagent-scope>). + * **Skills and subagents** override by name: when the same name exists at multiple levels, one definition wins based on priority (managed > user > project for skills; managed > CLI flag > project > user > plugin for subagents). Plugin skills are [namespaced](</docs/en/plugins/components#skills>) to avoid conflicts. See [skill discovery](</docs/en/skills#resolve-skills-that-share-a-name>) and [subagent scope](</docs/en/sub-agents#choose-the-subagent-scope>). * **MCP servers** override by name: local > project > user. See [MCP scope](</docs/en/mcp#scope-hierarchy-and-precedence>). * **Hooks** merge: all registered hooks fire for their matching events regardless of source. See [hooks](</docs/en/hooks>). @@ -256,7 +256,7 @@ **When:** After file edits, and on demand when Claude navigates code.**What loads:** Type errors and warnings after each file edit. Definition, reference, and type information when Claude looks up a symbol.**Context cost:** Low. Symbol lookups often replace broad file reads, so net context use can go down. -The LSP tool is inactive until you install a [code intelligence plugin](</docs/en/discover-plugins#code-intelligence>) for your language. +The LSP tool is inactive until you install a [code intelligence plugin](</docs/en/plugins/code-intelligence>) for your language. **When:** On demand, when you or Claude spawns one for a task.**What loads:** Fresh, isolated context containing:
modified Fullscreen rendering View current →
--- a/fullscreen.md +++ b/fullscreen.md @@ -82,9 +82,10 @@ * **Click in the prompt input** to position your cursor anywhere in the text you’re typing. * **Click a suggestion in the`/` command or `@` file list** to accept it. Hovering highlights the row under your cursor. - * **Click an option in a select menu** to choose it. This covers permission prompts, `/model`, `/config`, and other dialogs that show a list of options. Hovering shows a pointer on the row under your cursor. Requires Claude Code v2.1.187 or later. + * **Click an option in a select menu** to choose it. This covers permission prompts, `/model`, `/config`, and other dialogs that show a list of options. Hovering shows a pointer on the row under your cursor. * **Click an option in a multi-select menu** to toggle it, and click the submit button to confirm your choices. Clicking a free-text row, such as the `Other` row in a multiple-choice question, focuses its input field so you can type an answer. Requires Claude Code v2.1.208 or later. * **Click a setting’s value in the`/config` panel** to change it, and scroll the settings list with the mouse wheel. Requires Claude Code v2.1.271 or later. + * **Scroll a select or multi-select menu with the mouse wheel** when it has more options than it shows at once, such as the `/model` list in a short terminal window. The wheel scrolls the list while the pointer is over its options. Requires Claude Code v2.1.280 or later. * **Click a collapsed tool result** to expand it and see the full output. Click again to collapse. The tool call and its result expand together. Only messages that have more to show are clickable. * Clicking also expands the output of a `!` shell command, whether an older truncated result or the live progress row while the command runs. Requires Claude Code v2.1.257 or later. * **Hold`Cmd` on macOS, or `Ctrl` on Linux and Windows, and click a URL or file path** to open it. Plain `http://` and `https://` URLs open in your browser, and file paths in tool output, like the ones printed after an Edit or Write, open in your default application. A plain click without the modifier doesn’t open links, matching native terminal behavior.
modified Claude Code GitHub Actions View current →
--- a/github-actions.md +++ b/github-actions.md @@ -34,7 +34,7 @@ * Run `/install-github-app` again. When the repository already has a `claude.yml`, select **Update workflow file with latest version**. Claude Code pushes fresh copies of the workflow files to a new branch and opens the pull request, the same as a first install. * Add the `--comment` argument and the `claude_args` line from the review workflow example to the checked-in file yourself, which keeps any other edits you made to it. -After installing the GitHub App, Claude Code asks whether to continue with GitHub Actions setup. Choose **Skip for now** to stop with only the GitHub App installed. Run `/install-github-app` again later to finish the workflow and secret steps. Before v2.1.187, Claude Code proceeded straight to workflow selection. +After installing the GitHub App, Claude Code asks whether to continue with GitHub Actions setup. Choose **Skip for now** to stop with only the GitHub App installed. Run `/install-github-app` again later to finish the workflow and secret steps. * When you install the GitHub App, you grant it several permissions. See GitHub App permissions for the full set * Quick setup works with the Claude API and Claude subscriptions. If you use Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, see [Use Claude Code GitHub Actions with cloud providers](</docs/en/github-actions-cloud-providers>) @@ -223,7 +223,7 @@ The `prompt` input accepts a [skill](</docs/en/skills>) invocation as well as plain text: * For a skill in your repository’s `.claude/skills/` directory, run `actions/checkout` before the `anthropics/claude-code-action` step so the skill files are available on the runner, then pass `/skill-name` as the `prompt`. - * For a skill packaged in a [plugin](</docs/en/plugins>), install the plugin with the `plugin_marketplaces` and `plugins` inputs, then pass the namespaced `/plugin-name:skill-name` as the `prompt`. The `plugins` input takes `plugin-name@marketplace-name`, where the marketplace name comes from the marketplace’s own manifest rather than its repository URL. + * For a skill packaged in a [plugin](</docs/en/plugins/overview>), install the plugin with the `plugin_marketplaces` and `plugins` inputs, then pass the namespaced `/plugin-name:skill-name` as the `prompt`. The `plugins` input takes `plugin-name@marketplace-name`, where the marketplace name comes from the marketplace’s own manifest rather than its repository URL. The following workflow installs the `code-review` plugin and runs its skill when a pull request is opened, updated, reopened, or marked ready for review. It runs the same plugin as the review workflow from quick setup. Use a workflow like this when you want to control the prompt, model, and triggers yourself. For automatic reviews without maintaining a workflow file, see [Code Review](</docs/en/code-review>). On public repositories, GitHub withholds secrets from runs triggered by fork pull requests, so the review runs only on pull requests from branches in the same repository.
modified Claude Code with GitHub Enterprise Server View current →
--- a/github-enterprise-server.md +++ b/github-enterprise-server.md @@ -75,7 +75,7 @@ Checks| Read and write| Posting Code Review check runs Actions| Read| Reading CI status for auto-fix Commit statuses| Read| Reading CI status from providers that report commit statuses instead of check runs -Repository hooks| Read and write| Creating a webhook on a plugin marketplace repository when **Sync automatically** is turned on for a marketplace in [Organization settings > Plugins](<https://claude.ai/admin-settings/plugins>) +Repository hooks| Read and write| Creating a webhook on a plugin marketplace repository when **Sync automatically** is turned on for a marketplace in [**Organization settings > Plugins & skills**](<https://claude.ai/admin-settings/skills?tab=marketplaces>) Metadata| Read| Required by GitHub for all apps Organization members| Read| Matching the Claude GitHub App on github.com, which uses it to check a connecting user’s organization role when linking an installation @@ -154,7 +154,7 @@ /plugin marketplace add git@github.example.com:platform/claude-plugins.git -Claude Code runs git non-interactively and rejects SSH connections to hosts that are not in the machine’s `known_hosts` file. An HTTPS URL with a git credential helper avoids the `known_hosts` requirement. See [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>) for the full guide to building marketplaces. +Claude Code runs git non-interactively and rejects SSH connections to hosts that are not in the machine’s `known_hosts` file. An HTTPS URL with a git credential helper avoids the `known_hosts` requirement. See [Create and distribute a plugin marketplace](</docs/en/plugins/create-marketplace>) for the full guide to building marketplaces. ### @@ -268,7 +268,7 @@ * [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>): run Claude Code sessions on cloud infrastructure * [Code Review](</docs/en/code-review>): automated PR reviews - * [Plugin marketplaces](</docs/en/plugin-marketplaces>): build and distribute plugin catalogs + * [Plugin marketplaces](</docs/en/plugins/host-marketplace>): build and distribute plugin catalogs * [Analytics](</docs/en/analytics>): track usage and contribution metrics * [Managed settings](</docs/en/settings>): organization-wide policy configuration * [Network configuration](</docs/en/network-config>): firewall and IP allowlist requirements
modified Glossary View current →
--- a/glossary.md +++ b/glossary.md @@ -82,7 +82,7 @@ Bare mode -With `--bare`, Claude Code starts without loading hooks, skills, custom commands, subagents, plugins, MCP servers, auto memory, or CLAUDE.md, apart from skills in a directory you pass with `--add-dir`. Recommended for CI and scripted calls where you need the same result on every machine. Learn more: [Start faster with bare mode](</docs/en/headless#start-faster-with-bare-mode>) +With `--bare`, Claude Code starts without loading hooks, skills, custom commands, subagents, installed plugins, MCP servers, auto memory, or CLAUDE.md, apart from skills in a directory you pass with `--add-dir`. Recommended for CI and scripted calls where you need the same result on every machine. Learn more: [Start faster with bare mode](</docs/en/headless#start-faster-with-bare-mode>) ### @@ -342,7 +342,7 @@ Plugin -A bundle of skills, hooks, subagents, and MCP servers packaged as a single installable unit. Plugin skills are namespaced as `plugin-name:skill-name` so multiple plugins coexist. Distribute plugins across teams via a [marketplace](</docs/en/plugin-marketplaces>). Learn more: [Plugins](</docs/en/plugins>) +A bundle of skills, hooks, subagents, and MCP servers packaged as a single installable unit. Plugin skills are namespaced as `plugin-name:skill-name` so multiple plugins coexist. Distribute plugins across teams via a [marketplace](</docs/en/plugins/overview>). Learn more: [Plugins](</docs/en/plugins/overview>) ###
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -28,7 +28,7 @@ Start faster with bare mode -Add `--bare` to reduce startup time by skipping auto-discovery of hooks, skills, custom commands, [subagents](</docs/en/sub-agents>), plugins, MCP servers, auto memory, and CLAUDE.md. Without it, `claude -p` loads the same [context](</docs/en/how-claude-code-works#the-context-window>) an interactive session would, including anything configured in the working directory or `~/.claude`. Bare mode is useful for CI and scripts where you need the same result on every machine. A hook in a teammate’s `~/.claude` or an MCP server in the project’s `.mcp.json` won’t run, because bare mode never reads them. A directory you name with `--add-dir` is a partial exception: bare mode loads skills from its `.claude/skills/` folder, but still skips its `.claude/commands/` and `.claude/agents/` folders. [Skills from additional directories](</docs/en/skills#skills-from-additional-directories>) covers what does and doesn’t load. Without `--bare`, a `-p` session runs the hooks in a project’s `.claude/settings.json` and connects the servers in its `.mcp.json`, even in a folder you’ve never trusted. A `-p` session shows no workspace trust dialog and no per-server approval prompt. [What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) covers each kind of repository content under `-p` and how to keep it out. This example runs a one-off summarize task in bare mode and pre-approves the Read tool so the call completes without a permission prompt. Set `ANTHROPIC_API_KEY` before running it, because bare mode doesn’t use your subscription login: +Add `--bare` to reduce startup time by skipping auto-discovery of hooks, skills, custom commands, [subagents](</docs/en/sub-agents>), installed plugins, MCP servers, auto memory, and CLAUDE.md. Without it, `claude -p` loads the same [context](</docs/en/how-claude-code-works#the-context-window>) an interactive session would, including anything configured in the working directory or `~/.claude`. Bare mode is useful for CI and scripts where you need the same result on every machine. A hook in a teammate’s `~/.claude` or an MCP server in the project’s `.mcp.json` won’t run, because bare mode never reads them. A directory you name with `--add-dir` is a partial exception: bare mode loads skills from its `.claude/skills/` folder, but still skips its `.claude/commands/` and `.claude/agents/` folders. [Skills from additional directories](</docs/en/skills#skills-from-additional-directories>) covers what does and doesn’t load. Without `--bare`, a `-p` session runs the hooks in a project’s `.claude/settings.json` and connects the servers in its `.mcp.json`, even in a folder you’ve never trusted. A `-p` session shows no workspace trust dialog and no per-server approval prompt. [What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) covers each kind of repository content under `-p` and how to keep it out. This example runs a one-off summarize task in bare mode and pre-approves the Read tool so the call completes without a permission prompt. Set `ANTHROPIC_API_KEY` before running it, because bare mode doesn’t use your subscription login: claude --bare -p "Summarize README.md" --allowedTools "Read"
modified Automate actions with hooks View current →
--- a/hooks-guide.md +++ b/hooks-guide.md @@ -1,4 +1,4 @@ -Hooks are user-defined shell commands. Claude Code runs them at specific points in its lifecycle, which gives you deterministic control: certain actions always happen rather than relying on the LLM to choose to run them. Use hooks to enforce project rules, automate repetitive tasks, and integrate Claude Code with your existing tools. For decisions that require judgment rather than deterministic rules, you can also use prompt-based hooks or agent-based hooks that use a Claude model to evaluate conditions. For other ways to extend Claude Code, see [skills](</docs/en/skills>) for giving Claude additional instructions and executable commands, [subagents](</docs/en/sub-agents>) for running tasks in isolated contexts, and [plugins](</docs/en/plugins>) for packaging extensions to share across projects. +Hooks are user-defined shell commands. Claude Code runs them at specific points in its lifecycle, which gives you deterministic control: certain actions always happen rather than relying on the LLM to choose to run them. Use hooks to enforce project rules, automate repetitive tasks, and integrate Claude Code with your existing tools. For decisions that require judgment rather than deterministic rules, you can also use prompt-based hooks or agent-based hooks that use a Claude model to evaluate conditions. For other ways to extend Claude Code, see [skills](</docs/en/skills>) for giving Claude additional instructions and executable commands, [subagents](</docs/en/sub-agents>) for running tasks in isolated contexts, and [plugins](</docs/en/plugins/overview>) for packaging extensions to share across projects. This guide covers common use cases and how to get started. For full event schemas, JSON input/output formats, and advanced features like async hooks and MCP tool hooks, see the [Hooks reference](</docs/en/hooks>). @@ -626,7 +626,7 @@ } } -The `"Edit|Write"` matcher fires only when Claude uses the `Edit` or `Write` tool, not when it uses `Bash`, `Read`, or any other tool. On Claude Code v2.1.191 or later, a comma separates alternatives the same way, so `"Edit, Write"` is equivalent. See [Matcher patterns](</docs/en/hooks#matcher-patterns>) for how plain names and regular expressions are evaluated. +The `"Edit|Write"` matcher fires only when Claude uses the `Edit` or `Write` tool, not when it uses `Bash`, `Read`, or any other tool. A comma separates alternatives the same way, so `"Edit, Write"` is equivalent. See [Matcher patterns](</docs/en/hooks#matcher-patterns>) for how plain names and regular expressions are evaluated. Claude can also create or modify files by running shell commands. If your hook must see every file change, such as for compliance scanning or audit logging, add a [`Stop`](</docs/en/hooks#stop>) hook that scans the working tree once per turn. For per-call coverage instead, also match `Bash|PowerShell` and have your script list modified and untracked files with `git status --porcelain`. The [PowerShell hook input section](</docs/en/hooks#powershell>) explains why matching `Bash` alone is not enough. To run a hook when a specific file changes on disk, whatever wrote it, use a [FileChanged](</docs/en/hooks#filechanged>) hook. @@ -766,7 +766,7 @@ `.claude/settings.json`| Single project| Yes, can be committed to the repo `.claude/settings.local.json`| Single project| No, gitignored when Claude Code saves a setting to it Managed policy settings| Organization-wide| Yes, admin-controlled -[Plugin](</docs/en/plugins>) `hooks/hooks.json`| When plugin is enabled| Yes, bundled with the plugin +[Plugin](</docs/en/plugins/overview>) `hooks/hooks.json`| When plugin is enabled| Yes, bundled with the plugin [Skill](</docs/en/skills>) frontmatter| The rest of the session once the skill is invoked. See [Hooks in skills and agents](</docs/en/hooks#hooks-in-skills-and-agents>)| Yes, defined in the skill file [Subagent](</docs/en/sub-agents>) frontmatter| While that subagent is running| Yes, defined in the subagent file
added Host and maintain a marketplace View current →
Show diff (449 lines)
--- a/host-marketplace.md +++ b/host-marketplace.md @@ -0,0 +1,446 @@ +Hosting a marketplace means putting your `marketplace.json` catalog where other people can add it with `/plugin marketplace add`, install its plugins, and keep receiving your changes after you push. This page is for the person who operates a marketplace. + +These cases are covered on other pages: + + * **You haven’t written the catalog file yet** : start with [Create a marketplace](</docs/en/plugins/create-marketplace>) + * **You’re an admin requiring, restricting, or pre-installing marketplaces across your organization’s machines** : read [Manage plugins for your organization](</docs/en/plugins/org>) + +Start with Host your marketplace to pick a host and the command your users run. Read Keep users up to date before your first release. Read Rename or remove a plugin before you change a plugin’s `name`. + +## + +​ + +Host your marketplace + +You can host the marketplace on GitHub, on another git host, as a hosted `marketplace.json` URL, or in a directory on a shared filesystem. Send your users the add command for your host and tell them what they need on their machine: + +Host| Users run, in a Claude Code session| What users need +---|---|--- +GitHub| `/plugin marketplace add your-org/your-marketplace`| `git`, and for a private repository the access described under Grant access to a private marketplace +GitLab, Bitbucket, GitHub Enterprise Server, or another git host| `/plugin marketplace add https://gitlab.example.com/team/plugins.git`| `git`, and access to the host from their machine. Send the full URL, because `owner/repo` shorthand always means github.com +A hosted `marketplace.json` URL| `/plugin marketplace add https://plugins.example.com/marketplace.json`| HTTPS access to the URL. Users don’t need `git` for the catalog itself +A directory on a shared filesystem| `/plugin marketplace add /Volumes/shared/claude-plugins`| Read access to the path + +To pin a branch or tag of a GitHub or git-URL marketplace, tell users to append `#<ref>`, as in `your-org/your-marketplace#stable`. The [plugin commands reference](</docs/en/plugins/cli-reference#plugin-marketplace-add>) lists every form the command accepts. A successful add prints `Successfully added marketplace: your-marketplace`. Claude Code takes that name from the `name` field in your `marketplace.json`, not from the repository name. Users then install a plugin by its entry’s `name` and the marketplace’s `name`, as in `/plugin install code-formatter@your-marketplace`. + +### + +​ + +Register the marketplace for everyone in a repository + +To share the marketplace with everyone who works in one repository, run `claude plugin marketplace add your-org/your-marketplace --scope project` there once from your shell and commit the `.claude/settings.json` it writes. Claude Code then registers the marketplace for each teammate who [trusts the folder](</docs/en/plugins/org#require-plugins-per-repository>). + +### + +​ + +Avoid relative-path entries in a URL-hosted marketplace + +When users add your marketplace as a bare `marketplace.json` URL, Claude Code downloads only that file. An entry in your `plugins` array whose `source` is a relative path such as `./plugins/formatter` then fails at install with [`its marketplace entry path does not stay inside the marketplace directory`](</docs/en/plugins/troubleshooting#plugins-with-relative-paths-fail-in-url-based-marketplaces>). Give every entry a source that can be fetched on its own, such as a `github` repository or an `archive` URL, or host the marketplace in a git repository so Claude Code clones the whole tree. + +### + +​ + +Edit plugins in place on a shared directory + +When users add your marketplace from a shared directory, Claude Code reads plugins with relative-path sources directly from that directory instead of copying them. Users see your edits when they next start a session or run `/reload-plugins`, without an update step or a version bump. + +### + +​ + +Keep plugin files out of Git LFS + +Keep the files your plugins need out of [Git LFS](<https://git-lfs.com>). When users add a marketplace hosted in a git repository, or install a git-based plugin it lists, Claude Code clones that marketplace or plugin repository onto their machine. The clone never downloads LFS content, so LFS-tracked files arrive as pointer files. + +### + +​ + +Share files within a marketplace with symlinks + +To share files between your plugin and other parts of the same marketplace, create symbolic links inside your plugin directory. When Claude Code copies the plugin into its cache, it handles each symlink by where the target resolves: + + * **Within the plugin’s own directory** : the symlink is preserved as a relative symlink in the cache, so it keeps resolving to the copied target at runtime. + * **Elsewhere within the same marketplace** : the symlink is dereferenced. The target’s content is copied into the cache in its place. This lets a meta-plugin’s `skills/` directory link to skills defined by other plugins in the marketplace. + * **Outside the marketplace** : the symlink is skipped for security. + +For plugins installed from a local path, or from a [`command` source](</docs/en/plugins/marketplace-reference#command-plugin-source>) whose `mode` is the default `copy`, Claude Code preserves only symlinks that resolve within the plugin’s own directory and skips all others. The following command creates a link from inside a marketplace plugin to a shared skill defined by a sibling plugin. On Windows, use `mklink /D` from an elevated Command Prompt or enable Developer Mode: + + ln -s ../../shared-plugin/skills/foo ./skills/foo + +## + +​ + +Distribute through organization settings + +On a Team or Enterprise plan, you can also distribute the marketplace through [**Organization settings > Plugins & skills**](<https://claude.ai/admin-settings/skills?tab=inventory>) on claude.ai instead of hosting it somewhere users add it themselves. Organization sync reads the repository through your organization’s GitHub or GitLab connection on claude.ai, so your users’ git credentials aren’t involved. Organization sync is stricter about the repository than `/plugin marketplace add` is: + + * **Marketplace repository** : on github.com and gitlab.com, it must be private or internal + * **Plugin sources** : each plugin source must be of type `github`, `url`, or `git-subdir`, or a [relative path](</docs/en/plugins/marketplace-reference#relative-path-plugin-source>) that starts with `./` + * **Top-level`bin/` directory**: claude.ai rejects a plugin that has one and syncs the rest of the marketplace. The error message starts with `Plugin contains a top-level bin/ directory`. Keep executables in another directory, such as `scripts/`, and reference them as `${CLAUDE_PLUGIN_ROOT}/scripts/<name>` from your hooks or MCP server configs + +See [Manage plugins for your organization](<https://support.claude.com/en/articles/13837433>) for the admin workflow. + +## + +​ + +Grant access to a private marketplace + +When a user adds, installs from, or updates your marketplace, Claude Code runs `git` on their machine with interactive prompts turned off and relies on whatever credentials that machine already holds. Claude Code has no git token of its own, and `marketplace.json` has no field for one. You choose whether the clone runs over SSH or HTTPS by the form of the add command you send users: + + * **GitHub`owner/repo`**: Claude Code probes `ssh -T git@github.com` and clones over SSH when the probe succeeds. If the probe fails, or the SSH clone itself fails, it clones over HTTPS. Users on machines without a GitHub SSH key can set `CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1` to skip the probe and clone over HTTPS. + * **`git@host:path.git`** : SSH. + * **`https://example.com/repo.git`** : HTTPS. + +Tell users what each protocol needs on their machine: + + * **SSH** : the key must work without a passphrase prompt, for example because it’s loaded in `ssh-agent`. The host must already be in `known_hosts`. + * **HTTPS** : Claude Code leaves the user’s git credential helper enabled but forbids it from prompting. A credential the helper already stores works; one it would have to ask for fails. On GitHub, `gh auth login` followed by `gh auth setup-git` stores one. + +For a GitHub Enterprise Server host, users need git access to that host from their machine. See [Plugin marketplaces on GHES](</docs/en/github-enterprise-server#plugin-marketplaces-on-ghes>) for what each Claude Code surface needs to reach a GHES-hosted marketplace. If you distribute through **Organization settings > Plugins & skills** on claude.ai instead, your users’ git credentials aren’t involved. See Distribute through organization settings for which plugin sources can be private there. + +### + +​ + +Serve users who have no git-host account + +Users without a git-host account can add a marketplace you serve as a `marketplace.json` URL or from a shared directory, but they can install only the plugins whose entry sources they can also reach. An entry that points at a private `github` repository still fails at install for them, because Claude Code fetches it with the same non-interactive `git` it uses for a git-hosted marketplace. These entry sources need no git account: + + * **`archive`** : a zip downloaded over HTTPS. Users need neither `git` nor an account, only network access to the URL. Requires Claude Code v2.1.224 or later. Pin each archive with `sha256` so Claude Code refuses a changed download. To send credentials with the download, see Authenticate archive downloads. + * **A public git repository** : Claude Code clones a public `url` or `git-subdir` source over HTTPS without credentials when the entry gives an `https://` URL. For a `github` source, or a `git-subdir` source written as `owner/repo`, users without a GitHub SSH key set `CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`. + +For a team on one network, a `directory` marketplace on a shared filesystem also works without git accounts. Users need only read access to the path. + +### + +​ + +What background auto-update does with credentials + +Background auto-update is Claude Code’s unattended refresh of marketplaces and installed plugins after a session starts. It’s off for your marketplace until a user or admin turns it on, as covered under Keep users up to date. When it’s on for a private marketplace, the background check for new commits uses the user’s configured git credential helpers and never prompts. Each kind of remote and helper gives a different result: + + * **SSH remotes** : a key loaded in `ssh-agent` authenticates the check. + * **HTTPS remotes with a stored credential** : a helper that can supply a stored credential without prompting authenticates the check. Git Credential Manager, the macOS Keychain helper, and `git-credential-store` work this way once they hold a credential for the host. + * **HTTPS remotes with a helper that needs to prompt** : the helper can’t answer in the background. The update fails quietly and the existing checkout stays in place, so the user’s plugins keep working from the last synced state. + +After the check, Claude Code does one of the following: + + * **The checkout is up to date** : Claude Code leaves it as it is. + * **The check finds new commits, or fails because it can’t reach or authenticate to the remote** : Claude Code clones the marketplace again and replaces the existing checkout with the new clone. If that clone fails, the existing checkout stays in place. The re-clone can [time out on large repositories](</docs/en/plugins/troubleshooting#git-clone-timed-out-after-120s>). + +To keep a private marketplace current, a user can do either of the following: + + * **Store a credential** : sign in to the credential helper first so it holds a credential for the host. For GitHub, run `gh auth login`, then `gh auth setup-git`. + * **Keep the checkout on failure** : if the user sets `CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1`, Claude Code keeps the existing checkout without attempting the re-clone when the background check can’t reach or authenticate to the remote. Plugins keep working from the last synced state. + +If a user sets `GITHUB_TOKEN` or another provider token in the environment, that alone doesn’t authenticate the background check. A token takes effect through a credential helper, such as the `gh` CLI’s helper, which reads `GH_TOKEN` and `GITHUB_TOKEN`. + +## + +​ + +Roll out to a whole company + +Rolling a plugin out to a company involves you as the marketplace owner, an administrator who controls managed settings, and each person who uses Claude Code. You can run the rollout without the administrator, in which case each person adds the marketplace and installs the plugin themselves. + +Who| What they do| Where it’s covered +---|---|--- +You, the marketplace owner| Keep the catalog in a repository only the company can read, send the add command for your host, and say what each person needs on their machine| Host your marketplace and Grant access to a private marketplace +An administrator| Registers the marketplace and turns its plugins on for everyone with `extraKnownMarketplaces` and `enabledPlugins` in managed settings, and sets `autoUpdate` there| [Require a marketplace and its plugins](</docs/en/plugins/org#require-a-marketplace-and-its-plugins>) and [Set update policy](</docs/en/plugins/org#set-update-policy>) +Each person| Needs read access to a private git repository, with credentials already stored on their machine. Without an administrator, they also run the add and install commands| [Add a private marketplace](</docs/en/plugins/install#add-a-private-marketplace>) + +For people who have no git-host account, these sections each cover one way to reach them: + + * **Entry sources that need no git account** : Serve users who have no git-host account + * **A pre-populated plugins directory** : [Seed containers and CI](</docs/en/plugins/org#seed-containers-and-ci>), which also serves users who have no git-host account + * **claude.ai organization settings** : Distribute through organization settings, where your users’ git credentials aren’t involved + +## + +​ + +Keep users up to date + +Your changes reach users through background auto-update, once it’s turned on for your marketplace, or when users update the plugin themselves. In both cases a user gets a new copy of a plugin only when its computed version changes, as described under Release a new version. + +### + +​ + +Turn on auto-update + +Background auto-update is off for your marketplace by default, and `marketplace.json` has no field to turn it on. A user or an admin turns it on: + + * **Tell users to turn it on** : each user goes to **Marketplaces** in `/plugin`, selects your marketplace, and selects **Enable auto-update**. + * **Ask an admin to set it** : if an admin sets `"autoUpdate": true` on your marketplace’s `extraKnownMarketplaces` entry in managed settings, it’s on for everyone who receives those settings. See [Set update policy](</docs/en/plugins/org#set-update-policy>). + +Without auto-update, users receive your changes when they run `/plugin marketplace update <name>` in a session or `claude plugin update <plugin>@<name>` in the shell. For what users see when an update reaches them, see [When auto-update runs](</docs/en/plugins/loading#when-auto-update-runs>). + +### + +​ + +Release a new version + +To release a new version to users, change the plugin’s `version`. Users get a new copy only when the plugin’s computed version differs from the one they have. That version comes from `plugin.json` first, then from the marketplace entry, per [Versions and updates](</docs/en/plugins/loading#versions-and-updates>). A plugin that users [load in place](</docs/en/plugins/loading#find-plugins-on-disk>) from a marketplace they added as a local directory isn’t controlled by `version`. It loads your current files at every session start, whatever its version string says. For every install other than an in-place load or one from a `command` source, either increase `version` on each release or omit it: + + * **Bump`version` on each release**: users stay on their cached copy until the string changes. If you set `"version": "1.0.0"` and push new commits without changing it, users don’t receive them. + * **Omit`version`**: users track your commits instead. Leave `version` out of both `plugin.json` and the marketplace entry. + +Don’t set `version` in both `plugin.json` and the marketplace entry. If you do, Claude Code uses the `plugin.json` value without warning, and `claude plugin validate` reports the mismatch as `Entry declares version "<a>" but <path>/plugin.json says "<b>"`. + +### + +​ + +Hold users on one version + +One marketplace serves one version of each plugin at a time, so you hold users on a version by choosing what each entry points at: + + * **`ref` and `sha` on the plugin entry**: `ref` names a branch or tag and `sha` names a commit for a `github`, `url`, or `git-subdir` source. See [Plugin sources](</docs/en/plugins/marketplace-reference#plugin-sources>). + * **`#<ref>` on the add command**: users who add `your-org/your-marketplace#stable` get that branch or tag of the catalog. For two release lines at once, see Run release channels. + * **`<plugin>--v<version>` tags**: a dependency’s version range resolves against these tags. See [Release a plugin that others depend on](</docs/en/plugins/dependencies#tag-plugin-releases-for-version-resolution>). + +Release a new version says when a changed entry reaches users. + +### + +​ + +Change the command of a command source + +If you change the `command` of a [`command` source](</docs/en/plugins/marketplace-reference#command-plugin-source>), or switch its `mode`, each user has to accept the new command before Claude Code runs it. Claude Code runs only the exact command a user accepted when they installed or last updated the plugin. After a user’s copy of your marketplace picks up the change, that user sees the following: + + * **No more background runs** : the [once-per-session run](</docs/en/plugins/loading#when-a-command-source-re-runs>) of the command stops for that user, so the tool’s new output doesn’t reach them. + * **An entry in the`/plugin` Errors tab**: the entry shows the new command and the `claude plugin update` command to run. + +Tell users to run the `claude plugin update` command that entry shows, in a terminal. Claude Code shows them the new command and asks them to accept it. + +## + +​ + +Run release channels + +To offer stable and early-access tracks, host two marketplaces whose entries point at different refs of the same plugin, and let each user add the one they want. Claude Code has no release-channel concept, and one marketplace serves one version of each plugin at a time. Give the two `marketplace.json` files different `name` values. Claude Code identifies a marketplace by its `name`, so a user can’t have two marketplaces with the same name registered at once. With these two catalogs, users who add `stable-tools` install `code-formatter` from the `stable` branch, and users who add `latest-tools` install it from `latest`: + + { + "name": "stable-tools", + "owner": { "name": "Your Org" }, + "plugins": [ + { "name": "code-formatter", "source": { "source": "github", "repo": "your-org/code-formatter", "ref": "stable" } } + ] + } + + { + "name": "latest-tools", + "owner": { "name": "Your Org" }, + "plugins": [ + { "name": "code-formatter", "source": { "source": "github", "repo": "your-org/code-formatter", "ref": "latest" } } + ] + } + +Give the two refs different `plugin.json` versions, or omit `version` so the commit SHA distinguishes them. Updates are detected by comparing versions, so a ref that moves without a version change leaves users on the cached copy. To assign the channels to user groups instead of letting users choose, an admin gives each group the matching `extraKnownMarketplaces` entry, as described under [Set update policy](</docs/en/plugins/org#set-update-policy>). + +## + +​ + +Rename or remove a plugin + +A plugin’s `name` is its identifier. Users reference it in the `enabledPlugins` and `pluginConfigs` settings keys and in `/plugin install`, so changing it breaks every existing install. To change the label users see in `/plugin` without breaking anything, set `displayName` in `plugin.json` and keep `name` unchanged. + +### + +​ + +Migrate users with a renames map + +When you must change a `name`, add a top-level `renames` map to `marketplace.json` so Claude Code migrates existing users instead of reporting [`Plugin "<name>" not found in marketplace`](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>). Do the same when you remove an entry from `plugins`. Automatic migration requires Claude Code v2.1.193 or later. Map each former name to its current name, or to `null` when the plugin is gone. This marketplace renames `formatter` to `code-formatter` and records that `legacy-linter` was removed: + + { + "name": "your-marketplace", + "owner": { "name": "Your Org" }, + "plugins": [ + { "name": "code-formatter", "source": "./plugins/code-formatter" } + ], + "renames": { + "formatter": "code-formatter", + "legacy-linter": null + } + } + +After you push, a user who still has the old name enabled sees one of these results: + + * **Renamed entry** : the plugin loads under its new name. `claude plugin list` and the plugin’s details under `/plugin` show `Renamed to "code-formatter" in the "your-marketplace" marketplace` once, and Claude Code rewrites the old key to the new one in `enabledPlugins` and `pluginConfigs` in the user, project, and local settings scopes. + * **`null` entry**: the old key is dropped from those scopes and the user sees `Removed from the "your-marketplace" marketplace`. + * **Enabled in managed settings** : the plugin still loads under its new name, but Claude Code can’t rewrite managed settings, so the notice recurs until an admin updates `enabledPlugins` there. + +For a marketplace users added from a git repository or URL, a renamed plugin reports [`Plugin "<name>" not cached at <path>`](</docs/en/plugins/troubleshooting#plugin-not-cached-at>) until the user runs `/plugin install code-formatter@your-marketplace` once in a session. Treat `renames` as append-only history. Keep old entries after everyone has migrated. When you rename again, add a second entry rather than editing the first, because Claude Code follows the chain from the oldest name. In your shell, run `claude plugin validate .` after editing the map. It rejects a chain that cycles or that ends anywhere other than `null` or a name in `plugins`, with `renames.<name>: chain does not resolve`. + +### + +​ + +Uninstall removed plugins from users’ machines + +To uninstall a removed plugin from users’ machines rather than leave a copy behind, set `"forceRemoveDeletedPlugins": true` at the top level of `marketplace.json`. Without the field, a removed plugin stays installed and reports `Plugin "<name>" not found in marketplace` when a session loads it. With it, Claude Code does the following at each session start: + + 1. Compares what users installed from your marketplace against the entries and the `renames` map, and treats any plugin that is neither listed nor renamed as removed. + 2. Uninstalls each removed plugin from the user, project, and local scopes. Plugins that only managed settings installed stay in place. + 3. Lists each removed plugin under a **Flagged** heading in `/plugin` with the status `Removed from marketplace`. + +## + +​ + +Authenticate archive downloads + +To authenticate an [`archive`](</docs/en/plugins/marketplace-reference#archive-plugin-source>) download, such as a download from a private registry, set the HTTP headers Claude Code sends with it. You can set `headers` in either of these places: + + * **The marketplace’s`url` source**: the `url` source you registered the marketplace from, such as an [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) entry. + * **The plugin’s entry** : on Claude Code v2.1.238 or later, you can set it on the plugin’s `marketplace.json` entry instead, beside `source`. + +In either place, set a `headersHelper` command instead of `headers` when the value is short-lived, such as a token your registry generates on request. Claude Code runs the command and sends the JSON object it prints as that place’s headers. Requires Claude Code v2.1.238 or later. The [marketplace reference](</docs/en/plugins/marketplace-reference#plugin-entries>) lists the `headers` and `headersHelper` entry fields. The place you choose decides which downloads get the headers and when Claude Code runs the command: + +Place| Downloads that get the headers| When Claude Code runs a `headersHelper` set there +---|---|--- +Marketplace `url` source| Archive downloads on the marketplace URL’s origin, meaning the same scheme, host, and port| Before each fetch of the marketplace’s `marketplace.json` and before each archive download on that origin. Claude Code reuses one run’s output for up to 60 seconds +Plugin entry| That entry’s download only| Only when a user installs or updates that one plugin by itself and accepts the command + +Where both places set a header of the same name, Claude Code sends the entry’s value. Within one place, a header the command prints overrides a header of the same name listed in `headers`. + +### + +​ + +Add a headersHelper to a plugin entry + +This entry sets `headersHelper` beside `source`. It also sets [`"strict": false`](</docs/en/plugins/marketplace-reference#strict-mode>), which Claude Code requires of a `marketplace.json` entry that sets `headersHelper`: + + { + "name": "my-plugin", + "description": "Formatting commands for internal services", + "strict": false, + "source": { + "source": "archive", + "url": "https://registry.example.com/plugins/my-plugin-2.1.0.zip" + }, + "headersHelper": "/opt/bin/mint-registry-token.sh" + } + +To check the entry, run `claude plugin install my-plugin@your-marketplace` in your shell. Claude Code shows you the command and the archive URL, and downloads the zip after you accept. + +### + +​ + +Write the headersHelper command + +Whether you set `headersHelper` on a marketplace’s `url` source or on a plugin entry, write the command to meet these requirements: + + * **Command text** : at most 500 characters of printable ASCII, with no run of four or more spaces. + * **Output** : print one JSON object of header names and string values on stdout, then exit 0 within 10 seconds. + * **Shell and working directory** : Claude Code runs the command through `sh`, or through `cmd.exe` on Windows. The working directory is the configuration directory, which is `~/.claude` or [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars#variables>). Give an absolute path or a command on `PATH`, because a relative path resolves against that directory, not the user’s project. + * **Variables Claude Code removes** : when the command is set in a `marketplace.json` entry, or in a project’s `.claude/settings.json` or `.claude/settings.local.json`, Claude Code removes from the environment every variable whose name looks like a credential, by the [same rule it applies to an MCP `headersHelper`](</docs/en/mcp#which-variables-a-helper-can-read>). `ANTHROPIC_API_KEY` and `MY_REGISTRY_TOKEN` are both removed, so have the command read its credential from a file or a credential store. This removal doesn’t apply to a command set in user settings, a `--settings` file, or managed settings. + * **Variables Claude Code sets** : `CLAUDE_CODE_MARKETPLACE_URL` and `CLAUDE_CODE_MARKETPLACE_NAME` for a `url` source’s command, and `CLAUDE_CODE_PLUGIN_NAME` and `CLAUDE_CODE_PLUGIN_ARCHIVE_URL` for an entry’s command. `CLAUDE_CODE_MARKETPLACE_NAME` is unset on the first fetch after a user adds a marketplace by URL, because that fetch is what supplies the name. + +A command that mints a bearer token prints an object like this one: + + {"Authorization": "Bearer eyJhbGciOiJSUzI1NiJ9"} + +### + +​ + +When Claude Code skips a headersHelper command or drops its output + +A `headersHelper` command doesn’t run, or headers from `headers` or from the command’s output are dropped, when one of the following applies: + + * **Command fails** : if the command exits non-zero, runs past 10 seconds, or prints anything other than a JSON object of string values, the fetch or download the command was run for doesn’t happen. + * **Marketplace URL doesn’t start with`https://`**: that `url` source’s command doesn’t run, and requests carry only the headers listed in its `headers` field. + * **Redirect leaves the origin** : when a download is redirected off the archive URL’s origin, the redirected request carries no `headers` values or command output from either the marketplace `url` source or the plugin entry. + * **Entry sets a routing or identity header** : Claude Code drops request-routing and client-identity names such as `Host`, `Cookie`, and `X-Forwarded-*` from an entry’s `headers` and command output, and keeps authentication names such as `Authorization`. Every `marketplace.json` entry is filtered this way. For an inline plugin entry in settings, see [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>). + * **Command set in an`--add-dir` directory’s settings**: the command is ignored, on a `url` source and on an [inline plugin entry](</docs/en/settings-reference#extraknownmarketplaces>) alike, and only that file’s `headers` are sent. + * **Managed settings block the command** : setting [`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>) to `true` blocks `headersHelper` commands, and [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) blocks them too unless `disableCommandPluginSources` is explicitly `false`. Under either block, Claude Code still runs the command for a marketplace that managed settings themselves declare. + +### + +​ + +How users accept a headersHelper command + +A user accepts a plugin entry’s command each time they install or update that one plugin by itself. They do that from the plugin’s own view in `/plugin`, or with `claude plugin install` or `claude plugin update`. Claude Code shows the command and the archive URL, and runs the command only after the user accepts. In a non-interactive shell, pass [`--yes`](</docs/en/plugins/cli-reference#plugin-install>) to accept the command. To accept only the command that a previous `--json` run displayed, pass [`--accept-command`](</docs/en/plugins/cli-reference#plugin-install>) with the `sha256` the run reported. Claude Code runs only the command it showed, for the archive URL it showed. If the entry’s command or archive URL changed in between, Claude Code refuses the install or update. A change in the query string alone doesn’t count. + +### + +​ + +Installs and updates that refuse a command instead of asking + +On any operation other than a single-plugin install or update, Claude Code neither runs an entry’s command nor downloads its archive. The plugin stays at its installed version or stays uninstalled, and the user sees one of these results: + + * **Installing several plugins at once, from a plugin suggestion, or as another plugin’s dependency** : Claude Code refuses the plugin that has the command and directs the user to that plugin’s own view in `/plugin`. The other plugins in a bulk install still install. A plugin that depends on the refused plugin fails to install until the user installs the refused plugin by itself. + * **Background auto-update, or session start for a plugin whose archive was never downloaded** : Claude Code lists the plugin in the `/plugin` Errors tab so the user knows to install or update it themselves. + +### + +​ + +When a marketplace `url` source’s command runs + +You declare a marketplace `url` source’s `headersHelper` in a settings file, such as an [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) entry, rather than in the catalog the marketplace publishes. Claude Code therefore doesn’t ask the user to accept it on each install or update. Instead, the settings file that declares it decides when Claude Code runs it: + +Settings file| When Claude Code runs the command +---|--- +User settings, a `--settings` file, or a managed settings file on the machine| Without asking, including during a background marketplace refresh +A project’s `.claude/settings.json` or `.claude/settings.local.json`| Only after the user accepts the [workspace trust dialog](</docs/en/permissions#what-runs-before-you-trust-a-folder>) for that folder itself. A `-p` or SDK session doesn’t count as accepting it, and neither does trust granted to a parent folder +Server-managed settings| In an interactive session, only after the user approves the delivered settings in the [security approval dialog](</docs/en/server-managed-settings#security-approval-dialogs>) + +For an [inline plugin entry](</docs/en/settings-reference#extraknownmarketplaces>) in one of these files, Claude Code requires the same folder trust or settings approval as for a marketplace-level command in that file, and the user also accepts the entry’s command on each install or update. + +## + +​ + +Depend on and recommend other plugins + +An entry can declare dependencies on other plugins. + + * **Version ranges** : a dependency can carry a semver range. + * **Cross-marketplace dependencies** : a dependency from another marketplace installs only when your marketplace lists that marketplace in `allowCrossMarketplaceDependenciesOn`. + +For version ranges, the `<plugin>--v<version>` git-tag convention they resolve against, and cross-marketplace trust, see [Plugin dependencies](</docs/en/plugins/dependencies>). To have Claude Code suggest a plugin when a project matches it, add a `relevance` block to the entry with the signals that identify the project. Users see suggestions from your marketplace only when an admin lists it in `pluginSuggestionMarketplaces`. For the signals and the enablement step, see [Plugin relevance](</docs/en/plugins/relevance>). + +## + +​ + +Work around what a marketplace can’t do + +Some things owners ask for have no field in `marketplace.json`. Here is the nearest option for each: + + * **Restrict what else users install** : the marketplace allowlist is a managed setting, `strictKnownMarketplaces`. See [Restrict what users can install](</docs/en/plugins/org#restrict-what-users-can-install>). + * **Install or enable a plugin without the user asking** : no entry field installs a plugin. Managed `enabledPlugins` does that for a fleet; see [Pre-install and require plugins](</docs/en/plugins/org#pre-install-and-require-plugins>). + * **Show different entries to different users** : entries carry no audience field, and every user who adds the marketplace sees the whole catalog. Host separate marketplaces for separate audiences. + * **Mark a plugin deprecated** : there is no deprecation state. The option is to remove the entry, map its name to `null` in `renames`, and optionally set `forceRemoveDeletedPlugins`. + * **Turn on auto-update for your users** : each user turns it on under **Marketplaces** in `/plugin`, or an admin sets `autoUpdate` in managed settings. See Turn on auto-update. + * **Carry git credentials** : no marketplace field holds a git token. Access to a git-hosted marketplace or plugin follows the user’s git setup, per Grant access to a private marketplace. For `archive` sources, an entry can set `headers` or `headersHelper` instead. + +## + +​ + +Next steps + + * [Marketplace reference](</docs/en/plugins/marketplace-reference>): `marketplace.json` fields, source types, and validation messages + * [Manage plugins for your organization](</docs/en/plugins/org>): require, restrict, or seed your marketplace across your organization’s machines + * [Plugin dependencies](</docs/en/plugins/dependencies>): tag releases so plugins that depend on yours can resolve versions + * [Troubleshoot plugins](</docs/en/plugins/troubleshooting>): the errors your users see when adding or updating from your marketplace
modified How Claude Code works View current →
--- a/how-claude-code-works.md +++ b/how-claude-code-works.md @@ -30,7 +30,7 @@ **Search**| Find files by pattern, search content with regex, explore codebases **Execution**| Run shell commands, start servers, run tests, use git **Web**| Search the web, fetch documentation, look up error messages -**Code intelligence**| See type errors and warnings after edits, jump to definitions, find references (requires [code intelligence plugins](</docs/en/discover-plugins#code-intelligence>)) +**Code intelligence**| See type errors and warnings after edits, jump to definitions, find references (requires [code intelligence plugins](</docs/en/plugins/code-intelligence>)) These are the primary capabilities. Claude also has tools for spawning subagents, asking you questions, and other orchestration tasks. See [Tools available to Claude](</docs/en/tools-reference>) for the complete list. Claude chooses which tools to use based on your prompt and what it learns along the way. When you say “fix the failing tests,” Claude might:
added Install and manage plugins View current →
Show diff (407 lines)
--- a/install.md +++ b/install.md @@ -0,0 +1,404 @@ +Installing a plugin adds its skills, agents, hooks, and MCP servers to Claude Code on your machine. This page is for anyone using plugins on their own machine or account, whether in the terminal, the desktop app, an IDE, or a cloud session: it covers installing, choosing a scope, adding marketplaces, and keeping plugins updated. + +These cases are covered on other pages: + + * **You use claude.ai chat or Cowork, not Claude Code** : see [Plugins on claude.ai and in Cowork](<https://claude.com/docs/plugins/overview>) + * **Claude Code printed an error** : find it in [Troubleshoot plugins](</docs/en/plugins/troubleshooting>) + +Start with Install a plugin. If someone sent you an install command whose `@` name isn’t `claude-plugins-official`, add that marketplace first. + +## + +​ + +Install a plugin + +As an example, this section installs [`commit-commands`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/commit-commands>) from [Anthropic’s official marketplace](</docs/en/plugins/anthropic-marketplaces>), which adds commands for committing, pushing, and opening pull requests. The same steps install any other plugin: substitute its name and its marketplace’s name wherever `commit-commands` and `claude-plugins-official` appear. If that plugin comes from a different marketplace, add the marketplace first. Pick the tab for where you run Claude Code. + + * Terminal + + * Desktop app + + * VS Code + + * Cloud session + +Start Claude Code with `claude` in your project, then: + +1 + +Open the plugin's details with the install command + +Run `/plugin install` with the plugin’s name and marketplace. In a session, this command doesn’t install right away: it opens the `/plugin` panel on that plugin’s details so you can review it and choose a scope first. + + /plugin install commit-commands@claude-plugins-official + +To browse instead, run `/plugin` with no plugin name: the panel opens on the **Discover** tab, which lists plugins from every marketplace you’ve added, and you can type to search, then press **Enter** on a plugin to open its details. + +2 + +Review what the plugin adds + +The details pane shows the plugin’s description. It can also show: + + * **Will install** : the commands, agents, skills, hooks, and MCP and LSP servers the plugin adds. + * **Last updated** : shown for a plugin in Anthropic’s official marketplace. + * **Context cost** : for a plugin in Anthropic’s official marketplace, two token estimates. **Every turn** is what the plugin adds to each message you send, and **When invoked** is what its skills and agents add once Claude loads them. The estimates appear when you open the plugin by naming its marketplace, as the step 1 command does, or from the **Marketplaces** tab. The details pane you reach from the **Discover** list doesn’t show them. + +Plugins from a local or custom marketplace can show `Components will be discovered at installation` instead.A plugin can run hooks and MCP servers, so read the pane before you install. See [Plugin security and trust](</docs/en/plugins/security>). + +3 + +Choose a scope + +Select one of the three install options: + + * **Install for you (user scope)** : you get the plugin in every project on this machine + * **Install for all collaborators on this repository (project scope)** : it’s enabled for everyone who works in this repository + * **Install for you, in this repo only (local scope)** : you get it in this repository only + +Choose an install scope says which settings file each one writes to and which applies when the same plugin is set at more than one.After you select a scope, Claude Code installs the plugin along with any dependencies it declares, then prints an install summary. + +4 + +Read the install summary + +The last sentence of the summary tells you whether the plugin is usable in this session yet: + + * **Active now** : `Plugin is now active.` No reload is needed. + * **Reload needed** : `Run /reload-plugins to activate.` The panel closes and Claude Code runs that reload for you. If the reload would [invalidate the prompt cache](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>), it warns and leaves the plugin pending instead. Run `/reload-plugins --force` to activate it anyway, which costs one uncached request. + * **Load failed** : `The plugin couldn't be loaded`. Open the **Errors** tab in `/plugin` for the reason, then see [After install: plugin not working](</docs/en/plugins/troubleshooting#plugin-installed-but-not-working>). + +5 + +Confirm the plugin works + +Type `/` and look for the plugin’s skills under its name, in the form `/<plugin>:<skill>`. For `commit-commands`, `/commit-commands:commit` appears. Two other places list the plugin too: + + * Open the **Installed** tab in `/plugin`, which lists the plugin with its scope. + * In your shell, run `claude plugin list`, which prints the same list with `Version`, `Scope`, and `Status` lines. + +If `/commit-commands:commit` doesn’t appear, see [After install: plugin not working](</docs/en/plugins/troubleshooting#plugin-installed-but-not-working>). + +Installing from any other marketplace requires one extra step first: add the marketplace. Claude Code adds Anthropic’s official marketplace for you the first time you start an interactive terminal session, which is why the example skips that step. If you found a plugin on [claude.com/marketplace](<https://claude.com/marketplace>), its **Claude Code** button copies the install command in its shell form, `claude plugin install <name>@claude-plugins-official`. + +In a local or SSH session in the desktop app’s **Code** tab: + +1 + +Open the plugin browser + +Click the **+** button next to the prompt box and select **Plugins** , then **Add plugin**. The plugin browser opens with the plugins from your marketplaces. + +2 + +Select the plugin + +Find `commit-commands` and select it. + +3 + +Choose a scope + +Choose a scope: your user account, this project, or local-only. + +To enable, disable, or uninstall later, use **+ > Plugins > Manage plugins**. The plugin browser isn’t available in the desktop app’s cloud sessions. See [Install plugins in the desktop app](</docs/en/desktop#install-plugins>). + +In the Claude Code panel in VS Code: + +1 + +Open Manage plugins + +Type `/plugins` in the prompt box to open **Manage plugins**. + +2 + +Install the plugin + +On the **Plugins** tab, search for `commit-commands` and click **Install**. If the tab lists no plugins, add `anthropics/claude-plugins-official` on the **Marketplaces** tab first. + +3 + +Choose a scope + +Choose a scope: **Install for you** , **Install for this project** , or **Install locally**. + +Your changes apply to open sessions without a restart. See [Manage plugins in VS Code](</docs/en/vs-code#manage-plugins>). + +A [cloud session](</docs/en/cloud-environments>), including [the browser at claude.ai/code](</docs/en/claude-code-on-the-web>), has no plugin browser and doesn’t load the plugins you installed on your own machine or the ones your repository’s `.claude/settings.json` turns on. For plugins your organization distributes through managed settings, see [Manage plugins for your organization](</docs/en/plugins/org>).See [which parts of your setup are also available in a cloud session](</docs/en/cloud-environments#what-carries-over-from-your-setup>) for the rest of your setup. + +### + +​ + +Choose an install scope + +A plugin’s install scope decides who gets the plugin and which settings file records it as enabled: + + * **User scope** : the plugin is enabled for you in every project on this machine. The entry goes in `enabledPlugins` in `~/.claude/settings.json`. + * **Project scope** : the plugin is enabled for everyone who works in this repository. The entry goes in `.claude/settings.json`, which you commit. + * **Local scope** : the plugin is enabled for you in this repository only. The entry goes in `.claude/settings.local.json`. + +Some plugins are set by their author to start turned off, through the [`defaultEnabled`](</docs/en/plugins/manifest-reference#defaultenabled>) field. Such a plugin is installed but stays off until you turn it on with `claude plugin enable <name>` in your shell, or from the **Installed** tab of `/plugin` in a session. When the same plugin is set at several scopes, the local setting overrides the project setting, and the project setting overrides the user setting. See [Find where a plugin is enabled](</docs/en/plugins/loading#find-where-a-plugin-is-enabled>) for the full rule. The terminal, the desktop app’s local sessions, and the VS Code extension on one computer read the same settings files, so a plugin you install at user scope in any of them is available in the other two. + +### + +​ + +JetBrains, non-interactive runs, and the Agent SDK + +Some places you run Claude Code have no plugin browser of their own: + + * **JetBrains IDEs** : the JetBrains plugin runs Claude Code in the IDE’s terminal, so use the **Terminal** tab’s steps there. + * **`claude -p` and other non-interactive runs**: `/plugin` doesn’t run, and Claude replies `/plugin isn't available in this environment.` Plugins you already installed do load. Install and manage them from your shell with `claude plugin` commands. + * **Agent SDK** : load plugins through the SDK’s plugin option. See [Load plugins in the Agent SDK](</docs/en/agent-sdk/plugins>). + +If Claude Code reports that a plugin enabled in the repository’s `.claude/settings.json` isn’t installed, see [Enabled in project settings but not installed](</docs/en/plugins/loading#enabled-in-project-settings-but-not-installed>). + +If you’re a plugin author testing a copy of your plugin on disk, start Claude Code from your shell with `--plugin-dir` to load it for one session instead of installing it. See [Flags that load a plugin for one session](</docs/en/plugins/cli-reference#flags-that-load-a-plugin-for-one-session>). + +### + +​ + +Plugins from your claude.ai account + +Your claude.ai account is a separate source of plugins, alongside the marketplaces you install from: + + * **What arrives** : every plugin you turn on for your claude.ai account, and every plugin your organization turns on for its members. In a terminal session they sync in the background each time you start Claude Code while signed in with that account; in Cowork sessions they download when the session starts. + * **Where you see them** : in `/plugin` and `claude plugin list` under the ID `<name>@synced`. You can turn one off at your own scope unless your organization requires it. + * **What doesn’t go the other way** : plugins you install with `/plugin` or `claude plugin install` stay on this machine and aren’t added to your claude.ai account. + +For sync timing, sign-in requirements, and turning sync off, see [Plugins synced from claude.ai](</docs/en/plugins/loading#synced-plugins>). + +### + +​ + +Install from your shell + +Run `claude plugin install` in your shell to install a plugin without starting a Claude Code session, for example from a setup script. + + * **Scope** : user scope by default. Pass `--scope project` or `--scope local` to change it. + * **When the plugins load** : plugins it installs load the next time you start Claude Code, or when you run `/reload-plugins` in a session that’s already open. + * **The marketplace must be added first** : on a machine where no one has opened an interactive Claude Code session yet, the official marketplace isn’t registered, so a script that installs from it runs `claude plugin marketplace add anthropics/claude-plugins-official` before the install. + + claude plugin install formatter@your-org --scope project + +The command prints `Successfully installed plugin: formatter@your-org (scope: project)` when it finishes. Some plugins install by running a command that their marketplace names, called a [`command` source](</docs/en/plugins/marketplace-reference#command-plugin-source>). Claude Code shows you that command and asks you to accept it before it runs. A script has no one to answer that prompt, so pass `--yes` there to accept it. For every `claude plugin install` flag, see [plugin install](</docs/en/plugins/cli-reference#plugin-install>). + +## + +​ + +Add a marketplace + +You only need this section when the plugin you want isn’t in Anthropic’s official marketplace, for example one a coworker published or one from Anthropic’s community marketplace. A marketplace is a catalog of plugins, and Claude Code has to know about a marketplace before you can install from it. You add a marketplace once. After that, its plugins appear on the **Discover** tab and install with `/plugin install <plugin>@<marketplace>` in a session or `claude plugin install <plugin>@<marketplace>` in your shell, where `<marketplace>` is the name the marketplace registered under. To do both in one step, see Add a marketplace and install in one command. In a Claude Code session, run `/plugin marketplace add` followed by the marketplace’s source: a GitHub repository, a git repository on any host, a local directory or file, or a hosted `marketplace.json`. + +Source| What you type| Example +---|---|--- +GitHub repository| `owner/repo`. Add `#ref` to pin a branch or tag.| `/plugin marketplace add anthropics/claude-code`, or `/plugin marketplace add your-org/plugins#v1.2.0` to pin the `v1.2.0` tag +Git repository on any host| The full clone URL. Add `#ref` to pin a branch or tag.| `/plugin marketplace add https://gitlab.example.com/your-group/your-marketplace.git#v1.0.0` +Local directory or file| A relative or absolute path to a directory that holds `.claude-plugin/marketplace.json`, or to the JSON file itself. Start a relative path with `./` or `../`, because Claude Code reads a bare `name/name` as a GitHub repository.| `/plugin marketplace add ./my-marketplace` +Hosted `marketplace.json`| Its `https://` URL| `/plugin marketplace add https://example.com/marketplace.json` + +From your shell, `claude plugin marketplace add` takes the same sources. + +`/plugin market` also works as a shorter form of `/plugin marketplace`. + +Include the `https://` prefix on every URL, or use the `git@host:path` form for SSH. If you type a bare `gitlab.example.com/your-group/your-marketplace.git`, Claude Code reads it as GitHub `owner/repo` shorthand and rejects it. When the command succeeds, it prints `Successfully added marketplace: <name>`, and the marketplace’s plugins appear on the **Discover** tab the next time you open `/plugin`, with no reload needed. If it fails, match the error message in [Troubleshoot plugins](</docs/en/plugins/troubleshooting#add-a-marketplace>). + +### + +​ + +Add a marketplace and install in one command + +To install a plugin from a marketplace you haven’t added yet, run `/plugin install` in a Claude Code session and name the marketplace source with `--marketplace`. Requires Claude Code v2.1.275 or later. + + /plugin install deploy-helper --marketplace your-org/plugins + +The source takes the same forms as `/plugin marketplace add`, such as GitHub `owner/repo`, a git URL, or a local path, except that it can’t contain spaces. Give the plugin name by itself, without an `@marketplace` suffix. If you haven’t added that marketplace yet, Claude Code shows the source it resolved and asks you to confirm before adding it. Once the marketplace is added, the plugin’s details open and you choose an installation scope. If the source matches a marketplace you’ve already added, Claude Code skips the confirmation and opens the plugin’s details in that marketplace. + +### + +​ + +Add a private marketplace + +A private marketplace is one in a repository you need credentials to clone, on GitHub or any other git host. You add it with the same `/plugin marketplace add` or `claude plugin marketplace add` command as a public one. Claude Code clones it with the git credentials already on your machine and never prompts, so each way of connecting has a requirement: + + * **HTTPS** : your git credential helpers apply, so access you set up with `gh auth login`, the macOS Keychain, or `git-credential-store` works. Interactive prompts are suppressed, so a host you have never authenticated to fails instead of asking for a password. + * **SSH** : the host must already be in your `known_hosts` file and the key must work without a passphrase prompt, because the host-fingerprint and passphrase prompts are suppressed too. + * **GitHub`owner/repo` shorthand**: Claude Code checks whether your SSH key authenticates to `github.com`, then clones over SSH if it does and over HTTPS if it doesn’t. Set [`CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`](</docs/en/env-vars#variables>) to skip that check and always clone over HTTPS. + +The same credentials apply when you run `/plugin install`, `/plugin marketplace update`, and `claude plugin update`. On a GitHub Enterprise Server host, see [Plugin marketplaces on GHES](</docs/en/github-enterprise-server#plugin-marketplaces-on-ghes>) for the credentials each operation needs. If your organization registers the marketplace for you through managed settings, you don’t add it yourself. See [Pre-install and require plugins](</docs/en/plugins/org#pre-install-and-require-plugins>). + +### + +​ + +Add a marketplace from claude.ai + +In terminal sessions where [plugins sync from your claude.ai account](</docs/en/plugins/loading#synced-plugins>), claude.ai can also list plugin marketplaces for you, such as your organization’s plugin library and your own claude.ai uploads. You add one of these by its name rather than by a source. Adding a marketplace from claude.ai requires Claude Code v2.1.273 or later. Add a claude.ai marketplace from the `/plugin` panel or from your shell: + + * **Inside a session** : run `/plugin` and go to the **Marketplaces** tab, which lists the marketplaces from claude.ai. Select one there to add it. + * **From your shell** : run `claude plugin marketplace list`, which prints them in a `From claude.ai:` section. Then run `claude plugin marketplace add` with the `--claudeai` flag and the name shown in the list. + +For example, this command adds a marketplace named `claudeai-organization-library`: + + claude plugin marketplace add --claudeai claudeai-organization-library + +Claude Code registers the marketplace under a local name that starts with `claudeai-`, derived from the name that claude.ai lists it under. For example, a marketplace listed as “Organization library” becomes `claudeai-organization-library`. Install its plugins by that name, for example with `claude plugin install <plugin>@claudeai-organization-library`. If you sign out, or sign in to a different claude.ai organization, the marketplace stays configured but shows no plugins, and the plugins you already installed from it keep loading. The `From claude.ai:` section can also list git-based marketplaces shared through claude.ai, and it prints a source for each of those. Add them by that source as in Add a marketplace, not with `--claudeai`. + +## + +​ + +Manage installed plugins + +The **Installed** tab in `/plugin` lists your plugins with actions to enable, disable, update, or uninstall each one. In a Claude Code session, run `/plugin` and press **Tab** to reach it, or run `/plugin enable`, `/plugin disable`, or `/plugin uninstall` to open the panel and make that change there. Disabled plugins are grouped under a collapsed header at the bottom of the list. Use these keys on the list: + + * Type to filter by name or description. + * Press **Space** to enable or disable the selected plugin, and **f** to favorite it. + * Press **Enter** to open a plugin’s details. The menu there offers **Disable plugin** or **Enable plugin** , **Update now** , and **Uninstall**. Plugins that take settings also offer **Configure options**. + +The tab can also show plugins at **Managed** scope. Your organization installed those through [managed settings](</docs/en/settings#settings-files>), and you can’t enable, disable, or uninstall them here. For a synced plugin that your organization requires on claude.ai, see Manage plugins synced from claude.ai. When you close the `/plugin` panel with pending changes you made in it, Claude Code runs `/reload-plugins` for you to apply them. If the reload would [invalidate the prompt cache](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>), it warns and leaves the changes pending instead. Run `/reload-plugins --force` to apply them anyway. + +### + +​ + +Manage plugins synced from claude.ai + +The **Installed** tab in `/plugin` also lists the [plugins synced from your claude.ai account](</docs/en/plugins/loading#synced-plugins>), with `synced` as their source. Synced plugins appear in terminal sessions on Claude Code v2.1.273 or later. + + * **Enable or disable** : use the **Installed** tab, unless your organization marked the plugin as required. + * **Remove** : turn the plugin off on claude.ai. + +When Claude Code syncs an added, updated, or removed plugin into an interactive session, you see `Plugins changed. Run /reload-plugins to activate.` Run `/reload-plugins` to load the change in that session, or leave it for the next time you start Claude Code. + +### + +​ + +Uninstall a plugin the project enables + +When you choose **Uninstall** for a plugin that this repository’s `.claude/settings.json` enables, whether from the **Installed** tab or with `/plugin uninstall`, Claude Code asks whether to disable it for you or uninstall it for everyone: + + * **Disable for me** : press **y**. Claude Code writes `false` for the plugin in your `.claude/settings.local.json` and leaves it installed for the project. + * **Uninstall for everyone** : press **u**. Claude Code removes the plugin from the shared `.claude/settings.json`. + +### + +​ + +See what an installed plugin adds to your sessions + +In your shell, run `claude plugin details <name>` for an installed plugin. The `Always-on` line is the number of tokens the plugin adds to every session where it’s enabled, and the per-component rows show which skill or agent contributes most. For the full output and what each figure means, see [Measure what a plugin costs](</docs/en/plugins/measure#measure-what-a-plugin-costs>). + +### + +​ + +Find plugins you no longer use + +On the **Installed** tab in `/plugin`, plugins you installed yourself and haven’t used recently appear under a **Not used recently** header, and each plugin’s details show a **Last used** line. Use that header and that line to find plugins that still add startup and context cost, then disable or uninstall them. + +### + +​ + +Plugins with dependencies + +A plugin can declare other plugins that it depends on. When you install, disable, or uninstall such a plugin from a marketplace, Claude Code acts on those dependencies too: + + * **Install** : Claude Code also installs and enables the plugin’s declared dependencies at the same scope. The success message lists them. + * **Enable** : Claude Code also enables the plugin’s dependencies that are installed but disabled. If a declared dependency isn’t installed, the enable fails and the message tells you to install it first. + * **Disable** : when another enabled plugin still needs the one you named, Claude Code refuses and prints a chained command that disables both in the right order. + * **Uninstall** : auto-installed dependencies stay until you run `claude plugin prune` in your shell; see [plugin prune](</docs/en/plugins/cli-reference#plugin-prune>). + +If you loaded the plugin with `--plugin-dir` instead, see [Test a plugin and its dependency locally](</docs/en/plugins/dependencies#test-a-plugin-and-its-dependency-locally>). + +### + +​ + +Manage plugins from your shell + +You can also manage plugins without starting a Claude Code session. In your shell, run `claude plugin install`, `enable`, `disable`, or `uninstall` as ordinary terminal commands; they change the same settings the `/plugin` panel does. Each takes `--scope` to target one scope, and uses a default scope when you omit it: + + * `enable` and `disable` act on the most specific scope whose settings already list the plugin. + * `install` and `uninstall` act on user scope. + +For example, these commands disable and re-enable a plugin, then uninstall it at project scope: + + claude plugin disable formatter@your-org + claude plugin enable formatter@your-org + claude plugin uninstall formatter@your-org --scope project + +## + +​ + +Keep plugins updated + +Plugins update automatically when the marketplace they came from has auto-update turned on. After a session starts, Claude Code refreshes those marketplaces and updates the on-disk copies of the plugins you installed from them. The running session keeps the versions it already loaded. After an update, you see `Plugin updated: <name> · Run /reload-plugins to apply`, and the next session loads the new versions automatically. These are the auto-update defaults for each kind of marketplace: + + * **On by default** : `claude-plugins-official` and the other [official marketplace names](</docs/en/plugins/security#official-marketplace-names>) except `knowledge-work-plugins` and `first-party-plugins`, plus marketplaces added from claude.ai. + * **Off by default** : every other marketplace, including the community marketplace, third-party marketplaces, and local development marketplaces. + +For when auto-update runs, which plugins it skips, and the environment variables that turn it off, see [When auto-update runs](</docs/en/plugins/loading#when-auto-update-runs>). + +### + +​ + +Turn auto-update on or off for a marketplace + +In a Claude Code session, run `/plugin` and go to the **Marketplaces** tab. Select the marketplace, then select **Enable auto-update** or **Disable auto-update**. + +### + +​ + +Update one plugin now + +In a session, open the plugin on the **Installed** tab in `/plugin` and select **Update now** , or in your shell run `claude plugin update <plugin>@<marketplace>`. + +### + +​ + +Auto-update from a private marketplace + +For a private marketplace, see [What background auto-update does with credentials](</docs/en/plugins/host-marketplace#what-background-auto-update-does-with-credentials>) for how background auto-updates authenticate over SSH and HTTPS, and [Troubleshoot plugins](</docs/en/plugins/troubleshooting#add-a-marketplace>) for the messages you see when they fail. + +## + +​ + +Manage marketplaces + +The **Marketplaces** tab in `/plugin` lists every marketplace you registered, along with its source. Select one to browse its plugins, update its listing, turn auto-update on or off, or remove it. You can also list, update, and remove marketplaces with commands, from your shell or inside a session: + +Action| In your shell| Inside a session +---|---|--- +List marketplaces| `claude plugin marketplace list`| `/plugin marketplace list` +Update a marketplace’s listing| `claude plugin marketplace update <name>`| `/plugin marketplace update <name>` +Remove a marketplace| `claude plugin marketplace remove <name>`| `/plugin marketplace remove <name>` + +When you remove a marketplace, Claude Code uninstalls every plugin you installed from it and removes their `enabledPlugins` entries from your settings files. The **Marketplaces** tab names those plugins before it asks you to confirm. + +## + +​ + +Next steps + + * [Anthropic’s marketplaces](</docs/en/plugins/anthropic-marketplaces>): how the official, community, and demo marketplaces differ and where to browse each one + * [Plugin loading reference](</docs/en/plugins/loading>): why a plugin loaded, didn’t load, or didn’t change after an update + * [Plugin security and trust](</docs/en/plugins/security>): what to review before you install a plugin from a marketplace you don’t know + * [Troubleshoot plugins](</docs/en/plugins/troubleshooting>): install and marketplace error messages with their fixes + * [Create a plugin](</docs/en/plugins/create>): build your own
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -24,14 +24,14 @@ `Ctrl+V` or `Cmd+V` (iTerm2) or `Alt+V` (Windows and WSL)| Paste image from clipboard| Inserts an `[Image #N]` chip at the cursor so you can reference it positionally in your prompt. On WSL, both `Ctrl+V` and `Alt+V` are bound; use `Alt+V` if your terminal intercepts `Ctrl+V` `Ctrl+B`| Background running tasks| Backgrounds Bash commands and agents. Tmux users press twice `Ctrl+T`| Toggle Claude’s task checklist| Show or hide Claude’s to-do checklist in the status area. This is not the background-task view; use [`/tasks`](</docs/en/commands>) to see running shells and subagents -`Ctrl+S`| Stash or restore prompt| With text in the input, stashes it and clears the prompt. Pressed again on an empty prompt, restores the stashed text, cursor position, and pasted content +`Ctrl+S`| Stash or restore prompt| With text in the input, stashes it and clears the prompt. Pressed again on an empty prompt, restores the stashed text, cursor position, pasted content, and input mode, so a stashed `!` shell command comes back in shell mode `Ctrl+Z`| Suspend Claude Code| Unix only. Suspends the process to your shell; run `fg` to resume `Left/Right arrows`| Cycle through dialog tabs| Navigate between tabs in permission dialogs and menus `Tab`| Accept an autocomplete suggestion, or add a comment to a permission answer| While autocomplete suggestions are showing in the prompt input, accepts the selected suggestion. On most permission prompts, with **Yes** or **No** focused, opens a comment field on that option, and pressing it again closes the field. See [add a comment when you answer a permission prompt](</docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt>) `Up/Down arrows` or `Ctrl+P`/`Ctrl+N`| Move cursor or navigate command history| When the input spans more than one visual row, whether wrapped or multiline, first moves the cursor within the prompt. Once the cursor is on the first or last visual row, pressing again navigates command history. While you have messages queued, `Up` from the first row instead takes them back `Esc`| Interrupt Claude, or close a dialog| Stop the current response or tool call mid-turn so you can redirect. Claude keeps the work done so far. If you have messages queued, Claude Code sends them next. When a dialog is open, `Esc` closes the dialog. On a permission prompt, `Esc` declines the action, the same as [**No** without a comment](</docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt>) `Esc` \+ `Esc`| Clear input draft, or rewind| When the prompt input contains text, double `Esc` clears it and saves the draft to history so `Up` recalls it. When the input is empty, double `Esc` opens the [rewind menu](</docs/en/checkpointing>) to restore or summarize code and conversation from a previous point -`Ctrl+Enter` or `Ctrl+X Ctrl+S`| Send queued messages now| Interrupts the current turn so your queued messages, and your draft with them, go out right away instead of when the turn ends. In shell mode, the key queues your command without interrupting. In terminals that don’t report extended keys, `Ctrl+Enter` arrives as plain `Enter`; `Ctrl+X Ctrl+S` works in any terminal. Requires Claude Code v2.1.275 or later +`Ctrl+Enter` or `Ctrl+X Ctrl+S`| Send queued messages now| Sends your queued messages, and your draft with them, right away. When Claude Code sends what you queued covers what happens to the turn Claude is working on. In shell mode, the key only queues your command. In terminals that don’t report extended keys, `Ctrl+Enter` arrives as plain `Enter`; `Ctrl+X Ctrl+S` works in any terminal. Requires Claude Code v2.1.275 or later `Shift+Tab`, or `Alt+M` on Windows when the Node or Bun runtime doesn’t enable VT input mode| Cycle permission modes| Cycle through `default` (labeled Manual in the mode indicator), `acceptEdits`, `plan`, and, when available, `bypassPermissions` and then `auto`. From `auto`, the first press switches to `default`. See [permission modes](</docs/en/permission-modes>). On a file permission prompt, the same key closes an open [comment field](</docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt>). With no field open, it selects the option that allows the action for the rest of the session, when the prompt offers that option `Option+P` (macOS) or `Alt+P` (Windows/Linux)| Switch model| Switch models without clearing your prompt `Option+T` (macOS) or `Alt+T` (Windows/Linux)| Toggle extended thinking| Enable or disable extended thinking mode. Has no effect on Opus 5.5 or the Fable models, which always use extended thinking. Works on macOS without configuring Option as Meta @@ -136,7 +136,7 @@ Commands -Type `/` in Claude Code to see the commands available to you, or type `/` followed by any letters to filter. The `/` menu lists built-in commands, bundled and user-authored [skills](</docs/en/skills>), and commands contributed by [plugins](</docs/en/plugins>) and [MCP servers](</docs/en/mcp#use-mcp-prompts-as-commands>). Not all built-in commands are visible to every user since some depend on your platform or plan, and [a few available commands are hidden from the menu by design](</docs/en/commands#how-the-command-menu-matches-what-you-type>) and run when you type their full name. In [fullscreen rendering](</docs/en/fullscreen#use-the-mouse>), the `/` command and `@` file suggestion lists also respond to the mouse: hovering highlights a row and clicking accepts it. See the [commands reference](</docs/en/commands>) for the full list of commands included in Claude Code. +Type `/` in Claude Code to see the commands available to you, or type `/` followed by any letters to filter. The `/` menu lists built-in commands, bundled and user-authored [skills](</docs/en/skills>), and commands contributed by [plugins](</docs/en/plugins/overview>) and [MCP servers](</docs/en/mcp#use-mcp-prompts-as-commands>). Not all built-in commands are visible to every user since some depend on your platform or plan, and [a few available commands are hidden from the menu by design](</docs/en/commands#how-the-command-menu-matches-what-you-type>) and run when you type their full name. In [fullscreen rendering](</docs/en/fullscreen#use-the-mouse>), the `/` command and `@` file suggestion lists also respond to the mouse: hovering highlights a row and clicking accepts it. See the [commands reference](</docs/en/commands>) for the full list of commands included in Claude Code. ### @@ -408,7 +408,12 @@ * Messages: if you queue a message while Claude is running tool calls, Claude Code passes it to Claude as soon as those tool calls finish, within the same turn. When the turn ends with messages still queued, they go out without another key press, in the order you typed them * Commands and shell commands: Claude Code holds them until the turn ends, then runs them one at a time, keeping the order you queued them in -To send what you queued without waiting for the turn to finish, press `Ctrl+Enter`. Claude Code interrupts the turn, and your queued messages go out right away, with your draft queued behind them if you had typed one. In shell mode, the key queues your command without interrupting the turn. Requires Claude Code v2.1.275 or later. In terminals that don’t report extended keys, `Ctrl+Enter` arrives as plain `Enter` and queues the draft instead; `Ctrl+X Ctrl+S` works in any terminal. Both keys are bindings of the [`chat:sendNow` action](</docs/en/keybindings#chat-actions>). Press `Esc` to interrupt the turn without submitting your draft. Claude Code keeps what you queued and sends it right away. Claude Code runs some commands as soon as you send them instead of queueing them, among them `/model`, `/effort`, and `/fast`. Each of the three changes a setting: the model, the effort level, or fast mode. Whether Claude Code applies the new setting to the turn Claude is already working on, or only from your next turn, differs by command: +To send what you queued without waiting, press `Ctrl+Enter`. Your queued messages go out right away, with your draft queued behind them if you had typed one. Requires Claude Code v2.1.275 or later. If you queued a `!` shell command ahead of your messages, the key interrupts the turn. Otherwise, what happens to the turn depends on what Claude is doing when you press the key: + + * Running shell commands, subagents, or other work that can move to the background: that work moves to the background and keeps running, and Claude reads your messages in the same turn + * Only writing a response, or running something that can’t move to the background: Claude Code interrupts the turn and sends your messages next. Before v2.1.281, the key interrupted the turn in both cases + +In shell mode, the key only queues your command. In terminals that don’t report extended keys, `Ctrl+Enter` arrives as plain `Enter` and queues the draft instead; `Ctrl+X Ctrl+S` works in any terminal. Both keys are bindings of the [`chat:sendNow` action](</docs/en/keybindings#chat-actions>). Press `Esc` to interrupt the turn without submitting your draft. Claude Code keeps what you queued and sends it right away. Claude Code runs some commands as soon as you send them instead of queueing them, among them `/model`, `/effort`, and `/fast`. Each of the three changes a setting: the model, the effort level, or fast mode. Whether Claude Code applies the new setting to the turn Claude is already working on, or only from your next turn, differs by command: * [`/model`](</docs/en/model-config#setting-your-model>): once you confirm the [cache warning](</docs/en/prompt-caching#switching-models>), if Claude Code shows one, Claude Code applies your change to the next request it makes in that turn * [`/effort`](</docs/en/model-config#adjust-effort-level>): once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies your change to the next request it makes in that turn @@ -433,7 +438,7 @@ * Press `Tab` or `Right arrow` to place the suggestion in the prompt input, then `Enter` to submit * Start typing to dismiss it -Claude Code generates each of these next-prompt suggestions with a background request that reuses the conversation’s prompt cache, so the additional cost is minimal. +Claude Code generates each of these next-prompt suggestions with a short background request to the same model your session is using. The request counts toward your plan’s usage limits or your API costs. Because it reuses the conversation’s prompt cache, it is mostly cache reads plus a few output tokens, so the added cost is small. ###
modified Customize keyboard shortcuts View current →
--- a/keybindings.md +++ b/keybindings.md @@ -125,7 +125,7 @@ `chat:thinkingToggle`| Meta+T| Toggle extended thinking `chat:submit`| Enter| Submit message `chat:queueSubmit`| Ctrl+X Enter| Submit the message, marked to wait its turn: while Claude is working, Claude Code [queues it](</docs/en/interactive-mode#queue-messages-while-claude-works>) and never interrupts the turn. Unlike `chat:submit`, it submits the draft even while an autocomplete suggestion is highlighted. Requires v2.1.247 or later -`chat:sendNow`| Ctrl+Enter, Ctrl+X Ctrl+S| Interrupt the running turn so your [queued messages](</docs/en/interactive-mode#queue-messages-while-claude-works>), and your draft with them, go out right away. When nothing is running, it submits the draft, and in [shell mode](</docs/en/interactive-mode#shell-mode-with-prefix>) it queues the command without interrupting. Terminals that don’t report extended keys deliver `Ctrl+Enter` as plain `Enter`, so `Ctrl+X Ctrl+S` is the binding that works in any terminal. Requires v2.1.275 or later +`chat:sendNow`| Ctrl+Enter, Ctrl+X Ctrl+S| Send your [queued messages](</docs/en/interactive-mode#queue-messages-while-claude-works>), and your draft with them, right away. [When Claude Code sends what you queued](</docs/en/interactive-mode#when-claude-code-sends-what-you-queued>) covers what happens to the turn Claude is working on. When nothing is running, the key submits the draft, and in [shell mode](</docs/en/interactive-mode#shell-mode-with-prefix>) it only queues the command. Terminals that don’t report extended keys deliver `Ctrl+Enter` as plain `Enter`, so `Ctrl+X Ctrl+S` is the binding that works in any terminal. Requires v2.1.275 or later `chat:newline`| Ctrl+J| Insert a newline without submitting `chat:undo`| Ctrl+_, Ctrl+Shift+-| Undo last action `chat:externalEditor`| Ctrl+G, Ctrl+X Ctrl+E| Open in external editor. The [agent view dispatch input](</docs/en/agent-view#keyboard-shortcuts>) follows this action’s single-keystroke bindings too @@ -182,7 +182,7 @@ ] } -Before v2.1.280, `y` was also bound to `confirm:yes` and `n` to `confirm:no` by default. If you created your `keybindings.json` with `/keybindings` before v2.1.280, the file lists both bindings and they stay in effect until you delete those two lines. +With these bindings, `y` and `n` still type as letters while a text field has focus. Before v2.1.280, `y` was also bound to `confirm:yes` and `n` to `confirm:no` by default. If you created your `keybindings.json` with `/keybindings` before v2.1.280, the file lists both bindings and they stay in effect until you delete those two lines. ### @@ -670,6 +670,20 @@ ​ +Text fields + +If you bind a bare letter, digit, or Space, you can still type that character in a text field inside a dialog or panel. One such field is the `Other` answer to a question Claude asks. While the field has focus, a printable key you press without Ctrl, Alt, or Cmd goes to the field, and Claude Code doesn’t match it against your bindings. These keys still run their bindings while the field has focus: + + * Keys that don’t type a character, such as Enter, Escape, Tab, and the arrow keys + * Any key pressed with Ctrl, Alt, or Cmd + * The second keystroke of a chord already in progress + +At the main prompt, Claude Code matches every key against the active contexts, such as `Chat`, and types the key only when no binding takes it. + +## + +​ + Vim mode interaction When vim mode is enabled via `/config` → Editor mode, keybindings and vim mode operate independently:
modified Set up Claude Code in a monorepo or large codebase View current →
--- a/large-codebases.md +++ b/large-codebases.md @@ -184,16 +184,16 @@ Reduce file reads with code intelligence -In a large codebase, finding where a symbol is defined or used can cost many file reads and grep calls. [Code intelligence plugins](</docs/en/discover-plugins#code-intelligence>) connect Claude to a language server so it can jump to definitions, find references, and surface type errors directly instead of scanning the tree. The official marketplace has plugins for TypeScript, Python, Go, Rust, and other common languages. Run the command below inside a Claude Code session to install the TypeScript plugin: +In a large codebase, finding where a symbol is defined or used can cost many file reads and grep calls. [Code intelligence plugins](</docs/en/plugins/code-intelligence>) connect Claude to a language server so it can jump to definitions, find references, and surface type errors directly instead of scanning the tree. The official marketplace has plugins for TypeScript, Python, Go, Rust, and other common languages. Run the command below inside a Claude Code session to install the TypeScript plugin: /plugin install typescript-lsp@claude-plugins-official If the install fails, match the message Claude Code reports: * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install. - * The plugin is [not found in the marketplace](</docs/en/discover-plugins#install-plugins>): check the plugin name. - -To enable a plugin for everyone in the repository rather than installing it yourself, add it to the [`enabledPlugins` project setting](</docs/en/settings-reference#plugin-settings>). Code intelligence plugins require the language’s language server binary on each developer’s machine. See [which binary each language requires](</docs/en/discover-plugins#code-intelligence>). Installing from the official marketplace requires network access to GitHub, where the marketplace is hosted. On a restricted network, [add the marketplace from an internal Git host or local path](</docs/en/discover-plugins#add-from-other-git-hosts>) instead. This pairs well with `claudeMdExcludes` and the `Read` deny rules above. Those keep irrelevant content out of context, and code intelligence keeps Claude from reading through what remains to locate a definition. + * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name. + +To enable a plugin for everyone in the repository rather than installing it yourself, add it to the [`enabledPlugins` project setting](</docs/en/settings-reference#plugin-settings>). Code intelligence plugins require the language’s language server binary on each developer’s machine. See [which binary each language requires](</docs/en/plugins/code-intelligence>). Installing from the official marketplace requires network access to GitHub, where the marketplace is hosted. On a restricted network, [add the marketplace from an internal Git host or local path](</docs/en/plugins/install#add-a-marketplace>) instead. This pairs well with `claudeMdExcludes` and the `Read` deny rules above. Those keep irrelevant content out of context, and code intelligence keeps Claude from reading through what remains to locate a definition. ## @@ -337,7 +337,7 @@ * **From the repository root** : root skills, plus skills from every subdirectory Claude touches during the session, which can accumulate into the hundreds * **After adding a sibling with`--add-dir`**: that sibling’s skills load too. The `additionalDirectories` setting grants file access only and does not load skills -Names always load, but [when there are many, some skills lose their descriptions entirely](</docs/en/skills#skill-descriptions-are-cut-short>), which can strip the keywords Claude uses to decide whether a skill applies. Keep descriptions short and lead with words a request would contain, like “writing or modifying tests in `packages/api/`”. For skills that many directories share, such as PR conventions or a deploy checklist, place them in the repository root’s `.claude/skills/` so they load from any starting directory. When shared skills need their own version history or must work across repositories, package them as a [plugin](</docs/en/plugins>) instead. Plugin skills use a `plugin-name:skill-name` namespace, so they never collide with per-directory skills. A platform team can version and update them in one place. To find which skills go unused, enable the OpenTelemetry [logs exporter](</docs/en/monitoring-usage>) and set `OTEL_LOG_TOOL_DETAILS=1` so skill names are recorded verbatim instead of redacted. The [`skill_activated` event](</docs/en/monitoring-usage#skill-activated-event>) records every invocation in its `skill.name` attribute, and `invocation_trigger` records whether a command, Claude, or a nested skill invoked it, which tells you what to consolidate or retire. +Names always load, but [when there are many, some skills lose their descriptions entirely](</docs/en/skills#skill-descriptions-are-cut-short>), which can strip the keywords Claude uses to decide whether a skill applies. Keep descriptions short and lead with words a request would contain, like “writing or modifying tests in `packages/api/`”. For skills that many directories share, such as PR conventions or a deploy checklist, place them in the repository root’s `.claude/skills/` so they load from any starting directory. When shared skills need their own version history or must work across repositories, package them as a [plugin](</docs/en/plugins/overview>) instead. Plugin skills use a `plugin-name:skill-name` namespace, so they never collide with per-directory skills. A platform team can version and update them in one place. To find which skills go unused, enable the OpenTelemetry [logs exporter](</docs/en/monitoring-usage>) and set `OTEL_LOG_TOOL_DETAILS=1` so skill names are recorded verbatim instead of redacted. The [`skill_activated` event](</docs/en/monitoring-usage#skill-activated-event>) records every invocation in its `skill.name` attribute, and `invocation_trigger` records whether a command, Claude, or a nested skill invoked it, which tells you what to consolidate or retire. ## @@ -348,7 +348,7 @@ Per-directory CLAUDE.md files can become hard to govern as the codebase grows. Conventions drift, files go stale, and no one owns the root. Solving that typically falls to the team that maintains the repository’s Claude Code setup rather than to each developer working in their own area. Move conventions and reference content out of always-loaded CLAUDE.md and into mechanisms that load on demand: * [Skills](</docs/en/skills>): reference material Claude loads only when relevant to the task - * [Plugins](</docs/en/plugins>): versioned bundles of skills, hooks, and commands that a platform team owns centrally + * [Plugins](</docs/en/plugins/overview>): versioned bundles of skills, hooks, and commands that a platform team owns centrally * [MCP servers](</docs/en/mcp>): if your organization already runs a code search or RAG index over the repository, expose it as an MCP tool so Claude queries it instead of reading files directly See [server-managed or endpoint-managed settings](</docs/en/server-managed-settings#choose-between-server-managed-and-endpoint-managed-settings>) for how platform teams can enforce these centrally.
added Plugin loading reference View current →
Show diff (409 lines)
--- a/loading.md +++ b/loading.md @@ -0,0 +1,406 @@ +Use this page when a plugin didn’t load, loaded a different copy than you expected, or didn’t pick up an update, and you want to see which source, settings scope, or file on disk decided that. It gives the rules Claude Code applies when a session starts and each time you run `/reload-plugins`. You can also ask Claude to read this page and diagnose your setup. + +These cases are covered on other pages: + + * **Install, enable, disable, and update steps** : see [Install and manage plugins](</docs/en/plugins/install>) + * **You have a specific error message** : see [Troubleshoot plugins](</docs/en/plugins/troubleshooting>) + +Start with Check which stage a plugin reached for the three stages an installed plugin passes through, or go to the section that matches what you’re seeing: + + * A plugin you turned off still loads: Find where a plugin is enabled + * An update changed nothing: Versions and updates + * You’re looking at the files under `~/.claude/plugins/`: Find plugins on disk + * A `--plugin-dir` plugin didn’t load, or a same-named plugin loaded instead: Name conflicts + +## + +​ + +Check which stage a plugin reached + +An `enabledPlugins` entry becomes a plugin you can use in stages: your settings declare it, Claude Code fetches it to disk, and the running session loads it. When a plugin doesn’t behave as a settings file suggests, check which stage it reached: + + * **Declared, in settings** : `enabledPlugins` says which plugins should be on, and `extraKnownMarketplaces` says which marketplaces should exist. When you run `claude plugin marketplace add`, Claude Code writes the marketplace to `extraKnownMarketplaces` in your user settings as well as to disk + * **Fetched, on disk under`~/.claude/plugins/`**: the records of what Claude Code has fetched, and the fetched files themselves: + * `known_marketplaces.json` records each marketplace Claude Code has fetched, with its `source`, `installLocation`, `lastUpdated`, and `autoUpdate`. There is one `known_marketplaces.json` per user, so a marketplace you add in one project is available in every project + * `installed_plugins.json` records each install with its `scope`, `installPath`, and `version` + * `cache/` holds the plugin files + * **Loaded, in the running session** : the plugin set Claude Code loaded at startup or at the last `/reload-plugins`. Changes to settings or to disk don’t reach this layer until you run `/reload-plugins` or start a new session. That is why `claude plugin update` ends with `Restart to apply changes.` and background updates prompt you with `Run /reload-plugins to apply` + +### + +​ + +Plugins and marketplaces that aren’t on disk at session start + +Plugins load at session start from `installed_plugins.json` and the cache without using the network. After the session starts, Claude Code checks the declared marketplaces in the background: + + * **A marketplace that settings declare but`known_marketplaces.json` lacks**: Claude Code clones it, then reloads plugins and downloads enabled plugins that aren’t cached yet + * **A declared marketplace whose source changed in settings** : Claude Code re-fetches it from the new source and shows `Plugins changed. Run /reload-plugins to activate.` + +An enabled plugin that neither path fetched and that has no usable cache directory shows `Plugin "<name>" not cached at <path>` in the `/plugin` **Errors** tab, and `claude plugin list` adds `— run /plugin to refresh` to the same line. For the fix, see [`Plugin "<name>" not cached at <path>`](</docs/en/plugins/troubleshooting#plugin-not-cached-at>). + +## + +​ + +Find where a plugin came from + +Every plugin has an id of the form `<name>@<origin>`, which is what you see in settings files and in `claude plugin list --json`. The part after `@` tells you where Claude Code found the plugin: + +ID ends in| How the plugin got there| How you turn it on or off +---|---|--- +`@<marketplace>`| You installed it from a marketplace you added| `"<name>@<marketplace>": true` or `false` under `enabledPlugins` in a settings file +`@inline`| You started Claude Code with `--plugin-dir` or `--plugin-url`, set [`CLAUDE_CODE_PLUGIN_DIRS`](</docs/en/env-vars#variables>), or an Agent SDK app passed the `plugins` option. It loads for that session only| On for the session unless the manifest sets `defaultEnabled: false` or a settings file sets `"<name>@inline": false` +`@skills-dir`| You saved a plugin directory that has a `.claude-plugin/plugin.json` under `~/.claude/skills/` or the project’s `.claude/skills/`| The manifest’s `defaultEnabled`, unless a settings file sets `"<name>@skills-dir"` to `true` or `false` +`@synced`| You or your organization turned it on for your claude.ai account, and Claude Code downloaded it| On unless the manifest sets `defaultEnabled: false` or a settings file sets `"<name>@synced": false`. A plugin your organization marks as required loads regardless + +For a marketplace plugin, `<name>` is the entry name in `marketplace.json`; for `@inline` and `@skills-dir` it’s the `name` in the plugin’s manifest. The origin names in this table are reserved, so no marketplace can be named `inline`, `skills-dir`, or `synced`. + +### + +​ + +Entry name and manifest name + +A marketplace plugin has two names, and they can differ: + + * **The entry name in`marketplace.json`**: the install and enable key. It’s what you write in `enabledPlugins`, what the cache directory is named after, and what `claude plugin list` shows + * **The`name` in the manifest**: what the plugin’s components are namespaced under, and what name conflicts compare + +### + +​ + +Plugins shared through a repository + +To share a plugin through a repository, list it under `enabledPlugins` in `.claude/settings.json` or place it under `.claude/skills/`. Claude Code doesn’t scan a project’s `.claude/plugins/` directory. A cloud session doesn’t add the marketplaces a repository lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>), because that requires the workspace trust dialog, which a cloud session never shows. A project-scope skills-directory plugin loads only from the `.claude/skills/` of the session’s [primary working directory](</docs/en/permissions#working-directories>), and only after you accept the [workspace trust dialog](</docs/en/permissions#what-runs-before-you-trust-a-folder>) for that folder. It doesn’t [search parent directories up to the repository root](</docs/en/skills#discovery-from-parent-and-nested-directories>) the way plain skills and commands do. If you launch from a subdirectory, a plugin at the repository root doesn’t load. Launch from the repository root instead, or [move the session there with `/cd`](</docs/en/permissions#move-the-session-to-another-directory>) on v2.1.246 or later. A project-scope plugin is checked into the repository and reaches every collaborator who clones it. Because that content comes from the repository rather than from you, it loads only after the same trust check that applies to project allow rules in `.claude/settings.json`. Trusting a parent folder or running with `-p` isn’t enough. Components that run code are restricted further: + + * MCP servers it declares go through the [same per-server approval](</docs/en/mcp>) as a project `.mcp.json` + * MCP servers it declares as an [MCP bundle](</docs/en/plugins/manifest-reference#mcpservers>), a `.mcpb` or `.dxt` file, or from a file outside the plugin directory are skipped. Declare them inline or in a `.mcp.json` inside the plugin directory + * [Background monitors](</docs/en/plugins/components#monitors>) do not load + +Personal-scope plugins have none of these restrictions. For how to write `--plugin-dir` and skills-directory plugins, see [Create plugins](</docs/en/plugins/create>). + +### + +​ + +Plugins synced from claude.ai + +A plugin you turn on for your claude.ai account also loads in Claude Code, alongside the plugins you install from marketplaces. That includes plugins your organization turns on for its members. Each of these plugins loads as `<name>@synced`, with no marketplace and no install record. In terminal sessions, a synced plugin’s skills, agents, hooks, MCP servers, and LSP servers all load, with the same trust as a marketplace plugin you installed. For the components Cowork loads, see [Plugins on claude.ai and in Cowork](<https://claude.com/docs/plugins/overview>) on claude.com. Synced plugins load in Cowork sessions and in terminal sessions where you sign in with your claude.ai account: + + * **[Cowork](<https://claude.com/product/cowork>)** : Claude Code downloads them into the session’s own environment when the session starts + * **Terminal sessions** : each time you start Claude Code, it syncs once in the background, downloading new and updated plugins and removing the ones that you or your organization turned off. Syncing in terminal sessions requires Claude Code v2.1.273 or later + +#### + +​ + +Sync timing in terminal sessions + +Because the terminal sync runs in the background, it can finish after your session has started. When it adds, updates, or removes a synced plugin in an interactive session, you see `Plugins changed. Run /reload-plugins to activate.` Run `/reload-plugins` to load the change in that session, or leave it for the next time you start Claude Code. If you enable a plugin on claude.ai while a session is running, the plugin downloads the next time you start Claude Code. + +#### + +​ + +Sign-in requirements for terminal sync + +In your terminal, plugins sync only in sessions where you sign in with your claude.ai account. If you signed in on an earlier version of Claude Code, that sign-in doesn’t cover plugins until Claude Code renews it in the background. To get access sooner, run `/login` again. Plugin sync then starts the next time you start Claude Code. + +#### + +​ + +Control which synced plugins load + +You can turn synced plugins off one at a time, except a plugin your organization requires, or turn off every synced plugin on the machine: + + * **One plugin** : `claude plugin disable <name>@synced` in your shell and the `/plugin` **Installed** tab in a session both save `"<name>@synced": false` in your user-level [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>). To keep the plugin out of a project in every environment, set the same key in the project’s committed `.claude/settings.json` + * **Every synced plugin on a machine** : set [`syncClaudeAiPlugins`](</docs/en/settings-reference#syncclaudeaiplugins>) to `false` in your user settings, or your organization sets it in [managed settings](</docs/en/managed-settings>). Claude Code stops downloading, and the next time you start it, it moves the plugins it already synced to `~/.claude/plugins/.trash/` and no longer loads them. If your organization turns off Skills on claude.ai, plugins stop syncing too + * **A plugin your organization requires** : a plugin that your organization marks as required on claude.ai loads even if you disabled it earlier. `claude plugin disable` refuses it with `Plugin "<name>@synced" is required by your organization and can't be disabled here. Contact your admin to change it.`, and `claude plugin list` marks it `required by your org` + +For removing a plugin on claude.ai, see [Manage installed plugins](</docs/en/plugins/install#manage-installed-plugins>). + +## + +​ + +Find where a plugin is enabled + +You can set an `enabledPlugins` entry in any of six sources. The table lists them from lowest precedence to highest, and who each one applies to. For the settings files themselves, see [Settings files and who they affect](</docs/en/settings#where-settings-live>). + +Source| Where you set it| Reaches +---|---|--- +`--add-dir`| `.claude/settings.json` or `.claude/settings.local.json` in a directory you pass with `--add-dir`| This session only. Only a `true` value has an effect, and every other source overrides it +`user`| `~/.claude/settings.json`| You, in every project +`project`| `.claude/settings.json`| Everyone who clones the repository +`local`| `.claude/settings.local.json`| You, in this repository only +`flag`| The `--settings` value you pass at launch| This session only +`managed`| [Managed settings](</docs/en/managed-settings>)| Every user the policy covers. `true` force-enables and `false` blocks, and no other source overrides them + +These sources merge key by key. For each plugin id, the value that applies is the one from the highest-precedence source that mentions the id. A source that doesn’t mention the id leaves the value from the lower-precedence source in effect. + +### + +​ + +Disabled in user settings but still loads + +If you set a plugin to `false` in `~/.claude/settings.json` and it still loads, a `true` in a higher-precedence source is overriding it. The plugin’s row in `claude plugin list` and in `/plugin` shows `Disabled in ~/.claude/settings.json but still loads — project settings enable it, which overrides your user setting`. The message names the source that overrode you: `project`, `project, gitignored` for `.claude/settings.local.json`, `cli flag`, or `managed`. To opt out of a project-enabled plugin on your machine, set the id to `false` in `.claude/settings.local.json`, which has higher precedence than the project file. + +### + +​ + +Enabled in project settings but not installed + +When a plugin’s only `true` is in the project’s `.claude/settings.json`, Claude Code doesn’t fetch it onto a machine where it isn’t installed, unless its marketplace entry has a [relative-path source](</docs/en/plugins/marketplace-reference#plugin-sources>) or a [seed directory](</docs/en/plugins/org#seed-containers-and-ci>) already holds it. Instead, the `/plugin` **Errors** tab shows `Plugin "<name>" is enabled in project settings but isn't installed here`. A relative-path plugin needs no install record because it loads from the marketplace itself. Claude Code fetches a plugin with an external source only when one of these sources sets it to `true`: + + * Your user settings + * A `.claude/settings.local.json` that git doesn’t track + * The `--settings` flag + * Managed settings + +## + +​ + +Find plugins on disk + +Claude Code keeps plugin files and state records under one plugins root, which is `~/.claude/plugins` unless you set [`CLAUDE_CODE_PLUGIN_CACHE_DIR`](</docs/en/env-vars>). Every path in the table is relative to that root. + +Path| What it holds +---|--- +`cache/<marketplace>/<plugin>/<version>/`| One directory per installed version of a marketplace plugin. `<plugin>` is the marketplace entry name and `<version>` is the resolved version. `${CLAUDE_PLUGIN_ROOT}` points at this directory +`data/<plugin-id>/`| The plugin’s persistent directory, exposed as `${CLAUDE_PLUGIN_DATA}`. For how `<plugin-id>` is formed, see [Path variables and persistent data](</docs/en/plugins/components#path-variables-and-persistent-data>). Claude Code creates it when a plugin component first uses it and keeps it across updates. Claude Code deletes it when you uninstall the plugin from its last scope, unless you pass `--keep-data` +`marketplaces/<name>/`| The clone or download of a marketplace added from GitHub, another Git host, or a URL. A marketplace added from a local `file` or `directory` source has no copy here, and its `installLocation` in `known_marketplaces.json` is the path you gave +`synced/`| The plugins Claude Code synced from your claude.ai account +`.trash/`| Plugins that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing +`installed_plugins.json` and `known_marketplaces.json`| The records of what Claude Code has installed and which marketplaces it has fetched, described under Check which stage a plugin reached. A [marketplace hosted on claude.ai](</docs/en/plugins/install#add-from-claude-ai>) is recorded in `known_marketplaces_claudeai.json` instead +`flagged-plugins.json`| Plugins Claude Code uninstalled because their marketplace delisted them. They appear in the **Flagged** section of `/plugin`; see [Host a marketplace](</docs/en/plugins/host-marketplace>) + +Because `${CLAUDE_PLUGIN_ROOT}` points at a version directory, a plugin’s root path changes with every version. Keep a plugin’s durable files in `${CLAUDE_PLUGIN_DATA}` instead. + +### + +​ + +In-place and copied plugins + +Claude Code loads some plugins in place from where you keep them and copies the rest into the cache, according to their origin: + + * **`--plugin-dir` and skills-directory plugins**: the directory loads in place and is never copied. A `--plugin-url` archive or a `--plugin-dir` `.zip` is extracted into a session temp directory first + * **Relative-path plugins in a marketplace you added from a local directory** : the plugin loads in place from its path inside the marketplace folder. Your edits to the source directory take effect at the next session start or `/reload-plugins`, and you don’t need to increase the version. The plugin’s hook processes and MCP and LSP servers receive a `CLAUDE_PLUGIN_ROOT` that points at the source directory. For its Node.js package dependencies, see When the dependency install runs + * **`command`-source plugins in [link mode](</docs/en/plugins/marketplace-reference#command-plugin-source>)**: the directory the command printed loads in place, through links in the cache entry + * **Every other marketplace plugin** : Claude Code copies the plugin into `cache/<marketplace>/<plugin>/<version>/` at install and loads that copy. Files outside the plugin directory aren’t copied, so when a script inside a copied plugin reads a path above the plugin root, such as `../shared`, it doesn’t find them + +### + +​ + +Paths that escape the plugin directory + +Whether a plugin loads in place or from a cached copy, Claude Code doesn’t let it declare components outside its own directory. It rejects a component path that resolves outside the plugin root, whether the path is declared in `plugin.json` or in a marketplace entry: + + * **A path that points outside the plugin as written** , such as `../shared-utils` + * **A symlink that leads outside the plugin** , other than [links between plugins within one marketplace](</docs/en/plugins/host-marketplace#share-files-within-a-marketplace-with-symlinks>) + * **On macOS and Linux, a path that contains a backslash anywhere in it** , even when the path stays inside the plugin. Components declared with backslash paths therefore load on Windows only, so write component paths with forward slashes, such as `./commands/deploy.md` + +A rejected path appears as a [`path escapes plugin directory`](</docs/en/errors#path-escapes-plugin-directory>) error, and the plugin loads without that component. + +### + +​ + +Cleanup of previous versions + +When you update or uninstall a plugin, Claude Code writes an `.orphaned_at` marker into the previous version directory. It removes that directory in a background cleanup 14 days later, so a session that already loaded the old version keeps running. The sweep runs only while `installed_plugins.json` records at least one install. After you uninstall your last plugin, orphaned directories stay until you install another. + +### + +​ + +Node.js package dependencies + +When Claude Code copies a plugin into the cache, it also installs the plugin’s Node.js package dependencies there, so the plugin’s hooks and MCP servers can load them. This section covers the npm and Bun packages a plugin declares in its own `package.json`. For plugins that depend on other plugins, see [plugin dependency versions](</docs/en/plugins/dependencies>). + +#### + +​ + +When the dependency install runs + +Claude Code runs the install inside the copied version directory each time it creates one: + + * When you install a plugin + * When Claude Code updates a plugin to a new version + * At session start when an enabled plugin isn’t cached yet, such as on a new machine + +For a relative-path plugin loaded in place from a local-directory marketplace, Claude Code doesn’t install the dependencies into the source directory. Install them there yourself, or from a hook into [`${CLAUDE_PLUGIN_DATA}`](</docs/en/plugins/components#path-variables-and-persistent-data>). The install runs only when the plugin’s root directory contains both a `package.json` and a supported lockfile. The lockfile decides which command Claude Code runs: + +Lockfile| Command +---|--- +`bun.lock` or `bun.lockb`| `bun install --frozen-lockfile --ignore-scripts` +`npm-shrinkwrap.json` or `package-lock.json`| `npm ci --ignore-scripts` + +If a plugin contains more than one of these lockfiles, Claude Code uses the first match, checking in order: `bun.lock`, `bun.lockb`, `npm-shrinkwrap.json`, `package-lock.json`. Claude Code skips the install for Yarn and pnpm lockfiles and for a `bunfig.toml` beside the Bun lockfile: + + * If your plugin has only a `yarn.lock` or `pnpm-lock.yaml`, replace it with an npm lockfile + * If a `bunfig.toml` is in the same directory as the Bun lockfile, remove the `bunfig.toml`, or replace the Bun lockfile with an npm lockfile + +Include an npm lockfile to reach the most users. Claude Code runs the matched lockfile’s package manager from the user’s PATH and doesn’t try the other lockfile instead if that package manager is missing. For a plugin distributed through an npm source, use `npm-shrinkwrap.json`, because npm excludes `package-lock.json` from published packages. + +#### + +​ + +Limits on the dependency install + +Claude Code constrains this dependency install so that no code from the plugin or its packages executes during it, and bounds how long it can run: + + * **Frozen resolution** : Bun and npm install exactly what the lockfile pins, and fail rather than re-resolve versions when `package.json` and the lockfile disagree + * **No lifecycle scripts** : `--ignore-scripts` keeps `preinstall`, `install`, and `postinstall` scripts from running, so dependencies that build native modules in those scripts download but don’t compile during this install + * **60-second timeout** : Claude Code stops an install that runs longer and treats it as failed + +Claude Code fetches an npm-source plugin before this dependency install, and none of the package’s own install scripts run during the fetch. See [npm plugin source](</docs/en/plugins/marketplace-reference#npm-plugin-source>). You can’t turn the automatic install off. No setting or environment variable disables it. In restricted networks, see the [network access requirements](</docs/en/network-config#network-access-requirements>) for the hosts to allow. + +#### + +​ + +When the dependency install fails or is skipped + +A failed or skipped install never blocks the plugin, and each case leaves a different sign: + + * A failed install, or one skipped because of a Yarn or pnpm lockfile or a `bunfig.toml`, appears as a warning in the `claude --debug` output + * A plugin with a `package.json` and no lockfile is skipped without a log entry + * A timed-out install can leave a partial `node_modules` tree in the cached copy + +When the automatic install can’t provide a dependency, install it from a hook into the [persistent data directory](</docs/en/plugins/components#path-variables-and-persistent-data>). That includes packages that need their lifecycle scripts to build, Python dependencies, and plugins locked with Yarn or pnpm. + +## + +​ + +Versions and updates + +If a plugin’s author pushed new commits and `claude plugin update` prints `<name> is already at the latest version (<version>).`, the version Claude Code computes for the plugin is unchanged, so nothing changes on disk. Claude Code computes a version for every plugin it installs, and that version is how it detects an update. `claude plugin update` and background auto-update compute the version again and skip the plugin when it matches what `installed_plugins.json` records. The version also names the plugin’s cache directory. A manifest that pins `"version"` is one way the computed version stays the same across commits. See How Claude Code computes the version for the resolution order. A plugin loaded in place from a local-directory marketplace loads its current source files at every session start, whatever its version string says. For a plugin from a [marketplace hosted on claude.ai](</docs/en/plugins/install#add-from-claude-ai>), the version claude.ai records for the plugin is its version, and the manifest’s `version` isn’t read. + +### + +​ + +How Claude Code computes the version + +For a marketplace you added by source, Claude Code picks the rule by the `source` type of the plugin’s marketplace entry. The [marketplace reference](</docs/en/plugins/marketplace-reference#plugin-sources>) lists the source types. For every source type in that list except `command`: + + 1. The `version` field in the plugin’s manifest comes first + 2. Then the `version` field in the plugin’s marketplace entry + 3. When neither is set, the version comes from the source type: + +Source type| Version when no `version` field is set +---|--- +`github`, `url`, or `git-subdir`| The commit SHA of the source, shortened to 12 characters. A `git-subdir` version also carries a hash of the subdirectory path +`archive`| The SHA-256 digest, shortened to 12 characters: the `sha256` pin in the marketplace entry, or the digest of the downloaded file when there is no pin +Relative path inside a Git-hosted marketplace| The commit SHA of the installed directory +Local directory, when neither the plugin directory nor its marketplace is a git repository| `unknown` +`npm`| `unknown` + +Claude Code doesn’t take the version from a repository that encloses the install path, such as a git-managed `~/.claude`. For a `command` source, Claude Code always derives the version from what the command produced: a 12-character hash on its own, or `<manifest version>-<hash>` when the manifest sets one. The marketplace entry’s `version` is ignored for command sources. For what the hash covers, see [Copy mode and link mode](</docs/en/plugins/marketplace-reference#copy-mode-and-link-mode>). Because the manifest comes first, a manifest that pins `"version": "1.0.0"` keeps every user on the cached copy until its author changes the string, however many commits they push. To let users track commits instead, leave `version` out of both the manifest and the entry. [Host a marketplace](</docs/en/plugins/host-marketplace>) covers which choice fits which release setup. + +### + +​ + +When Claude Code refreshes a marketplace before an install + +When you install a plugin, Claude Code looks it up in its local copy of the marketplace catalog. You can run `/plugin install` in a session or `claude plugin install` in your shell, and name the plugin with or without its marketplace. The table shows which of those combinations refresh the local copy. + +Plugin name| Command| What Claude Code refreshes +---|---|--- +`name@marketplace`| `/plugin install` or `claude plugin install`| The named marketplace, before the lookup +`name` alone| `/plugin install`| Only marketplaces that have auto-update on, and only after the lookup misses +`name` alone| `claude plugin install`| Nothing. It reads the cached catalogs without refreshing + +The refresh before a `name@marketplace` install doesn’t depend on the marketplace’s auto-update setting or on `DISABLE_AUTOUPDATER`. When the refresh fails, the install proceeds from the cached catalog and `claude plugin install` reports `marketplace not refreshed`. Claude Code skips the refresh before a `name@marketplace` install when: + + * The marketplace was added from a local `file` or `directory` source, or is defined inline in settings with a [`settings` source](</docs/en/settings-reference#extraknownmarketplaces>) + * A [seed directory](</docs/en/env-vars>) supplies the marketplace + * Claude Code refreshed the marketplace within the last 30 seconds + * You set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` + * [Managed settings](</docs/en/plugins/org#restrict-what-users-can-install>) block the marketplace, in which case Claude Code also refuses the install + +### + +​ + +When auto-update runs + +In an interactive session, after you send your first message, Claude Code waits a random delay of up to ten minutes. It then refreshes every marketplace with auto-update on and updates the plugins installed from them on disk. The running session keeps the versions it loaded, and you see `Plugin updated: <name> · Run /reload-plugins to apply`. Whether or not you reload, the new versions load on your next launch. + +#### + +​ + +Which marketplaces and plugins auto-update + +Whether a marketplace auto-updates follows the first of these that is set: + + 1. **`autoUpdate` on its `extraKnownMarketplaces` entry** in a settings file + 2. **`autoUpdate` on its `known_marketplaces.json` entry**, which the **Enable auto-update** toggle under `/plugin` **Marketplaces** writes. When a settings file also declares the marketplace under `extraKnownMarketplaces`, the toggle writes `autoUpdate` to that settings entry as well + 3. **The default** : on for Anthropic’s official marketplaces such as `claude-plugins-official`, off for `knowledge-work-plugins` and `first-party-plugins`, on for [marketplaces added from claude.ai](</docs/en/plugins/install#add-from-claude-ai>), and off for every other marketplace + +If you set `DISABLE_UPDATES=1`, `DISABLE_AUTOUPDATER=1`, or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`, the whole pass is off and the **Enable auto-update** toggle is hidden, unless you also set `FORCE_AUTOUPDATE_PLUGINS=1`. The [environment variables reference](</docs/en/env-vars>) covers each variable’s wider effect. Auto-update also skips a plugin whose marketplace entry declares a `headersHelper`. [Installs and updates that refuse a command instead of asking](</docs/en/plugins/host-marketplace#installs-and-updates-that-refuse-the-command-instead-of-asking>) explains when such a plugin appears in the `/plugin` **Errors** tab and how you update it from there. When a copied plugin updates mid-session, hook commands, monitors, MCP servers, and LSP servers keep using the previous version’s path. Run `/reload-plugins` to switch hooks, MCP servers, and LSP servers to the new path. Monitors require a session restart. + +### + +​ + +When a command source re-runs + +Plugins with a `command` source don’t wait for the auto-update pass. The printed directory reflects the tool’s state at the time the command ran, so Claude Code runs the [command you accepted](</docs/en/plugins/host-marketplace#change-the-command-of-a-command-source>) again at these times: + + * Every time you install or update the plugin + * Once per session for each enabled command-sourced plugin, in the background, shortly after the session starts. This run doesn’t depend on the marketplace’s auto-update setting or on `DISABLE_AUTOUPDATER` + * At startup or on `/reload-plugins`, when an enabled plugin’s installed version is missing from the plugin cache + +Claude Code skips the two background runs when you set [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>). Explicit installs and updates still run the command with that variable set. When the command’s hashed output has changed, Claude Code installs the result as a new version and reloads it in the running interactive session, switching [the same components that `/reload-plugins` switches](</docs/en/plugins/cli-reference#reload-plugins>). You see a notification that the plugin was reloaded. If reloading in place would invalidate the session’s prompt cache, Claude Code instead prompts you to run `/reload-plugins`, which [warns about the cache cost and applies when rerun with `--force`](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>). + +## + +​ + +Name conflicts + +When enabled plugins from different origins share a manifest name, this order decides which one loads, from highest precedence to lowest: + + 1. A plugin whose id appears in managed settings `enabledPlugins`, as `true` or `false`. A `--plugin-dir` copy whose manifest name matches the id’s name part isn’t loaded, and you see `--plugin-dir copy of "<name>" ignored: plugin is locked by managed settings` + 2. An enabled `--plugin-dir`, `--plugin-url`, or `CLAUDE_CODE_PLUGIN_DIRS` plugin. It replaces a same-named installed marketplace plugin or skills-directory plugin: + * **An installed marketplace plugin** : replaced silently. `claude plugin list` still shows the marketplace row as enabled, because that row reflects your settings. Only the log Claude Code writes under `~/.claude/debug/` when you start with `--debug` records `Plugin "<name>" from --plugin-dir overrides installed version` + * **A skills-directory plugin** : replaced with a `/plugin` **Errors** tab row that reads `Not loaded — the name "<name>" is already taken by a session-only plugin (--plugin-dir / --plugin-url), which takes precedence` + 3. An installed marketplace plugin. A skills-directory plugin of the same name gets the same `Not loaded` row, naming the installed plugin + 4. A skills-directory plugin. Between two of these, the copy under `~/.claude/skills/` loads and the project’s `.claude/skills/` copy is dropped, with a row that says which path shadowed it + 5. A plugin synced from claude.ai. When an enabled plugin from any other origin matches its name, Claude Code loads that plugin and reports the synced copy as not loaded. To use the claude.ai copy instead, disable your own copy + +Because the order compares manifest names, a `--plugin-dir` plugin named `hello-plugin` replaces `hello@example-marketplace` when that plugin’s manifest also says `"name": "hello-plugin"`. + +### + +​ + +Keep a session-only plugin from loading + +To keep a `--plugin-dir` plugin from shadowing anything, or to turn one off when a parent process passes the flag for you, set its id to `false` in any settings file. For a plugin whose manifest name is `hello-plugin`, the entry is `"enabledPlugins": {"hello-plugin@inline": false}`. A disabled session-only plugin doesn’t shadow, so the marketplace or skills-directory copy loads instead. + +## + +​ + +Next steps + + * [Install and manage plugins](</docs/en/plugins/install>): the install, enable, disable, and update steps themselves + * [Troubleshoot plugins](</docs/en/plugins/troubleshooting>): error messages by the stage that produces them + * [Plugin commands reference](</docs/en/plugins/cli-reference>): the flags and commands named on this page + * [Manage plugins for your organization](</docs/en/plugins/org>): the managed settings that force-enable or block plugins
modified Control MCP server access for your organization View current →
--- a/managed-mcp.md +++ b/managed-mcp.md @@ -28,7 +28,7 @@ **Denylist only**| Block known-bad servers, allow everything else| `deniedMcpServers` **No restrictions**| Users add anything| Don’t deploy any managed MCP configuration -Claude Code doesn’t have a built-in MCP server registry that users can browse and install from. For the approved-catalog pattern, share the approved list and its `claude mcp add` commands somewhere your users will find them, such as an internal wiki, or distribute the servers as plugins through a [managed plugin marketplace](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) so users can browse and install them from `/plugin`. +Claude Code doesn’t have a built-in MCP server registry that users can browse and install from. For the approved-catalog pattern, share the approved list and its `claude mcp add` commands somewhere your users will find them, such as an internal wiki, or distribute the servers as plugins through a [managed plugin marketplace](</docs/en/plugins/org#restrict-what-users-can-install>) so users can browse and install them from `/plugin`. ##
modified Deploy managed settings View current →
--- a/managed-settings.md +++ b/managed-settings.md @@ -81,7 +81,7 @@ * **On the user’s machine** : by default, Claude Code in a Cowork session reads the MDM or OS-level policy and the managed settings file on that device, so deploy policy there. * **In a full VM sandbox** : when your Claude Desktop managed configuration sets [`requireCoworkFullVmSandbox`](<https://claude.com/docs/third-party/claude-desktop/configuration#requirecoworkfullvmsandbox>), Claude Code runs inside a virtual machine where the device’s MDM policy and managed settings file aren’t present. * **Remote Cowork sessions** : these run on Anthropic-managed VMs, where Claude Code has no device policy to read. -The [surface coverage](</docs/en/model-config#surface-coverage>) table compares Cowork with the other surfaces. +Wherever the session runs, claude.ai applies the admin console’s [`strictKnownMarketplaces`](</docs/en/settings-reference#strictknownmarketplaces>) and [`blockedMarketplaces`](</docs/en/settings-reference#blockedmarketplaces>) lists itself when anyone adds a marketplace from a git repository on claude.ai or from **Customize** in the Cowork tab. [How restrictions work](</docs/en/plugins/org#restrict-what-users-can-install>) describes that check. The [surface coverage](</docs/en/model-config#surface-coverage>) table compares Cowork with the other surfaces. * **Running sessions** : most changes reach a running session on the schedule in the delivery mechanism table, without a restart. * Changes to [`forceRemoteSettingsRefresh`](</docs/en/settings-reference#forceremotesettingsrefresh>), [`requiredMinimumVersion`](</docs/en/settings-reference#requiredminimumversion>), and [some user-editable keys](</docs/en/settings#when-edits-take-effect>) take effect at the next session start. * A new or changed [`policyHelper`](</docs/en/settings-reference#policyhelper>) entry takes effect at the next launch. If server-managed settings shadow the helper at that launch, the helper runs as soon as a fetch reports those settings removed. @@ -210,6 +210,8 @@ * When any admin source sets `allowManagedPermissionRulesOnly`, Claude Code drops [parent-supplied](</docs/en/claude-apps-gateway#restrict-parent-settings>) permission allow rules and `additionalDirectories` as it reads them, even when a higher-priority source leaves the key unset. The key’s effect on your own permission rules comes from the managed settings Claude Code applies, or from parent settings you’ve chosen to merge * Claude Code enforces the `forceLoginOrgUUID` or `allowedMcpServers` value in the managed settings it applies and blocks a parent-supplied one. Outside the MCP allowlist lock, a value in a lower admin source that Claude Code doesn’t apply neither applies nor blocks the parent’s. On Claude Code v2.1.273 or later, while `allowManagedMcpServersOnly` is on, the `allowedMcpServers` list from the highest-ranked admin source that sets one applies and blocks the parent’s, as a cross-source key. The parent’s list applies only when no admin source sets one. The [`managedSourcesBehavior`](</docs/en/settings-reference#managedsourcesbehavior>) entry says which source supplies each key under `"merge"`. Before v2.1.223, a value in any admin source blocked the parent’s * For `availableModels`, Claude Code enforces the value in the managed settings it applies and blocks a parent-supplied list + * For `strictKnownMarketplaces`, Claude Code likewise enforces the list in the managed settings it applies and blocks a parent-supplied one. The parent’s list applies only when no applied managed source sets one. Requires Claude Code v2.1.282 or later + * A parent-supplied `blockedMarketplaces` applies in addition to any blocklist that a managed source sets. Requires Claude Code v2.1.282 or later #### @@ -312,7 +314,7 @@ `allowedHttpHookUrls`| Claude Code enforces an empty managed [allowlist](</docs/en/settings-reference#allowedhttphookurls>) until you fix the value, so an HTTP hook runs only if another settings file lists its URL. If only an individual entry is invalid, Claude Code strips that entry and enforces the rest. `httpHookAllowedEnvVars`| Claude Code enforces an empty managed [allowlist](</docs/en/settings-reference#httphookallowedenvvars>) until you fix the value, so a header variable is interpolated only if another settings file names it. If only an individual entry is invalid, Claude Code strips that entry and enforces the rest. `allowedChannelPlugins`| Claude Code enforces an empty allowlist until you fix the value, so no channel plugin passed to `--channels` is admitted. If only an individual entry is invalid, it strips that entry and enforces the rest. -`strictKnownMarketplaces`| Enforced as an empty allowlist until the value is fixed, so no [marketplace source](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) is admitted. An individual entry that is invalid or can’t be enforced, such as a `hostPattern` regex that doesn’t compile, is stripped and the valid subset is enforced. +`strictKnownMarketplaces`| Enforced as an empty allowlist until the value is fixed, so no [marketplace source](</docs/en/plugins/org#restrict-what-users-can-install>) is admitted. An individual entry that is invalid or can’t be enforced, such as a `hostPattern` regex that doesn’t compile, is stripped and the valid subset is enforced. `allowManagedHooksOnly`| Treated as `true` until fixed: the [hook restrictions](</docs/en/settings-reference#allowmanagedhooksonly>) apply and, unless `disableCommandPluginSources` is explicitly `false`, command-sourced plugins are disabled. `allowManagedMcpServersOnly`| Treated as `true`. `disableCommandPluginSources`| Treated as `true`, so command-sourced plugins stay disabled until the value is fixed. @@ -324,7 +326,7 @@ `gatewayInternalNetworks`| When the invalid value comes from the highest managed source on the machine, `/login` refuses every new [cloud gateway](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>) sign-in on that machine until the value is fixed. `crossSessionInbound`| Treated as `refuse`, the most restrictive value, so inbound [cross-session messages](</docs/en/cross-session-messaging#control-inbound-messages>) are refused until the value is fixed. The developer sees [a warning](</docs/en/errors#crosssessioninbound-must-be-one-of-accept-hold-refuse>). `deniedMcpServers`| An individual invalid entry is stripped and the valid subset is enforced. A wholly invalid value is dropped with a warning, since denying every server would block servers the policy never named. -`blockedMarketplaces`| An individual invalid entry is stripped and the valid subset is enforced. An entry that parses but can never match, such as a `hostPattern` regex that doesn’t compile, is kept with a warning. It blocks nothing until fixed, but [marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) stay active. A wholly invalid value is dropped with a warning, since blocking every marketplace would block sources the policy never named. +`blockedMarketplaces`| An individual invalid entry is stripped and the valid subset is enforced. An entry that parses but can never match, such as a `hostPattern` regex that doesn’t compile, is kept with a warning. It blocks nothing until fixed, but [marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>) stay active. A wholly invalid value is dropped with a warning, since blocking every marketplace would block sources the policy never named. `sandbox.credentials`| A recoverable invalid entry is degraded to `mode: "deny"` with a warning; an unrecoverable one is stripped; valid entries stay enforced. See [invalid credential entries](</docs/en/settings-reference#invalid-credential-entries-in-managed-settings>) `allowedHttpHookUrls` and `httpHookAllowedEnvVars` merge across settings files, so entries in your user, project, or local settings still apply while the managed list is empty. The fallbacks for those two keys and for `allowedChannelPlugins` require Claude Code v2.1.267 or later; earlier versions drop the whole key when its value or any entry is invalid. The `strictKnownMarketplaces`, `blockedMarketplaces`, and `disableSideloadFlags` fallbacks require Claude Code v2.1.277 or later; earlier versions drop the whole key when its value or any entry is invalid. `requiredMinimumVersion` and `requiredMaximumVersion` fail open by design: an invalid value is dropped rather than enforced. This tolerance applies only to managed settings. User, project, and local settings files remain strict: a file whose JSON or top-level shape fails validation is rejected as a whole and reported, and an individual entry that fails, such as a malformed permission rule, is skipped with a warning while the rest of the file applies. @@ -344,9 +346,9 @@ [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>)| When `true`, restricts which hooks run; see [what runs under `allowManagedHooksOnly`](</docs/en/settings-reference#what-runs-under-allowmanagedhooksonly>) for the full effect list [`allowManagedMcpServersOnly`](</docs/en/settings-reference#allowmanagedmcpserversonly>)| When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See Keys read from every admin source for which managed sources can set it, and [Managed MCP configuration](</docs/en/managed-mcp>) [`allowManagedPermissionRulesOnly`](</docs/en/settings-reference#allowmanagedpermissionrulesonly>)| Makes managed settings the only settings source of permission rules. The entry lists every source it ignores -[`blockedMarketplaces`](</docs/en/settings-reference#blockedmarketplaces>)| Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) +[`blockedMarketplaces`](</docs/en/settings-reference#blockedmarketplaces>)| Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>) [`channelsEnabled`](</docs/en/settings-reference#channelsenabled>)| Allow [channels](</docs/en/channels>) for the organization. See [enterprise controls](</docs/en/channels#enterprise-controls>) for the default on each plan -[`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>)| When `true`, blocks [`command` plugin sources](</docs/en/plugin-marketplaces#command-sources>) entirely, so the marketplace-declared command never runs. Also blocks marketplace [`headersHelper` commands](</docs/en/plugin-marketplaces#authenticate-archive-downloads>), except for a marketplace that managed settings themselves declare. When unset, follows `allowManagedHooksOnly`. Requires Claude Code v2.1.229 or later, and the `headersHelper` block requires v2.1.238 or later +[`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>)| When `true`, blocks [`command` plugin sources](</docs/en/plugins/marketplace-reference#command-plugin-source>) entirely, so the marketplace-declared command never runs. Also blocks marketplace [`headersHelper` commands](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>), except for a marketplace that managed settings themselves declare. When unset, follows `allowManagedHooksOnly`. Requires Claude Code v2.1.229 or later, and the `headersHelper` block requires v2.1.238 or later [`disableSideloadFlags`](</docs/en/settings-reference#disablesideloadflags>)| Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` flags at startup. In cloud sessions, Claude Code drops the MCP servers the server delivered through `--mcp-config`, other than in-process `type: "sdk"` entries, and starts the session. Requires Claude Code v2.1.193 or later [`forceRemoteSettingsRefresh`](</docs/en/settings-reference#forceremotesettingsrefresh>)| When `true`, blocks CLI startup until remote managed settings are freshly fetched and exits if the fetch fails. See [fail-closed enforcement](</docs/en/server-managed-settings#enforce-fail-closed-startup>) [`managedMcpServers`](</docs/en/settings-reference#managedmcpservers>)| Remote MCP servers provided to every user alongside their own. It provides servers rather than locking anything down. See [Provide servers through managed settings](</docs/en/managed-mcp#provide-servers-through-managed-settings>). Requires Claude Code v2.1.259 or later @@ -357,7 +359,7 @@ [`policyHelper`](</docs/en/settings-reference#policyhelper>)| Executable that computes managed settings at startup; see [Compute managed settings with a policy helper](</docs/en/settings-reference#policyhelper>) [`sandbox.filesystem.allowManagedReadPathsOnly`](</docs/en/settings-reference#sandbox-filesystem-allowmanagedreadpathsonly>)| When `true`, only `filesystem.allowRead` paths from managed settings are respected. `denyRead` still merges from all sources [`sandbox.network.allowManagedDomainsOnly`](</docs/en/settings-reference#sandbox-network-allowmanageddomainsonly>)| Honor only managed `allowedDomains` and `WebFetch(domain:...)` allow rules; block other domains without prompting -[`strictKnownMarketplaces`](</docs/en/settings-reference#strictknownmarketplaces>)| Controls which plugin marketplace sources users can add and install plugins from. See [managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) +[`strictKnownMarketplaces`](</docs/en/settings-reference#strictknownmarketplaces>)| Controls which plugin marketplace sources users can add and install plugins from. See [managed marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>) [`strictPluginOnlyCustomization`](</docs/en/settings-reference#strictpluginonlycustomization>)| Block skills, agents, hooks, and MCP servers from user and project sources; `true` locks all four, an array names which [`wslInheritsWindowsSettings`](</docs/en/settings-reference#wslinheritswindowssettings>)| When set in the HKLM registry or a file under `C:\Program Files\ClaudeCode`, have WSL read the Windows policy chain, and read `/etc/claude-code` only when no managed settings file or drop-in under that directory delivers a policy key; the entry gives the order
added Plugin manifest reference View current →
Show diff (697 lines)
--- a/manifest-reference.md +++ b/manifest-reference.md @@ -0,0 +1,694 @@ +A plugin manifest is the `plugin.json` file in a plugin’s `.claude-plugin/` directory. It carries the plugin’s metadata and the `userConfig` values that Claude Code prompts the user for. It also declares any component that you define inline or keep outside its default location. This reference is for plugin creators, and for marketplace owners who put component fields in a marketplace entry. + +These cases are covered on other pages: + + * **Learning to build a plugin** : start with [Create a plugin](</docs/en/plugins/create>) + * **What each component does at runtime** : see [Plugin components](</docs/en/plugins/components>) + +Start at the section that matches what you’re looking up: + + * A field: the Fields table gives each field’s type, whether it’s required, its default, and what it accepts. Path rules covers the `./` prefix and containment for every component path + * A `userConfig` option or a `channels` entry: the User configuration and Channels schemas + * `${CLAUDE_PLUGIN_ROOT}` or another variable a plugin can reference: Environment variables + * Where each component’s files go: Standard layout + * A message from `claude plugin validate`: the [troubleshooting page](</docs/en/plugins/troubleshooting>) lists each message with its fix and links to the relevant sections on this page + +## + +​ + +Manifest file + +The manifest is optional. Without it, Claude Code loads the components it finds in the standard layout. The plugin name then comes from the marketplace entry, or from the directory name when you load the plugin with `--plugin-dir`. Write a manifest when you want metadata, a component outside its default directory, `userConfig`, or an inline component definition. Save the manifest at `.claude-plugin/plugin.json` under the plugin root. Put every other plugin file at the plugin root, not inside `.claude-plugin/`. That includes `skills/`, `commands/`, and `hooks/`. The following example sets most of the keys in the Fields table. It passes validation in a plugin directory that contains each referenced path. + + { + "name": "deploy-tools", + "displayName": "Deploy Tools", + "version": "1.2.0", + "description": "Deployment commands, a review agent, and a status monitor", + "author": { + "name": "Example Team", + "email": "dev@example.com", + "url": "https://example.com" + }, + "homepage": "https://example.com/docs/deploy-tools", + "repository": "https://github.com/example/deploy-tools", + "license": "MIT", + "keywords": ["deployment", "ci"], + "defaultEnabled": true, + "dependencies": ["secrets-vault"], + "metadata": { "catalogId": "cat-123" }, + "skills": ["./extra-skills/"], + "commands": { + "status": { + "source": "./commands/status.md", + "description": "Show the current deployment status" + }, + "about": { + "content": "Explain what the deploy-tools plugin provides.", + "description": "Describe this plugin" + } + }, + "agents": ["./agents/reviewer.md"], + "hooks": "./config/extra-hooks.json", + "mcpServers": { + "deploy-api": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/server.js"] + } + }, + "lspServers": "./.lsp.json", + "outputStyles": "./styles/", + "experimental": { + "themes": "./themes/", + "monitors": "./config/monitors.json" + }, + "userConfig": { + "api_token": { + "type": "string", + "title": "API token", + "description": "Token for the deployment API", + "sensitive": true + } + } + } + +### + +​ + +Unrecognized fields + +An unrecognized top-level key is stripped, and an unrecognized key inside a `userConfig` option, `channels` entry, `lspServers` config, or `monitors` entry is rejected: + + * **Top-level fields** : the field is stripped and the plugin loads. `claude plugin validate` reports each unrecognized top-level field as a warning + * **Strict objects** : `userConfig` options, `channels` entries, `lspServers` configs, and `monitors` entries are strict. An unknown key inside one is an error, and the plugin doesn’t load + +### + +​ + +Validate the manifest + +`claude plugin validate` is the authoritative check for a manifest. Run it from your shell against the plugin directory: + + claude plugin validate ./my-plugin + +The command reports one of these results: + + * **`Validation passed`** : the manifest loads + * **`Validation passed with warnings`** : the manifest loads, but the validator found something to fix, such as an unknown top-level field that Claude Code strips, a `name` that isn’t kebab-case, or a missing `version`, `description`, or `author`. Pass `--strict` to turn warnings into failures in CI + * **`Validation failed`** : the manifest has a type mismatch, a path that is missing or escapes the plugin root, or an unknown key inside a `userConfig` option, `channels` entry, `lspServers` config, or `monitors` entry. Claude Code reports the same problem when it loads the plugin + +## + +​ + +Fields + +The table lists the top-level keys in `plugin.json`. `name` is the only required key. Where a field name is a link, the linked section has its full rules. For component keys such as `commands` and `hooks`, Component path forms shows each accepted shape with an example, and every path follows the path rules for the `./` prefix, extensions, and containment. + +Field| Type| Description +---|---|--- +`$schema`| String| JSON Schema URL for editor autocomplete. Claude Code ignores it at load time +`name`| String| Plugin identifier, required. Use kebab-case. Every component is namespaced under it +`displayName`| String| Name shown in UI in place of `name` +`version`| String| Version string. Setting it keeps users on that version until you change it +`description`| String| Short explanation of what the plugin provides +`author`| Object| `name`, which is required, plus optional `email` and `url` +`homepage`| String| Documentation URL. Must parse as a URL, or the plugin fails to load +`repository`| String| Source repository URL. Not validated +`license`| String| SPDX identifier such as `MIT` or `Apache-2.0` +`keywords`| Array of strings| Discovery tags +`metadata`| Object| Free-form object for your own data. Claude Code doesn’t read it +`defaultEnabled`| Boolean| Whether the plugin starts enabled when the user hasn’t set it. Defaults to `true` +`dependencies`| Array of strings or objects| Plugins that must be enabled for this one to work +`settings`| Object| Settings Claude Code applies while the plugin is enabled. Only `agent` and `subagentStatusLine` take effect +`userConfig`| Object| Values Claude Code prompts the user for when the plugin is enabled +`channels`| Array of objects| Message channels the plugin provides, each bound to one of its MCP servers +`skills`| Path, or array of paths| Directories to scan for skills, each a directory of `<name>/SKILL.md` folders or one folder holding `SKILL.md` directly. `"."` names the plugin root. Adds to the default `skills/` scan +`commands`| Path, array of paths, or object| Flat `.md` command files, directories of them, or an object map of command name to `source` or `content`. Replaces the default `commands/` scan +`agents`| Path, or array of paths| Agent `.md` files. Directories aren’t accepted. Replaces the default `agents/` scan +`hooks`| Path, object, or array of either| `.json` hook files or inline hook config. Loaded together with `hooks/hooks.json` +`mcpServers`| Path, object, or array of either| `.json` MCP config files, `.mcpb` or `.dxt` bundles, or inline server configs keyed by name. Loaded together with `.mcp.json`; a server name declared later replaces an earlier one +`lspServers`| Path, object, or array of either| `.json` LSP config files or inline server configs keyed by name. Loaded together with `.lsp.json` +`outputStyles`| Path, or array of paths| Output style files or directories. Replaces the default `output-styles/` scan +`workflows`| Path, or array of paths| [Workflow](</docs/en/workflows#distribute-a-workflow-in-a-plugin>) `.js` files or directories. Replaces the default `workflows/` scan +`experimental`| Object| Container for `themes`, `monitors`, and `evals`, whose manifest shape may still change +`experimental.themes`| Path, or array of paths| Theme files or directories. Replaces the default `themes/` scan. A top-level `themes` key still loads, with a `claude plugin validate` warning +`experimental.monitors`| Path, or inline array| A `.json` file holding the monitors array, or the array itself. Defaults to `monitors/monitors.json`. A top-level `monitors` key still loads, with a `claude plugin validate` warning. Monitors run only in interactive sessions, and not on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry +`experimental.evals`| Path, or array of paths| Directory that holds the plugin’s [eval cases](</docs/en/plugin-evals#use-a-different-eval-directory>) when it isn’t the default `evals/`. `claude plugin eval --eval-dir` overrides it + +In the Type column, a path is a string relative to the plugin root, such as `"./custom/commands"`. + +### + +​ + +`name` + +The plugin identifier. It must be non-empty, with no spaces, `@`, `:`, path separators, control characters, or bidirectional-formatting characters; use kebab-case. Claude Code namespaces every component under it, so an agent `reviewer` in plugin `deploy-tools` appears as `deploy-tools:reviewer`. + +### + +​ + +`displayName` + +The name shown in UI in place of `name`. It may contain spaces and any casing, and it isn’t used for namespacing or lookup. For a marketplace-installed plugin, a `displayName` on the [marketplace entry](</docs/en/plugins/marketplace-reference#plugin-entries>) takes precedence over this value. + +### + +​ + +`version` + +A version string, not checked against semver. Setting it pins the plugin to that version until you change it; see [Versions and updates](</docs/en/plugins/loading#versions-and-updates>). A plugin with a [`command` source](</docs/en/plugins/marketplace-reference>), a plugin from a [marketplace hosted on claude.ai](</docs/en/plugins/install#add-from-claude-ai>), and a plugin [loaded in place](</docs/en/plugins/loading#find-plugins-on-disk>) from a marketplace added as a local directory aren’t pinned by this field. + +### + +​ + +`metadata` + +A free-form object for your own data, such as catalog or entitlement fields. Claude Code doesn’t read it. Requires Claude Code v2.1.222 or later. + +### + +​ + +`defaultEnabled` + +Whether the plugin starts enabled when the user hasn’t set it in [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>). Defaults to `true`. A plugin that an enabled plugin depends on starts enabled regardless. The same field in the marketplace entry overrides this one. Once a user’s `enabledPlugins` entry is written, it persists across plugin updates, so changing `defaultEnabled` in a later release doesn’t change the setting for an existing user. + +### + +​ + +`dependencies` + +Plugins that must be enabled for this one to work. Each entry is `"name"`, `"name@marketplace"`, or `{ "name": "...", "marketplace": "...", "version": "..." }`. Bare names resolve against this plugin’s own marketplace. See [dependency constraints](</docs/en/plugins/dependencies>). + +### + +​ + +`settings` + +Settings Claude Code applies while the plugin is enabled. Only `agent` and `subagentStatusLine` take effect; other keys are dropped at load. A `settings.json` at the plugin root takes precedence over this key. See [Default settings](</docs/en/plugins/components#default-settings>). + +## + +​ + +Component path forms + +Every component key accepts a path relative to the plugin root. `hooks`, `mcpServers`, `lspServers`, and `experimental.monitors` also accept inline configuration, `commands` also accepts an object map, and `mcpServers` also accepts MCP bundle paths and URLs. The examples that follow show each accepted shape once. For what each component does at runtime, see [Plugin components](</docs/en/plugins/components>). + +### + +​ + +Path-only fields + +`agents`, `skills`, `outputStyles`, `workflows`, and `experimental.themes` take one path or an array of paths. `agents` entries must be `.md` files, and `skills` entries must be directories. The other three accept a directory or a file. + + { + "agents": ["./custom-agents/reviewer.md", "./custom-agents/tester.md"], + "skills": ["./extra-skills/", "."], + "outputStyles": "./styles/" + } + +### + +​ + +`commands` + +`commands` takes a path, an array of paths, or an object map. A path names a flat `.md` command file or a directory. In the object map, each key becomes the command name after the plugin prefix. For example, `"about"` in plugin `deploy-tools` runs as `/deploy-tools:about`. Each value sets exactly one of `source` or `content`, and an entry that sets both or neither fails validation. The other fields in this table are optional: + +Field| Type| Description +---|---|--- +`source`| string| Path to the command’s Markdown file, relative to the plugin root +`content`| string| Inline Markdown for the command body, instead of `source` +`description`| string| Description shown for the command +`argumentHint`| string| Argument hint shown after the command name, such as `[file]` +`model`| string| Default model for the command +`allowedTools`| array of strings| Tools the command may use without prompting + +This map declares one command from a file and one from inline content: + + { + "commands": { + "status": { "source": "./commands/status.md", "argumentHint": "[env]" }, + "about": { "content": "Explain what this plugin provides." } + } + } + +### + +​ + +`hooks` + +`hooks` takes a `.json` file path, an inline hooks object in the same shape as [`hooks` in `settings.json`](</docs/en/hooks#configuration>), or an array mixing both. For hook events and handler fields, see the [hooks reference](</docs/en/hooks#hook-events>). Claude Code merges whatever you declare with `hooks/hooks.json` when that file exists. + + { + "hooks": [ + "./config/extra-hooks.json", + { + "PostToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/format.sh" } + ] + } + ] + } + ] + } + +### + +​ + +`mcpServers` + +`mcpServers` takes a `.json` file path, an MCP bundle path or URL, an inline map, or an array mixing them. For server config fields, see [plugin-provided MCP servers](</docs/en/mcp#plugin-provided-mcp-servers>). Claude Code loads `.mcp.json` at the plugin root first, then each declared shape in order. A server name declared later replaces an earlier one. An `mcpServers` value takes one of these shapes: + +Shape| Example value| What Claude Code does +---|---|--- +`.json` file path| `"./mcp/servers.json"`| Reads the file as an `mcpServers` map +MCP bundle path| `"./bundle.mcpb"`| Extracts the `.mcpb` or `.dxt` bundle into `.mcpb-cache/` under the plugin root and reads its server config +MCP bundle URL| `"https://example.com/server.mcpb"`| Downloads the bundle into `.mcpb-cache/`, then reads it +Inline map| `{ "deploy-api": { "command": "node", "args": ["${CLAUDE_PLUGIN_ROOT}/server.js"] } }`| Uses the map as server configs keyed by name + +A bundle path or URL must end in `.mcpb` or `.dxt`. Any other extension fails validation. + +### + +​ + +`lspServers` + +`lspServers` takes a `.json` file path, an inline map of server name to config, or an array of either. Claude Code loads `.lsp.json` at the plugin root first, then each declared config in order. A server name declared later replaces an earlier one. Each server config is a strict object with these fields. An unknown key fails validation. + +Field| Required| Description +---|---|--- +`command`| Yes| Language server binary. No spaces unless the value starts with `/`; put arguments in `args` +`extensionToLanguage`| Yes| Map of file extension to LSP language ID, at least one entry. Keys start with a dot, such as `".go"` +`args`| No| Arguments passed to the server +`transport`| No| Communication transport: `stdio` (default) or `socket`. Claude Code accepts `socket` but runs every server over stdio, so the stdout protocol rules apply to all servers +`env`| No| Environment variables for the server process +`initializationOptions`| No| Options sent in the initialize request +`settings`| No| Settings sent by `workspace/didChangeConfiguration` +`workspaceFolder`| No| Workspace folder path for the server +`startupTimeout`| No| Milliseconds to wait for startup, a positive integer +`shutdownTimeout`| No| Milliseconds to wait for a graceful shutdown, a positive integer. When the timeout elapses, Claude Code terminates the server process. When unset, no timeout applies +`restartOnCrash`| No| Whether to restart the server after it crashes. Defaults to `true`. Set to `false` to leave a crashed server stopped instead of restarting it +`maxRestarts`| No| Restart attempts before giving up, zero or more +`diagnostics`| No| Whether to push diagnostics into context after edits. Defaults to `true` + +This inline config runs `gopls` for `.go` files: + + { + "lspServers": { + "go": { + "command": "gopls", + "args": ["serve"], + "extensionToLanguage": { ".go": "go" } + } + } + } + +For the language servers Anthropic publishes as plugins and how the servers behave at runtime, see [Code intelligence](</docs/en/plugins/code-intelligence>). + +### + +​ + +`monitors` + +`experimental.monitors` takes a `.json` file path or the inline array. When you omit the key, Claude Code loads `monitors/monitors.json` if it exists. Each entry is a strict object with these fields. + +Field| Required| Description +---|---|--- +`name`| Yes| Identifier unique within the plugin +`command`| Yes| Shell command Claude Code runs as a persistent background process in the session working directory +`description`| Yes| Short summary shown in the task panel and notification summaries +`when`| No| With `"always"`, the default, the monitor starts at session start and on plugin reload. With `"on-skill-invoke:<skill>"`, it starts the first time that skill runs + +This inline array declares one monitor that starts the first time the `deploy` skill runs: + + { + "experimental": { + "monitors": [ + { + "name": "deploy-status", + "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/poll-deploy.sh", + "description": "Deployment status changes", + "when": "on-skill-invoke:deploy" + } + ] + } + } + +A monitor `command` can’t reference `${user_config.*}`. See Fields that run through a shell. + +## + +​ + +Path rules + +Every component path in a manifest is relative to the plugin root and must start with `./`. A path such as `commands/foo.md` fails validation. `skills` and `mcpServers` each accept one form outside that rule: + + * **`skills`** : also accepts `"."`. Both `"."` and `"./"` denote the plugin root. Before v2.1.221, `"."` failed manifest validation, so use `"./"` when the plugin must load on earlier versions + * **`mcpServers`** : also accepts an `https://` bundle URL + +### + +​ + +Containment and existence + +Every component path must resolve inside the plugin root and must exist. `claude plugin validate` doesn’t check the `outputStyles`, `lspServers`, `monitors`, or `themes` paths, so a bad path in those fields fails only when the plugin loads: + + * **Containment** : a path that resolves outside the plugin root doesn’t load, and the `/plugin` **Errors** tab shows `<component> path escapes plugin directory: <path>`. A path containing `..` is the usual case, and `claude plugin validate` reports it as `Path contains ".." which could be a path traversal attempt` + * **Existence** : a path that doesn’t exist doesn’t load, and the `/plugin` **Errors** tab shows `<component> path not found: <path>`. `claude plugin validate` reports it as `Path not found` + +### + +​ + +How each key combines with its default location + +Each component key either replaces its default location, adds to it, or merges with it: + + * **Replaces the default** : `commands`, `agents`, `outputStyles`, `workflows`, `experimental.themes`, `experimental.monitors`. When you set `commands`, the default `commands/` directory isn’t scanned. To keep the default and add more, list it explicitly: `"commands": ["./commands/", "./extras/"]` + * **Adds to the default** : `skills`. The `skills/` directory is still scanned, and the listed directories load alongside it + * **Merges** : `hooks`, `mcpServers`, `lspServers`. The default file loads first, and what the manifest declares merges into it, as described under Component path forms + +If a plugin has a default folder such as `commands/` and also sets the manifest key that replaces it, Claude Code loads the manifest paths and not the folder. `claude plugin list` and the `/plugin` interface then show the warning `Default <folder>/ folder is ignored because the manifest sets "<key>"`. To avoid the warning, set the key to a path inside that folder: `"commands": ["./commands/deploy.md"]` names a file in the default folder and produces no warning. + +## + +​ + +User configuration + +`userConfig` declares values Claude Code prompts the user for when the plugin is enabled, so users don’t edit `settings.json` themselves. Keys are identifiers made of letters, digits, and underscores, and can’t start with a digit. Each value is a strict object with these fields. An unknown key fails validation. + +Field| Required| Description +---|---|--- +`type`| Yes| One of `string`, `number`, `boolean`, `directory`, or `file` +`title`| Yes| Label shown in the configuration dialog +`description`| Yes| Help text shown beneath the field +`required`| No| If `true`, the configuration dialog doesn’t accept an empty value +`default`| No| Value used when the user provides nothing: a string, number, boolean, or array of strings +`options`| No| For `string`, the values the field accepts, shown as a picker in `/config`. See Limit a field to fixed options. Requires Claude Code v2.1.271 or later +`multiple`| No| For `string`, allows an array of strings +`sensitive`| No| If `true`, masks input and stores the value in secure storage instead of `settings.json` +`min` / `max`| No| Bounds for `number` + +Each option of each enabled plugin also appears as a row in the `/config` panel, except `sensitive` options and `multiple` lists. The `/config` rows require Claude Code v2.1.269 or later. This `userConfig` declares an endpoint and a masked token: + + { + "userConfig": { + "api_endpoint": { + "type": "string", + "title": "API endpoint", + "description": "Your team's API endpoint" + }, + "api_token": { + "type": "string", + "title": "API token", + "description": "API authentication token", + "sensitive": true + } + } + } + +### + +​ + +Limit a field to fixed options + +Set `options` on a `userConfig` field to make users pick its value from a fixed list. To limit a `tone` field to three options, list them in `options` and set `default` to one of them: + + { + "userConfig": { + "tone": { + "type": "string", + "title": "Tone", + "description": "Voice for generated replies", + "options": ["neutral", "warm", "formal"], + "default": "neutral" + } + } + } + +If you declare `options` on any field, users on Claude Code versions before v2.1.271 can’t load the plugin. `options` applies to a `string` field that isn’t `multiple` or `sensitive`. Set `default` to one of the listed values, or set `required: true` so the user must pick one. Each option is a plain label of 1 to 64 characters, and `claude plugin validate`, which you run in your shell, reports anything else it rejects. A plugin whose `options` break these rules fails to load. + +### + +​ + +Where values are stored + +Non-sensitive values are saved under [`pluginConfigs`](</docs/en/settings-reference#pluginconfigs>) in the user’s `settings.json`. Sensitive values go to the platform’s secure credential store instead. The [settings page](</docs/en/settings-reference#pluginconfigs>) lists which settings files `pluginConfigs` is read from. + +### + +​ + +Reference a saved value + +Reference a saved value where the plugin needs it, in one of two forms: + + * **`${user_config.KEY}`** : substituted in MCP server config, LSP server config, [exec-form](</docs/en/hooks#exec-form-and-shell-form>) hook `args`, and skill and agent content. In skill and agent content, only non-sensitive values are substituted, and a sensitive value there becomes a placeholder + * **`CLAUDE_PLUGIN_OPTION_<KEY>`**: exported to hook processes for every option, with `<KEY>` uppercased. A shell-form hook reads `$CLAUDE_PLUGIN_OPTION_API_TOKEN` for `api_token` + +### + +​ + +Fields that run through a shell + +Shell-form hook commands, monitor commands, and MCP [`headersHelper`](</docs/en/mcp#use-dynamic-headers-for-custom-authentication>) reject `${user_config.*}`. A component that references it in one of these fields fails with an [error](</docs/en/errors#plugin-command-references-user-config>) instead of running, because the field’s value is passed to a shell that would re-parse the substituted value. The table shows how the value can reach each of these fields instead. + +Field| How the value can reach it +---|--- +Shell-form hook commands| Use [exec form](</docs/en/hooks#exec-form-and-shell-form>) with `args`, or read `CLAUDE_PLUGIN_OPTION_<KEY>` from the hook’s environment +Monitor commands| Not through Claude Code. Monitor processes don’t receive `CLAUDE_PLUGIN_OPTION_<KEY>`, so the monitor script has to obtain the value on its own +MCP `headersHelper`| Not through Claude Code. The helper’s environment carries `CLAUDE_PLUGIN_ROOT`, `CLAUDE_CODE_MCP_SERVER_NAME`, and `CLAUDE_CODE_MCP_SERVER_URL` but no option values, so the helper script has to obtain the value on its own + +## + +​ + +Channels + +`channels` declares the message channels a plugin provides, such as a bridge to a chat app. When you declare one, Claude Code can prompt for the channel’s configuration when the plugin is enabled. For how the server injects messages, see the [channels reference](</docs/en/channels-reference#package-as-a-plugin>). Each entry is a strict object bound to one of the plugin’s MCP servers, with these fields: + +Field| Required| Description +---|---|--- +`server`| Yes| Key of the MCP server in this plugin’s `mcpServers` that the channel binds to +`displayName`| No| Name shown in the configuration dialog title. Defaults to the server name +`userConfig`| No| Options to prompt for, in the same shape as top-level `userConfig`. Saved values substitute into `${user_config.KEY}` references in the server’s `env` + +This manifest binds a channel to the plugin’s `telegram` MCP server and prompts for a bot token that substitutes into the server’s `env`: + + { + "mcpServers": { + "telegram": { + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/server.js"], + "env": { "BOT_TOKEN": "${user_config.bot_token}" } + } + }, + "channels": [ + { + "server": "telegram", + "displayName": "Telegram", + "userConfig": { + "bot_token": { + "type": "string", + "title": "Bot token", + "description": "Telegram bot token", + "sensitive": true + } + } + } + ] + } + +## + +​ + +Environment variables + +Claude Code provides three path variables to plugin components. Reference them as `${NAME}` in the fields listed under Where each variable resolves, and read them as environment variables in the processes that receive them. + +Variable| Resolves to| Use it for +---|---|--- +`${CLAUDE_PLUGIN_ROOT}`| Absolute path of the plugin’s installed version| Scripts, binaries, and config files bundled with the plugin +`${CLAUDE_PLUGIN_DATA}`| `~/.claude/plugins/data/<id>/`, created on first reference and kept across plugin updates. `<id>` is the plugin identifier with every character other than a letter, digit, `_`, or `-` replaced by `-`| Installed dependencies such as `node_modules`, generated code, and caches +`${CLAUDE_PROJECT_DIR}`| The project root| Project-local scripts and config files + +`${CLAUDE_PLUGIN_ROOT}` changes when the plugin updates, so don’t write state there. For where the root moves and when the old directory is cleaned up, see the [loading page](</docs/en/plugins/loading>). When you uninstall the plugin from the last place it’s installed, the `${CLAUDE_PLUGIN_DATA}` directory is deleted unless you pass [`--keep-data`](</docs/en/plugins/cli-reference>). + +### + +​ + +Where each variable resolves + +In each plugin component, `${...}` references resolve inline in specific fields, and some components also receive the variables in their process environment: + +Plugin component| Fields where `${...}` resolves| Exported to the process +---|---|--- +Hook commands| Anywhere in `command` and `args`| `CLAUDE_PLUGIN_ROOT`, `CLAUDE_PLUGIN_DATA`, `CLAUDE_PROJECT_DIR`, and `CLAUDE_PLUGIN_OPTION_<KEY>` +Monitor commands| Anywhere in `command`| Not exported +MCP `stdio` servers| `command`, `args`, `env`| `CLAUDE_PLUGIN_ROOT`, `CLAUDE_PLUGIN_DATA` +MCP `http`, `sse`, `ws` servers| `url`, `headers`, `headersHelper`| Not applicable +LSP servers| `command`, `args`, `env`, `workspaceFolder`| `CLAUDE_PLUGIN_ROOT`, `CLAUDE_PLUGIN_DATA`, `CLAUDE_PROJECT_DIR` +Skill, command, and agent content| Anywhere in the Markdown body| Not applicable + +The variables aren’t present in the environment of commands Claude runs through the Bash tool, in the main session or in a subagent. In skill, command, and agent content, write the `${...}` reference in the Markdown body instead, and Claude Code substitutes the path inline when it loads the content. + +### + +​ + +Quoting and path separators + +Keep each substituted path a single argument: + + * **Hook commands** : use [exec form](</docs/en/hooks#exec-form-and-shell-form>) with `args` so each path is one argument with no quoting + * **Shell-form hooks and monitor commands** : wrap the variable in double quotes so a path with spaces stays one word + +This shell-form hook runs a script bundled with the plugin: + + { + "hooks": { + "PostToolUse": [ + { + "hooks": [ + { + "type": "command", + "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/process.sh" + } + ] + } + ] + } + } + +On Windows, the substituted paths use forward slashes so a shell doesn’t read backslashes as escapes. + +## + +​ + +Standard layout + +Each component type has a default location under the plugin root, used when the manifest doesn’t point elsewhere. + +Component| Default location| Contents +---|---|--- +Manifest| `.claude-plugin/plugin.json`| Plugin metadata and configuration. Optional +Skills| `skills/`| One `<name>/SKILL.md` per skill. A plugin with `SKILL.md` at its root, no `skills/`, and no `skills` key loads as a single skill +Commands| `commands/`| Flat Markdown command files. Prefer `skills/` for new plugins +Agents| `agents/`| Agent Markdown files. Subfolders are part of the [agent name](</docs/en/plugins/components#agents>) +Hooks| `hooks/hooks.json`| Hook configuration +MCP servers| `.mcp.json`| MCP server definitions +LSP servers| `.lsp.json`| LSP server configurations +Output styles| `output-styles/`| Output style Markdown files +Workflows| `workflows/`| Workflow `.js` files +Themes| `themes/`| Theme JSON files +Monitors| `monitors/monitors.json`| The monitors array +Executables| `bin/`| Files here are on the Bash tool’s `PATH` while the plugin is enabled, so Claude runs them as bare commands. claude.ai and Cowork don’t install a plugin that has this directory, including one you [distribute through claude.ai organization settings](</docs/en/plugins/host-marketplace#distribute-through-organization-settings>) +Settings| `settings.json`| `agent` and `subagentStatusLine` defaults applied while the plugin is enabled + +A plugin that uses every default location, plus a `scripts/` folder that its hooks call, is laid out like this: + + deploy-tools/ + ├── .claude-plugin/ + │ └── plugin.json + ├── skills/ + │ └── deploy/ + │ └── SKILL.md + ├── commands/ + │ └── status.md + ├── agents/ + │ └── reviewer.md + ├── hooks/ + │ └── hooks.json + ├── monitors/ + │ └── monitors.json + ├── output-styles/ + │ └── terse.md + ├── themes/ + │ └── dracula.json + ├── workflows/ + │ └── release-audit.js + ├── bin/ + │ └── deploy-tool + ├── scripts/ + │ └── format.sh + ├── settings.json + ├── .mcp.json + └── .lsp.json + +To click through this layout and read what each file does, open the [plugin explorer](</docs/en/plugins/components#explore-the-plugin-directory>). A `CLAUDE.md` at the plugin root isn’t loaded as context, and `claude plugin validate` warns when it finds one. To include instructions that load into Claude’s context, put them in a skill. + +## + +​ + +Marketplace entries and the manifest + +A [marketplace entry](</docs/en/plugins/marketplace-reference>) accepts every field on this page alongside [its own fields](</docs/en/plugins/marketplace-reference#plugin-entries>), including `strict`. The `strict` field decides whether the entry may add components to a plugin that has its own `plugin.json`. It defaults to `true`. + +### + +​ + +How entry fields combine with `plugin.json` + +The entry either serves as the manifest, adds components to it, or conflicts with it: + + * **No`plugin.json`**: the entry is the manifest, regardless of `strict`. Entry `hooks` loads only in the inline object form. For a file path or array there, the `/plugin` **Errors** tab shows a `not yet supported in a marketplace entry` error + * **`plugin.json` present, `strict` unset or `true`**: Claude Code loads the manifest and appends the entry’s `commands`, `agents`, `skills`, `outputStyles`, and `themes` to it. For `hooks`, the entry’s matchers for an event replace the manifest’s matchers for that same event, and events only the manifest declares keep theirs + * **`plugin.json` present, `strict: false`**: an entry that declares any of `commands`, `agents`, `skills`, `hooks`, `outputStyles`, or `themes` is a conflict, and the plugin fails to load with `Plugin <name> has conflicting manifests` + +When a [marketplace entry whose `source` is the marketplace root](</docs/en/plugins/marketplace-reference>) lists specific `skills` subdirectories, only those subdirectories load, and the plugin’s default `skills/` directory isn’t scanned. A `skills` key in the manifest instead adds to the default. + +### + +​ + +Metadata precedence + +Some metadata fields have a fixed precedence regardless of `strict`: + + * **`defaultEnabled` and display fields**: the entry’s `defaultEnabled` and its [display fields](</docs/en/plugins/marketplace-reference#entry-and-plugin-json>) such as `displayName` override the manifest’s + * **`version`** : the manifest’s `version` overrides the entry’s + * **`name`** : when the entry lists the plugin under a different `name` than the manifest, `enabledPlugins` uses the entry name, and components are namespaced under the manifest name + +For the full precedence table, see [Strict mode](</docs/en/plugins/marketplace-reference>). + +## + +​ + +Next steps + + * [Add components to a plugin](</docs/en/plugins/components>): what each component does at runtime, with an example that validates + * [Marketplace reference](</docs/en/plugins/marketplace-reference>): the entry fields a marketplace can set for your plugin + * [Plugin commands reference](</docs/en/plugins/cli-reference#plugin-validate>): `claude plugin validate` flags and output + * [Troubleshoot plugins](</docs/en/plugins/troubleshooting#claude-plugin-validate-reports-errors>): each validation message with its fix
added Marketplace reference View current →
Show diff (524 lines)
--- a/marketplace-reference.md +++ b/marketplace-reference.md @@ -0,0 +1,521 @@ +`marketplace.json` is the file that defines a plugin marketplace. It contains the marketplace’s name, its owner, and one entry per plugin. Each entry’s plugin source says where Claude Code fetches that plugin from. A marketplace source is a separate object that says where Claude Code fetches the marketplace file itself. You write one in settings, or Claude Code builds one when you run `claude plugin marketplace add`. This reference is for marketplace maintainers who need an exact field name or value, and for administrators who need to know which `source` values are valid in [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>), [`strictKnownMarketplaces`](</docs/en/settings-reference#strictknownmarketplaces>), and [`blockedMarketplaces`](</docs/en/plugins/org#restrict-what-users-can-install>). + +These cases are covered on other pages: + + * **Building or hosting a marketplace** : see [Create a marketplace](</docs/en/plugins/create-marketplace>) and [Host and maintain a marketplace](</docs/en/plugins/host-marketplace>) + * **Allowlist and blocklist recipes** : see [Manage plugins for your organization](</docs/en/plugins/org>) + +Find the section for what you’re writing or reading: + + * **The marketplace file** : Top-level fields and Plugin entries + * **An entry’s`source`**: Plugin sources + * **A`source` object in settings**: Marketplace sources + * **Output from[`claude plugin validate <path>`](</docs/en/plugins/cli-reference>)**: Validation messages, which maps each message to the field it names + +## + +​ + +Marketplace file + +Save the marketplace file at `.claude-plugin/marketplace.json` in your marketplace’s directory. If you keep the file somewhere else in the repository, users have to declare the marketplace in [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) with `path` set on its source, because `claude plugin marketplace add` has no option for it. The directory that contains `.claude-plugin/` is called the marketplace root, and every relative plugin source resolves from it, not from `.claude-plugin/`. Each user registers one marketplace per `name`, so a user can’t have two marketplaces with the same name registered at once. Claude Code ignores an unknown top-level key or plugin-entry key rather than rejecting it, so a typo loads silently. `claude plugin validate` reports each unknown key as a warning. + +### + +​ + +Reserved names + +You can’t give your marketplace any of the following names: + + * **Official marketplace names** : `claude-code-marketplace`, `claude-code-plugins`, `claude-plugins-official`, `anthropic-marketplace`, `anthropic-plugins`, `agent-skills`, `anthropic-agent-skills`, `life-sciences`, `knowledge-work-plugins`, `claude-for-legal`, `claude-for-financial-services`, `financial-services-plugins`, `first-party-plugins`, and `claude-tag-plugins`. Reserved unless the marketplace comes from a `github` or `git` marketplace source under `github.com/anthropics/`. + * **Community marketplace names** : `claude-community`, `claude-plugins-community`, and `healthcare`. Reserved under the same rule as the official names. + * **Plugin directory names** : `anthropic-plugin-directory` and `claude-plugin-directory`. Reserved under the same rule as the official names. + * **Names that impersonate an official marketplace** : names such as `official-claude-plugins` or `claude-plugins-v2`, and any name containing a non-ASCII character. The error is `Marketplace name impersonates an official Anthropic/Claude marketplace`. A control or bidirectional-formatting character in a name also reports `Marketplace name cannot contain control or bidirectional-formatting characters`. + * **Another spelling of a reserved name** : a name that differs from a reserved name only by a trailing dot, or by a symbol other than an underscore in place of a hyphen, so `claude.code.plugins` counts as `claude-code-plugins`. `claude plugin validate` accepts such a name; adding the marketplace fails with [`is another spelling of "<reserved>", a reserved marketplace name`](</docs/en/errors#marketplace-name-is-another-spelling-of-a-reserved-name>), and a marketplace already registered under one stops loading. This check requires Claude Code v2.1.280 or later. + * **Names Claude Code uses for plugins that don’t come from a marketplace** : `inline` for plugins loaded with [`--plugin-dir`](</docs/en/cli-reference>), `builtin` for built-in plugins, `skills-dir` for plugins auto-loaded from [`.claude/skills/`](</docs/en/skills>), and `synced` for plugins synced from your claude.ai account. `claude-plugin-test` is also reserved. `skills-dir` also appears as `{"source": "skills-dir"}` in `strictKnownMarketplaces` and `blockedMarketplaces`, described under Source values valid only in policy lists. + * **`npm`, `pip`, `uv`, `cargo`, `github`, and `gh`**: reserved in any casing. This check requires Claude Code v2.1.275 or later. + * **Names starting with`claudeai-`**: reserved for marketplaces hosted on claude.ai. `claude plugin marketplace add` refuses any other marketplace that uses one with `Cannot add marketplace "<name>": names starting with "claudeai-" are reserved for marketplaces hosted on claude.ai`. + +## + +​ + +Top-level fields + +The table lists every key Claude Code reads from `marketplace.json`. `name`, `owner`, and `plugins` are required. + +Field| Type| Description +---|---|--- +`name`| string| Marketplace identifier. No spaces, control characters, or bidirectional-formatting characters, no `/` or `\`, no `..`, and not `.`. See Reserved names. Users type it after `@` when they install a plugin +`owner`| object| Maintainer information. `name` is required; `email` and `url` are optional +`plugins`| array| Plugin entries. Each entry is validated on its own, so one invalid entry doesn’t fail the marketplace +`$schema`| string| JSON Schema URL for editor autocomplete. Ignored at load time +`description`| string| Marketplace description shown to users. `claude plugin validate` warns when it’s missing +`version`| string| Marketplace manifest version +`metadata.description`, `metadata.version`| string| Alternate location for `description` and `version` +`metadata.pluginRoot`| string| Directory that bare plugin source names resolve under. See Relative path plugin source. Requires Claude Code v2.1.239 or later +`forceRemoveDeletedPlugins`| boolean| When `true`, a plugin you remove from `plugins` is uninstalled on users’ machines. See [Host and maintain a marketplace](</docs/en/plugins/host-marketplace>) +`allowCrossMarketplaceDependenciesOn`| array of strings| Marketplace names whose plugins may be installed as dependencies of this marketplace’s plugins. When you install a plugin, only the list in that plugin’s own marketplace applies, for its whole dependency chain. See [Plugin dependencies](</docs/en/plugins/dependencies>) +`renames`| object| Map from a former plugin `name` to its current name, or to `null` for a plugin you removed. Requires Claude Code v2.1.193 or later. See [Host and maintain a marketplace](</docs/en/plugins/host-marketplace>) + +## + +​ + +Plugin entries + +Each object in the top-level `plugins` array of `marketplace.json` names a plugin and says where to fetch it. `name` and `source` are required. An entry also accepts every [`plugin.json` field](</docs/en/plugins/manifest-reference>), such as `description`, `version`, `author`, `commands`, and `hooks`. For when those fields apply, see How an entry combines with plugin.json. The table lists the entry’s own fields and the manifest fields whose meaning changes in an entry. + +Field| Type| Description +---|---|--- +`name`| string| Plugin identifier, with no spaces, control characters, or bidirectional-formatting characters. Users type it before `@` when they install, even when the plugin’s own `plugin.json` sets a different `name` +`source`| string or object| Where to fetch the plugin. See Plugin sources +`description`| string| Shown in [`/plugin`](</docs/en/plugins/install>) listings and details +`version`| string| Version string for the plugin. When `plugin.json` also sets `version`, `plugin.json` takes precedence and `claude plugin validate` warns. See [Plugin loading reference](</docs/en/plugins/loading>) +`category`| string| Free-form category for organizing the catalog +`tags`| array of strings| Free-form tags for search +`strict`| boolean| Default `true`. Whether `plugin.json` is the definitive source for the plugin’s components. See Strict mode +`relevance`| object| Signals that tell Claude Code when to suggest the plugin. See [Recommend plugins for your org](</docs/en/plugins/relevance>) +`dependencies`| array| Plugins that must be enabled for this one to work. Each item is `"name"`, `"name@marketplace"`, or an object. See [Plugin dependencies](</docs/en/plugins/dependencies>) +`defaultEnabled`| boolean| Default `true`. Whether the plugin starts enabled when the user hasn’t set it in [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>). The entry value takes precedence over `plugin.json` +`displayName`| string| Human-readable name shown in the UI. When neither the entry nor the plugin’s `plugin.json` sets one, users see the plugin’s `name` +`metadata`| object| Free-form object for your own fields. Claude Code doesn’t read it. Requires Claude Code v2.1.222 or later +`headers`| object| HTTP headers Claude Code sends when it downloads this entry’s archive. A header set here replaces a header of the same name from the marketplace source’s `headers`. Requires Claude Code v2.1.238 or later +`headersHelper`| string| Command that prints this entry’s archive-download headers as one JSON object, for a credential that expires. The entry must also set `"strict": false`. Requires Claude Code v2.1.238 or later. See [Authenticate archive downloads](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>) + +### + +​ + +How an entry combines with plugin.json + +The entry’s fields apply differently to a fetched plugin that has its own `.claude-plugin/plugin.json` and to one that doesn’t: + + * **No`plugin.json`**: the entry is the manifest regardless of `strict`. Every manifest field in the entry applies, including [`mcpServers`, `lspServers`, `userConfig`, and `channels`](</docs/en/plugins/manifest-reference>). + * **`plugin.json` present**: `plugin.json` is the manifest. Strict mode decides whether the entry’s six component fields, `commands`, `agents`, `skills`, `hooks`, `outputStyles`, and `themes`, are combined with it or rejected as a conflict. Entry `mcpServers`, `lspServers`, `userConfig`, and `channels` don’t apply. Declare them in `plugin.json`. + +#### + +​ + +Hooks in an entry + +Write entry `hooks` as an inline object that maps hook event names to matcher arrays. If you write a file path or an array instead, `claude plugin validate` passes it. Those hooks never run, and Claude Code reports a `not yet supported in a marketplace entry` error for the plugin. Put file-based hooks in the plugin’s own [`hooks/hooks.json`](</docs/en/plugins/components>) or `plugin.json`. + +#### + +​ + +Display fields + +Both the entry and the plugin’s own `plugin.json` can set the display fields `displayName`, `description`, `author`, `homepage`, `repository`, `license`, and `keywords`. Users see these values in plugin listings and details, before and after install: + + * For a field you set on the entry, users see the entry’s value, even when `plugin.json` sets a different one. + * For a field the entry leaves unset, users see the `plugin.json` value. + +Before install, Claude Code can read `plugin.json` only for entries with a relative-path source, whose plugin files are inside the marketplace itself. For an entry with any other source type, users see only the entry’s own fields until they install the plugin. + +### + +​ + +Strict mode + +`strict` decides what happens when the fetched plugin has its own `plugin.json` and the entry also declares any of the component fields: `commands`, `agents`, `skills`, `hooks`, `outputStyles`, or `themes`. With `strict: true`, the default, Claude Code appends the entry’s component fields to `plugin.json`, except `hooks`, whose matchers replace the manifest’s per event. With `strict: false`, an entry that declares any component field is a conflict, and the plugin fails to load. The table shows each combination of `strict`, `plugin.json`, and the entry’s component fields. + +`strict`| `plugin.json`| Entry component fields| Result +---|---|---|--- +any| absent| any| The entry is the manifest +`true`, the default| present| any| `plugin.json` is the authority. Claude Code appends the entry’s component fields to it, except `hooks`, whose matchers [replace the manifest’s per event](</docs/en/plugins/manifest-reference#how-entry-fields-combine-with-plugin-json>) +`false`| present| none| `plugin.json` is the manifest, as with `true` +`false`| present| one or more| Conflict. The plugin fails to load with `Plugin <name> has conflicting manifests: both plugin.json and marketplace entry specify components` + +## + +​ + +Plugin sources + +A plugin entry’s `source` says where Claude Code fetches that one plugin from. It’s either a relative path string or an object whose own `source` key names the type, so an entry looks like `"source": { "source": "github", "repo": "your-org/formatter" }`. The table lists each plugin source type and its fields. + +Type| Fields| Notes +---|---|--- +Relative path| the string itself| A directory inside the marketplace, resolved from the marketplace root. Must start with `./`, unless you write a bare name under `metadata.pluginRoot`. `"."` on its own means the root itself +`github`| `repo`, `ref`, `sha`| GitHub repository in `owner/repo` form +`url`| `url`, `ref`, `sha`| Any git repository by URL +`git-subdir`| `url`, `path`, `ref`, `sha`| One subdirectory of a git repository, fetched with a sparse partial clone +`npm`| `package`, `version`, `registry`| npm package, fetched with your npm client and unpacked without running install scripts +`archive`| `url`, `sha256`| Zip archive over HTTPS. Requires Claude Code v2.1.224 or later +`command`| `command`, `timeout`, `mode`| Directory printed by a command Claude Code runs on the user’s machine. Requires Claude Code v2.1.229 or later + +The names `url` and `github` are also marketplace source types, where `url` means a direct link to a `marketplace.json` file rather than a git repository. `git` exists only as a marketplace source, and `npm` exists as both. `git-subdir`, `archive`, and `command` exist only as plugin sources. Use a relative path for a plugin in a subdirectory of the marketplace repository itself. Use `git-subdir` for a subdirectory of some other repository. `github`, `url`, and `git-subdir` sources share the `ref` and `sha` fields: + + * **`ref`** : a branch or tag. Defaults to the repository’s default branch. + * **`sha`** : a full 40-character lowercase commit SHA. When you set both `ref` and `sha`, Claude Code checks out `sha`. On most git hosts, including GitHub, GitLab, and Bitbucket, this means installation succeeds even if the branch or tag named by `ref` has since been deleted upstream, as long as the commit is still reachable from the repository. Some servers, such as AWS CodeCommit, don’t support fetching commits by SHA. On those servers the `ref` must still exist and the pinned commit must be reachable from it. + +For how each type is fetched, cached, and versioned, see [Plugin loading reference](</docs/en/plugins/loading>). + +### + +​ + +Relative path plugin source + +The path resolves from the marketplace root. `./plugins/formatter` is `<root>/plugins/formatter` even though the marketplace file is in `<root>/.claude-plugin/`. A path containing `..` fails validation. On macOS and Linux, Claude Code refuses an entry path that contains a backslash anywhere after the leading `./`, so write the path with forward slashes. + + { "name": "formatter", "source": "./plugins/formatter" } + +A relative path resolves only when Claude Code has the marketplace’s files, so check the marketplace source type: + + * **`github`, `git`, `file`, and `directory`**: Claude Code has the marketplace’s files. + * **`url`** : Claude Code fetches only `marketplace.json`, so relative paths can’t resolve. Give each plugin an object source instead, such as `github` or `git-subdir`. + * **`settings`** : relative paths are rejected outright. + +#### + +​ + +Bare names under pluginRoot + +A bare name is a single directory name with no `/`, such as `"formatter"`. To write bare names instead of `./` paths, set `metadata.pluginRoot` to the directory they resolve under. With `"pluginRoot": "./plugins"`, `"source": "formatter"` resolves to `./plugins/formatter`. Requires Claude Code v2.1.239 or later. `metadata.pluginRoot` has these limits: + + * It must itself be a relative path inside the marketplace. + * It has no effect on a source that already starts with `./`. + * A source that contains a `/`, such as `team-a/formatter`, isn’t a bare name and still needs the `./` prefix, even when `metadata.pluginRoot` is set. + +### + +​ + +github plugin source + +`repo` takes `owner/repo`. `ref` and `sha` are optional. + + { + "name": "formatter", + "source": { + "source": "github", + "repo": "your-org/formatter", + "ref": "v2.0.0", + "sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0" + } + } + +### + +​ + +url plugin source + +`url` is a full git URL: `https://`, `http://`, `file://`, or `git@`. A `.git` suffix isn’t required, so Azure DevOps and AWS CodeCommit URLs work as written. This type doesn’t take `owner/repo` shorthand. + + { + "name": "formatter", + "source": { + "source": "url", + "url": "https://gitlab.example.com/your-group/formatter.git", + "ref": "main" + } + } + +### + +​ + +git-subdir plugin source + +`url` accepts a full git URL or GitHub `owner/repo` shorthand. `path` is the subdirectory that holds the plugin, and Claude Code downloads only that subdirectory. + + { + "name": "formatter", + "source": { + "source": "git-subdir", + "url": "https://github.com/your-org/monorepo.git", + "path": "tools/formatter" + } + } + +### + +​ + +npm plugin source + +An `npm` source takes these fields: + + * `package`: a package name, or a scoped name such as `@your-org/formatter` + * `version`: a version or range + * `registry`: a registry URL for a package that isn’t on the default registry + +Claude Code fetches the package with your npm client. The package’s install scripts, such as `preinstall` or `postinstall`, never run, and its dependencies aren’t installed during the fetch. If the package has a supported lockfile beside its `package.json`, Claude Code installs those [Node.js package dependencies](</docs/en/plugins/loading#node-js-package-dependencies>) in a separate step, also with scripts disabled. + + { + "name": "formatter", + "source": { + "source": "npm", + "package": "@your-org/formatter", + "version": "^2.0.0", + "registry": "https://npm.example.com" + } + } + +### + +​ + +archive plugin source + +`url` must use `https://` and can’t point at a loopback, link-local, or cloud-metadata host. The plugin root may be at the top of the zip or one directory down. `sha256` is the archive’s digest as 64 hex characters, uppercase or lowercase. When you set it, Claude Code refuses a download that doesn’t match. + + { + "name": "formatter", + "source": { + "source": "archive", + "url": "https://artifacts.example.com/formatter-2.0.0.zip", + "sha256": "6bfa50e3d2e00c052b46abe51fff89346ac803e45771f76dcf6df1ab74cca5e1" + } + } + +### + +​ + +command plugin source + +Use a `command` source when a tool installed on the user’s machine produces the plugin directory, such as an IDE that renders its plugin for the toolchain the user has selected. Claude Code runs the command when the user installs or updates the plugin, and [again once per session](</docs/en/plugins/loading#when-a-command-source-re-runs>), so users get the tool’s changed output without reinstalling. A `command` source takes these fields: + + * `command`: a shell command that prints the plugin directory’s absolute path as one line and exits 0. Claude Code shows users the whole string for review before it runs. Write it as printable ASCII, at most 500 characters, with no run of four or more spaces. + * `timeout`: a whole number of seconds from 1 to 600. Defaults to 60. + * `mode`: `copy`, the default, or `link`. See Copy mode and link mode. + + { + "name": "formatter", + "source": { + "source": "command", + "command": "my-tool claude-plugin-path", + "timeout": 120 + } + } + +For how users accept the command, see [Install from your shell](</docs/en/plugins/install#install-from-your-shell>). For what users see after you change it, see [Change the command of a command source](</docs/en/plugins/host-marketplace#change-the-command-of-a-command-source>). Administrators turn command sources off with [`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>). + +#### + +​ + +What the command must do + +Write the command to meet these requirements: + + * **Shell and working directory** : Claude Code runs the command through `sh`, or through `cmd.exe` on Windows, from the user’s home directory. Give an absolute path or a command on `PATH`. + * **Output** : print exactly one line on stdout, the absolute path of the plugin directory, and exit 0 within `timeout` seconds. + * **Directory contents** : the directory holds the complete plugin by the time the command exits. The path can differ from one run to the next. + +#### + +​ + +Output that fails the install or update + +The install or update fails when the command exits non-zero, runs longer than `timeout`, or prints anything other than one absolute path. It also fails when the printed directory is one of these: + + * **No plugin content** : the printed directory has no plugin content at its top level, such as a `.claude-plugin/` directory or a `skills/`, `commands/`, `agents/`, or `hooks/` directory. + * **The session’s own directory** : the printed directory is the one Claude Code was started in, or one of its parents. + * **A network path** : on Windows, the printed path is a UNC path. + * **Too large to copy** : in copy mode, the directory is larger than 256 MiB or has more than 20,000 entries. + +#### + +​ + +Copy mode and link mode + +`mode` decides whether Claude Code copies the printed directory or uses it in place: + + * **`copy`** : Claude Code copies the directory into the plugin cache and derives the [plugin version](</docs/en/plugins/loading#how-claude-code-computes-the-version>) from a hash of the copied files. Your tool can delete or rewrite the directory after the command exits. A re-run that produces identical files counts as up to date. + * **`link`** : Claude Code fills the plugin’s cache entry with a link to each top-level entry of the printed directory and loads the files in place. Nothing is copied, file contents aren’t hashed, and the size limits don’t apply. Use it for a directory too large to copy, such as a rendered SDK export. + +A link-mode plugin has these requirements: + + * **Keep the directory in place** : Claude Code loads the plugin through the links at every startup, so the printed directory must stay where it is for as long as the plugin stays installed. + * **Print a different path to signal new content** : the version comes from the printed directory’s real path and its top-level entries, not from the files inside them. + * **Keep top-level symlinks inside the directory** : the install fails if a top-level entry is a symlink that points outside the printed directory. + * **Include`node_modules`**: Claude Code skips the [Node.js package dependency install](</docs/en/plugins/loading#node-js-package-dependencies>) for a link-mode plugin, so print a directory that already contains the packages the plugin needs. + * **Sessions started inside the directory** : a session started in the printed directory or anywhere below it doesn’t load the plugin. + * **Not on Windows** : Claude Code refuses to install a link-mode plugin on Windows. Declare `"mode": "copy"` there. + +## + +​ + +Marketplace sources + +A marketplace source says where Claude Code fetches a `marketplace.json` from. The CLI builds one for you when you add a marketplace, and you write one yourself in settings: + + * **[`claude plugin marketplace add`](</docs/en/plugins/cli-reference>)** : Claude Code builds the source from the string you pass. + * **[`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>)** : you write the source yourself as the `source` object. + * **[`strictKnownMarketplaces`](</docs/en/settings-reference#strictknownmarketplaces>) and [`blockedMarketplaces`](</docs/en/plugins/org#restrict-what-users-can-install>)**: administrators write sources in these two policy lists. `strictKnownMarketplaces` is the allowlist and `blockedMarketplaces` is the blocklist. + +The type names `url`, `git`, and `github` mean something different in a marketplace source than in a plugin source: + +Type name| As a marketplace source| As a plugin source +---|---|--- +`url`| A direct link to a `marketplace.json` file, with fields `url`, `headers`, and `headersHelper`| A git repository to clone, with fields `url`, `ref`, and `sha` +`git`| A git repository to clone, with fields `url`, `ref`, `path`, and `sparsePaths`| Doesn’t exist +`github`| A GitHub repository, with fields `repo`, `ref`, `path`, and `sparsePaths`| A GitHub repository, with fields `repo`, `ref`, and `sha`, and no `path` + +The table lists every marketplace source type with its fields, the `claude plugin marketplace add` input that produces it, and what it does in each of the three settings keys. + +Type| Fields| `marketplace add` input| `extraKnownMarketplaces`| `strictKnownMarketplaces`| `blockedMarketplaces` +---|---|---|---|---|--- +`url`| `url`, `headers`, `headersHelper`| An `http://` or `https://` URL that doesn’t match a git form| Loads| Allows the same URL| Blocks the same URL +`github`| `repo`, `ref`, `path`, `sparsePaths`| `owner/repo`, `owner/repo@ref`, or `owner/repo#ref`| Loads| Allows the same `repo`, `ref`, and `path`. `repo` may be `owner/*`| Blocks the same, and a `git` URL to the same repository +`git`| `url`, `ref`, `path`, `sparsePaths`| A `user@host:path` URL, or an `https://` URL that ends in `.git`, contains `/_git/`, or names a github.com or gitlab.com repository. `#ref` pins a ref| Loads| Allows the same URL, `ref`, and `path`| Blocks the same, and other spellings of the same github.com repository +`npm`| `package`| Not produced| Fails to load: `NPM marketplace sources not yet implemented`| Parses but matches nothing, because nothing registers an `npm` marketplace| Parses but matches nothing +`file`| `path`| A path to a `.json` file| Loads| Allows the same path| Blocks the same path +`directory`| `path`| A path to a directory| Loads| Allows the same path| Blocks the same path +`settings`| `name`, `plugins`, `owner`| Not produced| Loads| Allows an entry with the same `name` and identical `plugins`| Blocks the same `name` +`skills-dir`| none| Not produced| Fails to load: `Unsupported marketplace source type`| Keeps [skills-directory plugins](</docs/en/plugins/org#keep-skills-directory-plugins-loading>) loading while an allowlist is set. See Source values valid only in policy lists| Stops skills-directory plugins from loading +`hostPattern`| `hostPattern`| Not produced| Fails to load: `Unsupported marketplace source type`| Allows `github`, `git`, and `url` sources whose host matches| Blocks those sources +`pathPattern`| `pathPattern`| Not produced| Fails to load: `Unsupported marketplace source type`| Allows `file` and `directory` sources whose `path` matches| Blocks those sources + +### + +​ + +Fields by type + +The table lists each marketplace source field that has a default, a constraint, or a meaning specific to its type. + +Field| Types| Description +---|---|--- +`url`| `url`| Link to the `marketplace.json` file. Claude Code downloads only that file, so the marketplace’s plugins can’t use relative-path sources +`url`| `git`| The git repository to clone +`headers`| `url`| Map of HTTP headers Claude Code sends with the fetch, for authenticated hosts +`headersHelper`| `url`| Command that prints headers whose values are too short-lived to list in `headers`. Requires Claude Code v2.1.238 or later. See [Authenticate archive downloads](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>) +`repo`| `github`| In `marketplace add` and `extraKnownMarketplaces`, `repo` must name one repository. `marketplace add` rejects `owner/*` as not a valid `owner/repo` shorthand; in `extraKnownMarketplaces` Claude Code takes it literally and the clone fails +`ref`| `github`, `git`| Branch or tag. Defaults to the repository’s default branch +`path`| `github`, `git`| The marketplace file’s path inside the repository. Defaults to `.claude-plugin/marketplace.json` +`path`| `file`| The marketplace file itself. Claude Code reads it in place and takes the directory two levels up as the marketplace root, so keep the file at `<root>/.claude-plugin/marketplace.json` +`path`| `directory`| The marketplace root, the directory that contains `.claude-plugin/marketplace.json` +`sparsePaths`| `github`, `git`| Array of directories for a sparse checkout, such as `[".claude-plugin", "plugins"]`. `claude plugin marketplace add --sparse` sets it +`skipLfs`| `github`, `git`| Accepted and has no effect. See [Keep plugin files out of Git LFS](</docs/en/plugins/host-marketplace#keep-plugin-files-out-of-git-lfs>) +`name`| `settings`| Must equal the `extraKnownMarketplaces` key and can’t be a reserved name +`plugins`| `settings`| The inline catalog, with no hosted file. Each item takes `name`, `source`, `description`, `version`, `strict`, `headers`, and `headersHelper`. Write each item’s `source` as an object type, because a relative path has no repository to resolve against + +### + +​ + +Source values valid only in policy lists + +`hostPattern`, `pathPattern`, `skills-dir`, and the `owner/*` form of `repo` are valid only in the two policy lists, `strictKnownMarketplaces` and `blockedMarketplaces`: + + * **`hostPattern` and `pathPattern`**: regular expressions Claude Code tests against a source before it fetches from it. + * **`skills-dir`** : not a source. If you set `strictKnownMarketplaces` at all, [skills-directory plugins](</docs/en/plugins/org#keep-skills-directory-plugins-loading>) stop loading until you add `{"source": "skills-dir"}` to that list. + * **`owner/*`** : as a `github` `repo` value, matches every repository under exactly that GitHub owner. Requires Claude Code v2.1.223 or later. + +For match order, exact-`ref` semantics, and recipes, see [Manage plugins for your organization](</docs/en/plugins/org>). + +### + +​ + +Source objects in settings + +An `extraKnownMarketplaces` value is a map from marketplace name to an object with `source`. This entry registers a marketplace from a git repository at its `main` branch: + + { + "extraKnownMarketplaces": { + "your-marketplace": { + "source": { + "source": "git", + "url": "https://git.example.com/your-org/your-marketplace.git", + "ref": "main" + } + } + } + } + +`strictKnownMarketplaces` and `blockedMarketplaces` are arrays of source objects. This allowlist admits one GitHub owner and one internal host: + + { + "strictKnownMarketplaces": [ + { "source": "github", "repo": "your-org/*" }, + { "source": "hostPattern", "hostPattern": "^git\\.example\\.com$" } + ] + } + +## + +​ + +Validation messages + +`claude plugin validate <path>` takes the marketplace root or the marketplace file itself. It prints errors and warnings. For exit codes and `--strict`, see [plugin validate](</docs/en/plugins/cli-reference#plugin-validate>). A message names a plugin entry by its index, written as `plugins.1.source` or `plugins[1].source`. A message prefixed with an entry index and `plugin.json →`, such as `plugins[2] plugin.json →`, is about that plugin’s own files. [`claude plugin validate` reports errors](</docs/en/plugins/troubleshooting#claude-plugin-validate-reports-errors>) lists those messages with their fixes. Warnings that mention Claude Desktop flag names that Claude Code accepts but Claude Desktop rejects, because Claude Desktop’s name rules are stricter. The table maps marketplace-level messages to the field each is about. + +Message| Level| Field +---|---|--- +`Marketplace must have a name`| Error| `name` is empty +`Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")`| Error| `name` +`Marketplace name cannot contain path separators (/ or \), ".." sequences, or be "."`| Error| `name` +`Marketplace name impersonates an official Anthropic/Claude marketplace`| Error| `name`. See Reserved names +`Marketplace name cannot contain control or bidirectional-formatting characters`| Error| `name` contains a control character, such as an escape or a newline, or a Unicode bidirectional-formatting character +`Marketplace name "inline" is reserved for --plugin-dir session plugins`, and the `builtin`, `skills-dir`, `synced`, `claude-plugin-test`, `npm`, `pip`, `uv`, `cargo`, `github`, and `gh` variants| Error| `name` +`Author name cannot be empty`| Error| `owner.name` +`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`| Error| `plugins[i].name` +`Plugin name cannot contain control or bidirectional-formatting characters`| Error| `plugins[i].name` +`Duplicate plugin name "x" found in marketplace`| Error| Two entries share a `name` +`plugins.i.source: Invalid input`| Error| The entry’s `source` matches no type. See Invalid input on a source +`plugins[i].source: Path contains "..": <path>`| Error| A relative `source` that escapes the marketplace root +`source.source: 'unsupported' is a parse-time placeholder and cannot be authored`| Error| `plugins[i].source` +`Plugin "x" sets headersHelper but is not "strict": false`| Error| `plugins[i].headersHelper`, on an `archive` entry +`chain does not resolve (<reason>) — target must be a name in plugins[], a key in renames, or null`| Error| `renames.<old>` +`target "x" is not a valid plugin name (PluginIdSchema)`| Error| `renames.<old>` +`Unknown field 'x'. Claude Code ignores it at load time.`| Warning| The named key at the top level, under `metadata`, in an entry, or under an entry’s `relevance` +`Marketplace has no plugins defined`| Warning| `plugins` is empty +`Plugin "x" sets headers/headersHelper, which only apply to "archive" sources; they have no effect on this entry.`| Warning| `plugins[i].headers` or `plugins[i].headersHelper`, on an entry whose `source` isn’t `archive` +`Plugin "x" fetches its archive with a headersHelper but sets no sha256 pin`| Warning| `plugins[i].source.sha256` +`Header "x" is a request-routing/identity header that catalog entries may not set; Claude Code drops it at download time.`| Warning| `plugins[i].headers.<name>` +`Local source "x" is or traverses a symlink, so <path> was not read`| Warning| `plugins[i].source` +`No marketplace description provided. Adding a description helps users understand what this marketplace offers`| Warning| `description` +`Entry declares version "x" but <path>/plugin.json says "y". At install time, plugin.json wins`| Warning| `plugins[i].version`, on a relative-path entry +`'relevance' must be an object containing topic and signals; got <type>. It will be ignored at load time.`| Warning| `plugins[i].relevance` +`'metadata' must be a free-form object; got <type>. It will be ignored at load time.`| Warning| `plugins[i].metadata` +`'experimental' must be an object containing component declarations; got <type>. It will be ignored at load time.`| Warning| `plugins[i].experimental` +`Marketplace name "x" is reserved in Claude Desktop`| Warning| `name` is `org`, `org-provisioned`, or `unknown`. Claude Desktop rejects the marketplace +`Marketplace name "x" is not accepted by Claude Desktop (letters, digits, ".", "_", "-"; must start alphanumeric; max 128 chars)`| Warning| `name`. Claude Desktop rejects the marketplace +`Plugin name "x" is not accepted by Claude Desktop (letters, digits, ".", "_", "-"; must start alphanumeric; max 128 chars)`| Warning| `plugins[i].name`. Claude Desktop drops the entry + +### + +​ + +Invalid input on a source + +`Invalid input` on a `source` means the object matched no source type. Check for these causes: + + * A relative path that doesn’t start with `./`, other than `"."` or a bare name under `metadata.pluginRoot` + * An `npm` `package` containing `..` + * A `source` type that isn’t one of the plugin sources + * A known type with a required field missing or of the wrong type, such as `github` without `repo` + +### + +​ + +Failures that validation doesn’t catch + +`claude plugin validate` doesn’t report every failure. An entry `hooks` written as a file path or array passes validation, and the error appears only when the plugin loads, as Hooks in an entry describes. Errors fetching a `source` also appear only after install, not in validation. [`claude plugin list`](</docs/en/plugins/cli-reference>) shows a plugin that failed to load with its error, and [Troubleshoot plugins](</docs/en/plugins/troubleshooting>) covers the load-time strings. + +## + +​ + +Next steps + + * [Create a marketplace](</docs/en/plugins/create-marketplace>): build a marketplace from these fields and install from it locally + * [Host and maintain a marketplace](</docs/en/plugins/host-marketplace>): where to put the file and how users receive changes + * [Plugin manifest reference](</docs/en/plugins/manifest-reference>): the `plugin.json` fields an entry can override + * [Manage plugins for your organization](</docs/en/plugins/org>): allowlist and blocklist recipes that use these source values
added Measure plugin cost and usage View current →
Show diff (184 lines)
--- a/measure.md +++ b/measure.md @@ -0,0 +1,181 @@ +Every session where a plugin is enabled includes the names and descriptions of its skills, agents, and commands in Claude’s context, and those tokens count against the user’s usage whether or not the plugin gets used. This page shows how to see that number for a plugin, how to reduce it if you maintain the plugin, and where usage shows up so you can tell whether a plugin is still being used. This page is for plugin authors and maintainers. If you administer Claude Code for an organization, Measure across a fleet covers the same questions across every machine. + +These cases are covered on other pages: + + * **Testing how reliably the plugin changes Claude’s behavior** : see [Test plugins with evals](</docs/en/plugin-evals>) + * **Trimming your own session’s context** : see [Manage installed plugins](</docs/en/plugins/install#manage-installed-plugins>) and the [context window](</docs/en/context-window>) page + +Start with Measure what a plugin costs. + +## + +​ + +Measure what a plugin costs + +To see what a plugin adds to Claude’s context, run [`claude plugin details`](</docs/en/plugins/cli-reference#plugin-details>) with the plugin’s name. You run it in your shell, not at the prompt of a running Claude Code session. The plugin has to be loaded: installed, in a skills directory, or passed with `--plugin-dir` in the same command, as in `claude --plugin-dir ./formatter plugin details formatter`. This example reads an installed plugin named `formatter` that has two skills, a command, an agent, a hook, and an MCP server: + + claude plugin details formatter + + formatter 1.0.0 + Description: Formats and lints code on save + Source: formatter@my-marketplace + + Component inventory + Skills (3) format-all, format-code, lint-fix + Agents (1) style-reviewer + Hooks (1) PostToolUse (harness-only — no model context cost) + MCP servers (1) formatter-tools (tool schemas resolved at runtime; not counted) + LSP servers (0) + + Projected token cost + Always-on: ~146 tok added to every session + + Per-component (rounded) + component always-on on-invoke + format-code ~40 ~30 + lint-fix ~50 ~30 + style-reviewer ~40 ~40 + format-all < 20 ~30 + + On-invoke cost is paid each time a skill or agent fires. + Token counts are estimates and may differ from actual usage. + +Each part of the output answers a different question: + + * **Component inventory** : what Claude Code found in the plugin. Commands are counted with skills, so `format-all` appears under `Skills`. Hooks and MCP servers get no cost estimate and no per-component row; to see what a plugin’s MCP tools add, run `/context` in a session with the plugin enabled and read the `MCP tools` category. + * **Always-on** : the tokens that the names and descriptions of the plugin’s skills, agents, and commands add to every session where the plugin is enabled, whether or not anything runs. This is the number every user carries, and the one to reduce. + * **Per-component** : each row splits one skill, agent, or command into its always-on share and its on-invoke cost, which is the body that loads only when that component runs. Use the always-on column to find which component contributes most. + +### + +​ + +Lower the always-on figure + +If you maintain the plugin, these changes reduce what it adds to every session. If you only use it, your options are to disable or uninstall it; see [Manage installed plugins](</docs/en/plugins/install#manage-installed-plugins>). The always-on figure counts each component’s name plus its `description` and `when_to_use` frontmatter. To lower it: + + * Shorten skill and agent descriptions. + * Split a large plugin so users install only the components they need. + +A skill’s description is also what Claude matches a request against, so a shorter one can stop the skill triggering. After you trim descriptions, check triggering with a [`tool_used: Skill` grader](</docs/en/plugin-evals#create-your-first-eval-suite>) in your eval suite. For what each component type contributes, see [plugin components](</docs/en/plugins/components>). + +### + +​ + +Cost shown to users before install + +Plugins in the official marketplace show their cost to users before install. In `/plugin`, when a user browses a marketplace’s plugin list and selects a plugin, the details pane shows a **Context cost** section with an `Every turn:` line and a `When invoked:` line. When the always-on figure is 2,000 tokens or more, the `Every turn:` line appears highlighted. A plugin in your own marketplace has no **Context cost** section. + +## + +​ + +Check whether a plugin is used + +Claude Code doesn’t report a plugin’s usage back to its author. Usage is recorded on the machine of each person who installed the plugin, so what you can learn depends on your relationship to those people: + + * **You administer Claude Code for their organization** : the OpenTelemetry events and the Analytics API count installs and skill activations across every machine. See Measure across a fleet. + * **They’re teammates you can ask** : each user’s own Claude Code shows them whether they still use the plugin, in four places: the `/plugin` panel, `/skill-doctor`, `/doctor`, and `/usage`. All four are commands the user runs at the Claude Code prompt in a session on their own machine. + * **Neither** : you have no usage signal from Claude Code for that plugin. + +### + +​ + +Not used recently in `/plugin` + +On the **Installed** tab of `/plugin`, a plugin the user installed from a marketplace moves under a **Not used recently** header once it has gone unused for at least 14 days and 10 sessions. The plugin’s details also show a `Last used:` line. For what users do with that header and line, see [Find plugins you no longer use](</docs/en/plugins/install#find-plugins-you-no-longer-use>). The **Not used recently** header never appears for: + + * Plugins loaded with `--plugin-dir` or from a skills directory + * Plugins enabled through managed settings, or mounted from a [seed directory](</docs/en/plugins/org#seed-containers-and-ci>) + * Plugins that include a theme, output style, monitor, or workflow, because those are in use without a tracked invocation + +A plugin’s [language server](</docs/en/plugins/components#lsp-servers>) counts as used when it delivers diagnostics or answers a code navigation request, so an LSP plugin whose server is active in your sessions isn’t listed as unused. When the user’s organization sets [`strictKnownMarketplaces`](</docs/en/plugins/org#restrict-what-users-can-install>), neither the header nor the `Last used:` line appears. + +### + +​ + +Find skills that never run + +Run `/skill-doctor` to see what each of your skills costs and how often it gets used. It flags skills that are in Claude’s skill listing but have never been invoked, including skills from plugins. In an interactive session, the report opens in the `/plugin` manager’s **Stats** tab. See [Find unused skills](</docs/en/skills#find-unused-skills>) for what the report covers and where it’s available. + +### + +​ + +Unused plugins in `/doctor` + +The `/doctor` checkup lists each user-installed skill, MCP server, and plugin, and recommends disabling the ones that were not used. See [`/doctor` in the commands reference](</docs/en/commands#all-commands>). + +### + +​ + +Usage share in `/usage` + +On a Pro, Max, Team, or Enterprise plan, the `/usage` breakdown attributes recent usage to skills, subagents, plugins, and MCP servers as a share of the total. See [Using the `/usage` command](</docs/en/costs#using-the-/usage-command>). + +## + +​ + +Measure across a fleet + +If you administer Claude Code for an organization, you can measure plugin cost and usage across every machine from either of these sources: + + * **OpenTelemetry events** : Claude Code exports these to your own backend once you [configure an exporter](</docs/en/monitoring-usage>). See OpenTelemetry events for plugin installs and use. + * **Analytics API** : served from Anthropic’s records, with no exporter needed. See Query the Analytics API. + +### + +​ + +OpenTelemetry events for plugin installs and use + +These OpenTelemetry events and attributes answer each plugin question from your backend: + +Question| OpenTelemetry event or attribute +---|--- +Which plugins get installed, and from where| [`claude_code.plugin_installed`](</docs/en/monitoring-usage#plugin-installed-event>), one per install +Which plugins are active in how many sessions| [`claude_code.plugin_loaded`](</docs/en/monitoring-usage#plugin-loaded-event>), one per enabled plugin at session start +Which skills activate, and which plugin owns them| [`claude_code.skill_activated`](</docs/en/monitoring-usage#skill-activated-event>), with `plugin.name` and `marketplace.name` for plugin skills +What a plugin’s hooks report| [`claude_code.hook_plugin_metrics`](</docs/en/monitoring-usage#hook-plugin-metrics-event>), emitted only for hooks in official-marketplace plugins +What a plugin costs in API spend| `plugin.name` and `marketplace.name` on the [cost counter](</docs/en/monitoring-usage#cost-counter>), set when the active skill or subagent belongs to a plugin + +### + +​ + +Redacted plugin names in your backend + +Plugins from the official marketplace report their plugin name and marketplace name to your backend verbatim. Every other plugin’s name is redacted or omitted by default, including a plugin from your organization’s own marketplace. The plugin’s [trust tier](</docs/en/plugins/security#find-plugins-in-telemetry>) decides which. To get real names on some events, set the [`OTEL_LOG_TOOL_DETAILS`](</docs/en/monitoring-usage#common-configuration-variables>) environment variable to `1` on the machines that export telemetry, for example in the `env` block of the same [managed settings](</docs/en/monitoring-usage#administrator-configuration>) that configure the exporter: + +Event| Default| With `OTEL_LOG_TOOL_DETAILS=1` +---|---|--- +`plugin_loaded`| `plugin.name` and `marketplace.name` are the literal string `third-party`| Real names +`plugin_installed`, `skill_activated`| `plugin.name` and `marketplace.name` omitted; on `skill_activated`, `skill.name` is `custom_skill`| Real names +Cost counter| `plugin.name` is `third-party`; `marketplace.name` absent| Real `plugin.name`; `marketplace.name` still absent + +On `plugin_loaded`, `plugin_id_hash` still identifies each plugin by default, so you can count distinct third-party plugins. + +### + +​ + +Query the Analytics API + +On the Enterprise plan, the Analytics API answers “which plugins does my organization install and invoke” from Anthropic’s records, with no exporter needed. [`GET /v1/organizations/analytics/plugins`](<https://platform.claude.com/docs/en/api/admin/analytics/plugins/list>) returns per-plugin, per-day install and invocation counts across Claude Code and Cowork, which you can group by user, RBAC group, or product. Plugin activity that reaches Anthropic without a plugin name appears in one aggregate `third-party` row. [Find plugins in telemetry](</docs/en/plugins/security#find-plugins-in-telemetry>) says which plugins Claude Code reports by name. Authenticate the request with an API key that has the `read:analytics` scope, which a Primary Owner creates as described under [Access data programmatically](</docs/en/analytics#access-data-programmatically>). See the [endpoint reference](<https://platform.claude.com/docs/en/api/admin/analytics/plugins/list>) for the parameters and response fields. + +## + +​ + +Next steps + + * [Test plugins with evals](</docs/en/plugin-evals>): measure how reliably the plugin steers Claude, not only what it costs + * Lower the always-on figure: what to change in the plugin to reduce its per-turn cost + * [Plugin security and trust](</docs/en/plugins/security#find-plugins-in-telemetry>): which telemetry fields carry plugin names and when they’re redacted + * [Monitoring usage](</docs/en/monitoring-usage>): the full OpenTelemetry event reference
modified Monitoring View current →
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -50,7 +50,7 @@ } } -Claude Code doesn’t pass `OTEL_*` environment variables to the subprocesses it spawns, including the Bash tool, hooks, MCP servers, and language servers. An OpenTelemetry-instrumented application that you run through the Bash tool doesn’t inherit Claude Code’s exporter endpoint or headers, so set those variables directly in the command if that application needs to export its own telemetry. +Claude Code ignores the [OpenTelemetry exporter variables](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) in a repository’s `.claude/settings.json` and `.claude/settings.local.json`, so a repository can’t use them to turn telemetry on, choose where it goes, or capture content. Set them in managed settings, or have each developer set them in their shell or `~/.claude/settings.json`. A repository can still turn a signal off by setting its exporter selector, such as `OTEL_LOGS_EXPORTER`, to `none`, unless managed settings, a `--settings` file, or the environment you start Claude Code from sets that variable. Claude Code doesn’t pass `OTEL_*` environment variables to the subprocesses it spawns, including the Bash tool, hooks, MCP servers, and language servers. An OpenTelemetry-instrumented application that you run through the Bash tool doesn’t inherit Claude Code’s exporter endpoint or headers, so set those variables directly in the command if that application needs to export its own telemetry. ### @@ -587,11 +587,11 @@ * `query_source`: Category of the subsystem that issued the request. One of `"main"`, `"subagent"`, or `"auxiliary"` * `speed`: `"fast"` when the request used fast mode. Absent otherwise * `effort`: [Effort level](</docs/en/model-config#adjust-effort-level>) applied to the request: `"low"`, `"medium"`, `"high"`, `"xhigh"`, or `"max"`. Absent when Claude Code sends no effort level, for example on a model that doesn’t support effort. - * `agent.name`: Subagent type that issued the request. Built-in agent names and agents from official-marketplace plugins appear verbatim. Other user-defined agent names are replaced with `"custom"`. Absent when the request was not issued by a named subagent type. - * `skill.name`: Skill active for the request, set by the Skill tool, a `/` command, or inherited by a spawned subagent. Built-in, bundled, user-defined, and official-marketplace plugin skill names appear verbatim. Third-party plugin skill names are replaced with `"third-party"`. Absent when no skill is active. - * `plugin.name`: Owning plugin when the active skill or subagent is provided by a plugin. Official-marketplace plugin names appear verbatim. Third-party plugin names are replaced with `"third-party"`. Absent when neither the skill nor the subagent has an owning plugin. + * `agent.name`: Subagent type that issued the request. Built-in agent names and agents from official-marketplace plugins appear verbatim. Other user-defined agent names are replaced with `"custom"` unless `OTEL_LOG_TOOL_DETAILS=1` is set. Absent when the request was not issued by a named subagent type. + * `skill.name`: Skill active for the request, set by the Skill tool, a `/` command, or inherited by a spawned subagent. Built-in, bundled, user-defined, and official-marketplace plugin skill names appear verbatim. Third-party plugin skill names are replaced with `"third-party"` unless `OTEL_LOG_TOOL_DETAILS=1` is set. Absent when no skill is active. + * `plugin.name`: Owning plugin when the active skill or subagent is provided by a plugin. Official-marketplace plugin names appear verbatim. Third-party plugin names are replaced with `"third-party"` unless `OTEL_LOG_TOOL_DETAILS=1` is set. Absent when neither the skill nor the subagent has an owning plugin. * `marketplace.name`: Marketplace the owning plugin was installed from. Only emitted for official-marketplace plugins. Absent otherwise. - * `mcp_server.name`: MCP server whose tool result this request consumed. Built-in, claude.ai-proxied, and official-registry server names appear verbatim. User-configured server names are replaced with `"custom"`. Absent when the request consumed no MCP tool result. Before v2.1.222, Claude Code set this attribute on every request after an MCP tool call, not only on requests that consumed a tool result, so dashboards that aggregate it show a step down after you upgrade. + * `mcp_server.name`: MCP server whose tool result this request consumed. Built-in, claude.ai-proxied, and official-registry server names appear verbatim. User-configured server names are replaced with `"custom"` unless `OTEL_LOG_TOOL_DETAILS=1` is set. Absent when the request consumed no MCP tool result. Before v2.1.222, Claude Code set this attribute on every request after an MCP tool call, not only on requests that consumed a tool result, so dashboards that aggregate it show a step down after you upgrade. * `mcp_tool.name`: MCP tool whose result this request consumed, with the same redaction and version behavior as `mcp_server.name`. Absent when the request consumed no MCP tool result. #### @@ -990,8 +990,8 @@ * `marketplace.name`: marketplace the plugin was installed from, when known. Redacted to `"third-party"` under the same condition as `plugin.name` * `plugin.version`: version from the plugin manifest. Included only when the name is not redacted and the manifest declares a version * `plugin.scope`: provenance category for the plugin: `"official"`, `"community"`, `"org"`, `"user-local"`, or `"default-bundle"` - * `enabled_via`: how the plugin came to be enabled: `"default-enable"`, `"org-policy"`, `"admin-install"`, `"seed-mount"`, or `"user-install"`. The `"admin-install"` value means the plugin is set to required or auto-install for your organization in [**Organization settings > Plugins**](<https://claude.ai/admin-settings/plugins>). Before v2.1.246, Claude Code reported these plugins as `"user-install"` or `"seed-mount"` - * `plugin_id_hash`: deterministic hash of the plugin name and marketplace, sent only to your configured exporter. Lets you count the distinct third-party plugins loaded across your fleet without recording their names. For [plugins synced from claude.ai](</docs/en/plugins-reference#synced-plugins>), Claude Code hashes the plugin name with the marketplace name that claude.ai reports for the plugin, or with `synced` otherwise. Before v2.1.246, Claude Code didn’t use the marketplace name claude.ai reports in the hash + * `enabled_via`: how the plugin came to be enabled: `"default-enable"`, `"org-policy"`, `"admin-install"`, `"seed-mount"`, or `"user-install"`. The `"admin-install"` value means the plugin is set to required or auto-install for your organization in [**Organization settings > Plugins & skills**](<https://claude.ai/admin-settings/skills?tab=inventory>). Before v2.1.246, Claude Code reported these plugins as `"user-install"` or `"seed-mount"` + * `plugin_id_hash`: deterministic hash of the plugin name and marketplace, sent only to your configured exporter. Lets you count the distinct third-party plugins loaded across your fleet without recording their names. For [plugins synced from claude.ai](</docs/en/plugins/loading#synced-plugins>), Claude Code hashes the plugin name with the marketplace name that claude.ai reports for the plugin, or with `synced` otherwise. Before v2.1.246, Claude Code didn’t use the marketplace name claude.ai reports in the hash * `has_hooks`: whether the plugin contributes hooks * `has_mcp`: whether the plugin contributes MCP servers * `host_owned_mcp`: `true` when the SDK host manages this plugin’s MCP connections and Claude Code skipped reading the plugin’s MCP server configuration, `false` otherwise. Requires Claude Code v2.1.172 or later @@ -1239,7 +1239,7 @@ * Set it in the `env` block of managed settings, user settings, or `--settings`, or in the environment you launch Claude Code with. A value in project or local settings doesn’t turn it on, because a cloned repository can write them. * Server-managed settings can set it without showing the [security approval dialog](</docs/en/server-managed-settings#security-approval-dialogs>), because the variable only adds your organization’s own redacted policy to an event your organization already receives. -In an interactive session in a folder you haven’t [trusted](</docs/en/permissions#what-runs-before-you-trust-a-folder>), Claude Code doesn’t export the refusal event, because project and local settings could point the export at a different collector before trust. **Event Name** : `claude_code.managed_settings_resolved` **Attributes** : +In an interactive session in a folder you haven’t [trusted](</docs/en/permissions#what-runs-before-you-trust-a-folder>), Claude Code doesn’t export the refusal event. **Event Name** : `claude_code.managed_settings_resolved` **Attributes** : * All standard attributes * `event.name`: `"managed_settings_resolved"`
modified Enterprise network configuration View current →
--- a/network-config.md +++ b/network-config.md @@ -203,7 +203,7 @@ `registry.npmjs.org`| Plugin installs (fetching npm-source plugin packages and installing plugins’ Node.js package dependencies), `npx`-launched MCP servers, and the package registry for npm and bun installs of Claude Code itself `bridge.claudeusercontent.com`| [Claude in Chrome](</docs/en/chrome>) extension WebSocket bridge `*.frame.claudeusercontent.com`| [Artifact](</docs/en/artifacts>) content reads. The CLI fetches an artifact’s files from this host when Claude opens one, and only when the Artifact tool is [available](</docs/en/artifacts#availability>) for your account. To turn the tool off and drop this requirement, set [`"enableArtifact": false`](</docs/en/settings-reference#enableartifact>) or [`CLAUDE_CODE_DISABLE_ARTIFACT=1`](</docs/en/env-vars>); Claude Code also honors the deprecated [`disableArtifact`](</docs/en/settings-reference#disableartifact>) setting. See [Disable artifacts](</docs/en/artifacts#disable-artifacts>) for how these settings interact -`github.com`| Cloning GitHub-hosted [plugin marketplaces](</docs/en/plugin-marketplaces>) and plugins, including the official Anthropic marketplace, over HTTPS or SSH. To clone GitHub `owner/repo` sources over HTTPS only, set [`CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`](</docs/en/env-vars>) +`github.com`| Cloning GitHub-hosted [plugin marketplaces](</docs/en/plugins/overview>) and plugins, including the official Anthropic marketplace, over HTTPS or SSH. To clone GitHub `owner/repo` sources over HTTPS only, set [`CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`](</docs/en/env-vars>) `raw.githubusercontent.com`| Changelog feed for [`/release-notes`](</docs/en/commands>). In interactive sessions, Claude Code also fetches it in the background at startup when its cached changelog doesn’t yet cover the running version, such as the first start after an update; non-interactive and cloud sessions never fetch it `*-review.googlesource.com`| Gerrit change lookup on `googlesource.com` checkouts. When a Claude Desktop Code tab session starts or resumes on a [trusted](</docs/en/permissions#project-allow-rules-and-workspace-trust>) checkout whose `origin` is a `googlesource.com` host, Claude Code asks that host’s `-review` server anonymously for the open change matching HEAD’s `Change-Id`, once per start or resume. Other session types skip the lookup, and no other Gerrit host is contacted. Optional: disable with [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>) `http-intake.logs.us5.datadoghq.com`| Operational telemetry events, sent only when the CLI uses the Anthropic API directly, never for Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. Optional: disable with [`DISABLE_TELEMETRY`](</docs/en/data-usage#telemetry-services>) or `DO_NOT_TRACK`
added Manage Claude Code plugins for your organization View current →
Show diff (459 lines)
--- a/org.md +++ b/org.md @@ -0,0 +1,456 @@ +Managed settings let you decide which plugins Claude Code installs and allows on every machine in your organization. Users can’t override them. You deliver them either as [server-managed settings](</docs/en/server-managed-settings>) from the claude.ai admin console or as endpoint-managed settings through MDM or a `managed-settings.json` file. Most controls on this page take effect only from managed settings. This page is for administrators, and the settings here govern Claude Code. + +These cases are covered on other pages: + + * **Installing plugins for yourself** : start at [Install plugins](</docs/en/plugins/install>) + * **Controlling which plugins members can use in claude.ai and Cowork** : see [Manage plugins for your organization](<https://support.claude.com/en/articles/13837433>) in the help center + * **The plugins page in claude.ai’s admin settings** : [**Organization settings > Plugins & skills**](<https://claude.ai/admin-settings/skills?tab=inventory>) turns plugins on for members’ claude.ai accounts, and those reach Claude Code as [synced plugins](</docs/en/plugins/loading#synced-plugins>). It doesn’t set any of the keys on this page + +The sections follow the order most rollouts take: require plugins for everyone or per repository, seed containers and CI, restrict what users can add on their own, set update policy, then audit what’s installed. To review every policy key in one place, see the control matrix. + +## + +​ + +Pre-install and require plugins + +A marketplace is a catalog of plugins that Claude Code fetches from a git repository, a URL, or a local path. Once you register a marketplace on a machine, Claude Code can install plugins from it. To install plugins for a fleet, set two keys together in [managed settings](</docs/en/managed-settings>), the policy file or server-delivered policy that every machine in your organization reads: `extraKnownMarketplaces` registers a marketplace on each machine, and `enabledPlugins` names the plugins to install and enable from it. Choose a delivery mechanism covers how managed settings reach each machine. + +### + +​ + +Choose a delivery mechanism + +Managed settings reach a machine through one of three delivery mechanisms: + + * **Server-managed settings** : set the plugin keys as JSON at [**Organization settings > Claude Code > Managed settings**](<https://claude.ai/admin-settings/claude-code>). Requires an [Owner role](</docs/en/server-managed-settings#access-control>) in your Claude organization. A cloud session fetches these settings before it installs plugins. + * **MDM policies** : on macOS, deliver a plist whose top-level keys are the settings keys. On Windows, store the whole JSON document as a string in a registry value. The plist domain and the registry key are in [Where each mechanism stores the policy](</docs/en/managed-settings#where-each-mechanism-stores-the-policy>). + * **Managed settings file** : place a `managed-settings.json` at the platform’s system path. You can also add files to the `managed-settings.d/` drop-in directory beside it. The file paths per platform are in [Where each mechanism stores the policy](</docs/en/managed-settings#where-each-mechanism-stores-the-policy>), and the drop-in merge rules are in [Split a file-based policy across teams](</docs/en/managed-settings#split-a-file-based-policy-across-teams>). + +Use server-managed settings if you have a Claude for Teams or Enterprise organization on claude.ai and your devices aren’t all under MDM. Otherwise use an MDM policy or the managed settings file. For the trade-off, see [Choose between server-managed and endpoint-managed settings](</docs/en/server-managed-settings#choose-between-server-managed-and-endpoint-managed-settings>). + +#### + +​ + +Which managed source applies on a machine + +By default, only one of these three sources applies on a machine. Claude Code uses the first that delivers a policy key, checking server-managed settings first, then MDM policies, then the managed settings file. If server-managed settings deliver even one unrelated policy key, Claude Code ignores the plugin keys in an MDM policy or managed settings file on that machine, apart from the [keys it reads from every source](</docs/en/managed-settings#keys-read-from-every-admin-source>). To apply every source instead, set [`managedSourcesBehavior`](</docs/en/managed-settings#compose-every-managed-source>) to `"merge"`. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) also lists the keys Claude Code reads from every source in both modes. + +### + +​ + +Require a marketplace and its plugins + +Add the marketplace under `extraKnownMarketplaces`, keyed by the marketplace’s own `name` from its `marketplace.json`. Then add each plugin under `enabledPlugins` as `plugin-name@marketplace-name`. Each marketplace entry carries a `source` object with a `source` field naming the type, such as `github`. This managed settings example registers an organization marketplace and force-enables two plugins from it: + + { + "extraKnownMarketplaces": { + "your-marketplace": { + "source": { "source": "github", "repo": "your-org/your-marketplace" }, + "autoUpdate": true + } + }, + "enabledPlugins": { + "code-formatter@your-marketplace": true, + "deploy-helper@your-marketplace": true + } + } + +After the settings reach a machine, Claude Code registers the marketplace and installs the two plugins at the start of the user’s next session. Users see them in `/plugin`, and disabling one at their own scope doesn’t stop it from loading, because managed settings take precedence over every other scope. To block a plugin at every scope and hide it from the marketplace listing, set it to `false` in the managed `enabledPlugins` instead. Adjust the `autoUpdate` and `source` fields for your marketplace: + + * **`autoUpdate`** : `true` keeps the marketplace and its plugins refreshing in the background, and `false` turns that off. See Set update policy. + * **`source`** : `github` is one of several source types. A `git` source takes a `url` for GitLab or an internal host, and a `url` source takes the address of a hosted `marketplace.json`. Every source shape is in the [marketplace reference](</docs/en/plugins/marketplace-reference>). + +If the marketplace is a private git repository, each user needs read access to it. The clone of a git-based marketplace runs with git on the user’s machine, using stored credentials and no prompts. For users without git-host accounts, use a seed instead. A managed entry also overrides a same-name marketplace entry or `--plugin-dir` copy from another source: + + * **Marketplaces** : a managed marketplace entry replaces a lower-precedence entry with the same name, and the two entries’ fields don’t merge. + * **`--plugin-dir` copies**: `--plugin-dir` loads a plugin from a local directory for one session. For what happens when that copy’s name matches a plugin your managed `enabledPlugins` names, see [Name conflicts](</docs/en/plugins/loading#name-conflicts>). + +Anthropic’s official marketplace `claude-plugins-official` needs no `extraKnownMarketplaces` entry when `enabledPlugins` sets one of its plugins to `true`. That `name@claude-plugins-official` entry declares the marketplace by itself, wherever these keys apply. If you enable none of its plugins and still want it registered on every machine, give it an explicit entry, as Allow the official marketplace and your own does. + +### + +​ + +Require plugins per repository + +To cover one repository’s contributors instead of your whole fleet, set `extraKnownMarketplaces` and `enabledPlugins` in that repository’s `.claude/settings.json`. The `extraKnownMarketplaces` entries apply only in a folder the contributor has trusted, and in an untrusted folder Claude Code ignores them without a message: + + * **Interactive sessions** : Claude Code registers the marketplace only after the contributor accepts the [workspace trust dialog](</docs/en/permissions#what-runs-before-you-trust-a-folder>) for that folder. + * **[Non-interactive`-p` runs](</docs/en/headless>)**: the entries apply only in a folder whose trust the user already accepted interactively, or whose `hasTrustDialogAccepted` flag you set in `~/.claude.json`. + +A plugin that the marketplace lists by a relative path loads from the marketplace copy once the repository’s `extraKnownMarketplaces` entries apply. A plugin whose marketplace entry points at an external source instead, such as the plugin’s own GitHub repository, doesn’t install from the repository’s settings alone. Each contributor sees `Plugin "<name>" is enabled in project settings but isn't installed` until they run `claude plugin install <name>@<marketplace> --scope project`, as [Install plugins](</docs/en/plugins/install>) describes. If you use a local `directory` or `file` source with a relative path, the path resolves against your repository’s main checkout. When you run Claude Code from a git worktree, the path still points at the main checkout, so all worktrees share the same marketplace location. To roll out a bundle of plugins with dependencies, put the bundle plugin in `enabledPlugins`, as [Plugin dependencies](</docs/en/plugins/dependencies>) describes. + +### + +​ + +When each surface applies the plugin keys + +The table shows when each kind of Claude Code session applies `extraKnownMarketplaces` and `enabledPlugins`, from managed settings and from a repository’s `.claude/settings.json`. For the Desktop app and the IDE extensions, see [Install a plugin](</docs/en/plugins/install#install-a-plugin>). + +Surface| Managed `extraKnownMarketplaces` and `enabledPlugins`| Repository `.claude/settings.json` +---|---|--- +Terminal, interactive| Applied at session start on every machine that receives the settings| `extraKnownMarketplaces` applied after trust; `enabledPlugins` applied at session start +`-p` and CI| Applied at session start, with installs running in the background| `extraKnownMarketplaces` in trusted folders only; `enabledPlugins` applied +Cloud sessions| In an Anthropic-hosted environment, only server-managed settings reach the session, which waits for them before it installs plugins. MDM policies and managed settings files stay on the user’s machine. For a self-hosted environment, see [Where and when a policy applies](</docs/en/managed-settings#where-and-when-a-policy-applies>)| See the **Cloud session** tab under [Install a plugin](</docs/en/plugins/install#install-a-plugin>) + +In a `-p` or CI run, marketplaces and plugins install in the background, so a plugin can be missing from the first turn. Set `CLAUDE_CODE_SYNC_PLUGIN_INSTALL=1` to make the run wait for the install before its first query. + +### + +​ + +Confirm the rollout + +Check that the marketplace and plugins arrived on a machine or in a CI run: + + * **On one machine** : start Claude Code and run `/plugin`. The marketplace and the plugins are listed. + * **In CI** : run `claude -p` with `--output-format stream-json --verbose`. The `init` event lists the loaded plugins under `plugins`. + +## + +​ + +Seed containers and CI + +For container images and CI runners that can’t clone at runtime, pre-populate a plugins directory at build time and point `CLAUDE_CODE_PLUGIN_SEED_DIR` at it. Claude Code registers the seed’s marketplaces at startup and loads plugin caches from the seed in place, without cloning. A seed also serves users who have no git-host account. + +In CI/CD environments, configure a git credential helper before installing plugins from private repositories. On GitHub Actions, export a token with read access to the marketplace repository as `GH_TOKEN`, then run `gh auth setup-git`. The default workflow token can only access the workflow’s own repository, so a private marketplace in another repository needs a personal access token or app token. + +1 + +Install into the seed at build time + +Set `CLAUDE_CODE_PLUGIN_CACHE_DIR` to the seed path so the marketplace and plugins install there instead of `~/.claude/plugins`: + + CLAUDE_CODE_PLUGIN_CACHE_DIR=/opt/claude-seed claude plugin marketplace add your-org/your-marketplace + CLAUDE_CODE_PLUGIN_CACHE_DIR=/opt/claude-seed claude plugin install code-formatter@your-marketplace + +The seed has the same layout as `~/.claude/plugins`: `known_marketplaces.json`, `marketplaces/<name>/`, and `cache/<marketplace>/<plugin>/<version>/`. You can mount the seed at a different path than you built it at. + +2 + +Point the runtime at the seed + +Set `CLAUDE_CODE_PLUGIN_SEED_DIR=/opt/claude-seed` in the container’s environment. To use several seeds, separate their paths with `:` on Unix or `;` on Windows. Claude Code uses the first seed that contains a given marketplace or plugin cache. + +3 + +Enable the plugins + +The plugins in a seed aren’t enabled on their own. Set `enabledPlugins` for each seed plugin you want loaded, in managed settings or in the repository’s `.claude/settings.json`. + +To verify a seed, run `claude -p` with `--output-format stream-json --verbose` in the image. In the `init` event’s `plugins` list, each loaded plugin’s `path` is under the seed, such as `/opt/claude-seed/cache/your-marketplace/code-formatter/1.0.0`. Seed marketplaces follow these rules: + + * **Read-only** : Claude Code never writes to the seed and forces `autoUpdate` off for seed marketplaces. + * **Seed entries take precedence** : on each startup, a marketplace declared in the seed overwrites the user’s entry of the same name. Users opt out of a seed plugin with `claude plugin disable`, not by removing the marketplace. + * **Update and remove fail** : `claude plugin marketplace update <name>` and `remove` without `--scope` on a seed marketplace fail with a message that names the seed directory. + * **Policy still applies** : the allowlist and blocklist check a seed marketplace’s recorded source too. Allow the source you built the seed from. + +For fleets with no outbound git access, combine a seed with `directory` or `file` marketplace sources on a shared mount. Set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` as well, which also turns off [plugin auto-update](</docs/en/plugins/loading#when-auto-update-runs>). If a proxy is available, see [Proxy configuration](</docs/en/network-config#proxy-configuration>) for the variables to set. + +## + +​ + +Restrict what users can install + +The managed `strictKnownMarketplaces` allowlist and `blockedMarketplaces` blocklist decide which marketplace sources plugins may come from. A marketplace’s source is the git repository, URL, or local path that Claude Code fetches it from. Both lists match the source of the marketplace a plugin comes from, not the plugin’s own entry inside that marketplace. For the common lockdown, which allows the official marketplace and your own, see Allow the official marketplace and your own. Pair it with `disableSideloadFlags` so users can’t load plugins from a local directory or URL either. Both lists apply before anything downloads and again at session start: + + * **Before a download** : the lists apply when a user adds a marketplace and on every install, update, refresh, and auto-update. + * **At session start** : the lists apply again to plugins that are already installed, so an installed plugin whose marketplace source no longer matches doesn’t load. `/plugin` lists it with `Marketplace "<name>" is not in the allowed marketplace list` or `Marketplace "<name>" is blocked by enterprise policy`. + +Where the two lists are enforced depends on where you set them: + + * **The claude.ai admin console** : Claude Code enforces both lists in the sessions that [read server-managed settings](</docs/en/managed-settings#where-and-when-a-policy-applies>). claude.ai also checks them when anyone in your organization adds a new marketplace from a git repository on claude.ai, or from **Customize** in the Claude Desktop app outside its Code tab. That covers a marketplace a member adds for their own account and one added for the whole organization under [**Organization settings > Plugins**](<https://claude.ai/admin-settings/plugins>). claude.ai refuses a repository that the allowlist doesn’t admit or that the blocklist names. It doesn’t re-check a marketplace that was added in either place before you set the lists, and it doesn’t check uploaded plugins. + * **A managed settings file, OS-level policy, or other managed source** : Claude Code enforces both lists where it reads that source. claude.ai doesn’t read it. + +While any allowlist is set, or a blocklist names any source other than `skills-dir`, a plugin whose marketplace Claude Code can’t find doesn’t load. `/plugin` shows the policy error for it rather than a not-found error. The common case is a stale `enabledPlugins` entry for a marketplace nobody registered. + +### + +​ + +Control matrix + +The table lists each plugin policy key, what it enforces, and what it can’t do. + +Key| What it enforces| What it can’t do +---|---|--- +`strictKnownMarketplaces`| Allowlist of marketplace sources. `[]` blocks every source, including the official marketplace. Alias: `allowedMarketplaces`| Doesn’t register a marketplace, restrict entries inside an allowed marketplace, or block `--plugin-dir` +`blockedMarketplaces`| Blocklist of marketplace sources, checked before the allowlist| Doesn’t block a marketplace already registered from a source it doesn’t match +`syncClaudeAiPlugins`| Set `false` to stop Claude Code downloading and loading the plugins [synced from claude.ai](</docs/en/plugins/loading#synced-plugins>) for each user’s account. Requires Claude Code v2.1.273 or later| Doesn’t turn off one synced plugin. For that, set `"<name>@synced": false` in [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>) +`enabledPlugins`| `true` force-enables, `false` blocks at every scope and hides the plugin| Doesn’t install a plugin whose marketplace isn’t registered or allowed +`disableSideloadFlags`| Rejects `--plugin-dir`, `--plugin-url`, `--agents`, the Agent SDK `plugins` option, and non-SDK `--mcp-config` at startup, and rejects folders named in the [`CLAUDE_CODE_PLUGIN_DIRS`](</docs/en/env-vars#variables>) variable the same way| Doesn’t restrict `.mcp.json`, `claude mcp add`, or SDK-provided servers. Pair it with [`allowedMcpServers`](</docs/en/managed-mcp>) +`disableCommandPluginSources`| Blocks plugins with a `command` source from installing, updating, or loading. A `command` source is one whose plugin directory is produced by running a command on the machine. When unset, it takes the value of `allowManagedHooksOnly`| Doesn’t affect other source types +`allowManagedHooksOnly`| Restricts which hooks run. See [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>)| Doesn’t trust hooks from plugins users enable themselves +`strictPluginOnlyCustomization`| Blocks skills, agents, hooks, and MCP servers that don’t come from a plugin, managed settings, or Claude Code’s built-ins. Set `true` to cover all four types, or an array of `skills`, `agents`, `hooks`, and `mcp` values such as `["skills", "hooks"]` to cover some| Doesn’t restrict which plugins users install. Pair it with `strictKnownMarketplaces` +`pluginSuggestionMarketplaces`| Marketplaces whose plugins may appear as install suggestions. See Recommend plugins| Doesn’t affect the built-in tips +`pluginTrustMessage`| Appends your text to the trust warning that `/plugin` shows before a plugin installs| Doesn’t change the warning’s own text +`allowedChannelPlugins`| Replaces the default list of plugins allowed to push channel messages. Requires `channelsEnabled: true`| See [Restrict which channel plugins can run](</docs/en/channels#restrict-which-channel-plugins-can-run>) +[`CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL=1`](</docs/en/env-vars>)| Stops interactive terminal sessions from auto-registering the official marketplace| Doesn’t remove a marketplace already registered. The allowlist and blocklist gate the same auto-registration without it. A machine that started once with it set doesn’t resume auto-registration after you unset it + +Every key in the table is a managed setting, apart from `enabledPlugins`, `syncClaudeAiPlugins`, and `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`: + + * **`enabledPlugins`** : you can set it in any scope, and managed settings lock it. + * **`syncClaudeAiPlugins`** : each user can also set it in their own user or local settings. See its [scope in the settings reference](</docs/en/settings-reference#syncclaudeaiplugins>). + * **`CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`** : this is an environment variable that you deliver through the managed `env` block shown under Turn updates off for the whole fleet. + +Each settings key here has an entry in the [settings reference](</docs/en/settings-reference>). + +#### + +​ + +Aliases for the marketplace keys + +`strictKnownMarketplaces` can also be spelled `allowedMarketplaces`, and `extraKnownMarketplaces` can also be spelled `additionalMarketplaces`. + + * **Version** : the aliases require Claude Code v2.1.232 or later, and older clients ignore them. In a file that a mixed fleet reads, keep the canonical names. + * **Both spellings set** : when a file sets both spellings, the canonical key’s value applies. + +### + +​ + +Allowlist with `strictKnownMarketplaces` + +Set the allowlist to a list of these source objects. Most entries match exactly, `hostPattern` and `pathPattern` entries match as regular expressions, and `github` owner wildcards match by owner: + + * **`github`** : `{ "source": "github", "repo": "your-org/approved-plugins" }`, with optional `ref` and `path`. + * **`github` owner wildcard**: `{ "source": "github", "repo": "your-org/*" }` matches every repository under that owner. The `*` must stand for the whole repository name. Claude Code ignores entries such as `*/plugins` and `your-org/tools-*` as invalid, so they match nothing. Requires Claude Code v2.1.223 or later. + * **`git`** : `{ "source": "git", "url": "https://gitlab.example.com/tools/plugins.git" }`, with optional `ref` and `path`. + * **`url`** : `{ "source": "url", "url": "https://plugins.example.com/marketplace.json" }`, with optional `headers`. + * **`file` and `directory`**: `{ "source": "file", "path": "/opt/marketplace/marketplace.json" }` or `{ "source": "directory", "path": "/opt/marketplace/plugins" }`, with absolute paths. + * **`hostPattern`** : `{ "source": "hostPattern", "hostPattern": "^github\\.example\\.com$" }`, matched against the host of `github`, `git`, and `url` sources. The pattern matches anywhere in the hostname, so anchor it with `^` and `$` as shown to match the whole host. A `github` source always counts as `github.com`. Use a `hostPattern` entry for a GitHub Enterprise Server or GitLab host where developers create their own marketplaces. The [GHES page](</docs/en/github-enterprise-server#allowlist-ghes-marketplaces-in-managed-settings>) has the worked example. + * **`pathPattern`** : `{ "source": "pathPattern", "pathPattern": "^/opt/approved/" }`, matched against the `path` of `file` and `directory` sources. The pattern matches anywhere in the path, so start it with `^` to pin a directory prefix. `".*"` allows every local path. + * **`skills-dir`** : `{ "source": "skills-dir" }` keeps skills-directory plugins loading while an allowlist is set, and matches no marketplace. + +#### + +​ + +How entries match + +A `url` entry matches on its `url` value; `headers` aren’t compared. For `github` and `git` entries, the `repo` or `url`, the `ref`, and the `path` must all match, or be absent on both sides: + + * An entry without `ref` doesn’t cover a source with `ref: "main"`. + * An entry for `your-org/your-marketplace` doesn’t cover a `git` URL that clones the same repository. + * A trailing slash, a `.git` suffix, or `ssh://` in place of `https://` is a different value. When a marketplace can be cloned by more than one URL, prefer a `hostPattern` entry. + +Owner-wildcard entries follow the exact rules for `ref` and match any `path` inside the repository unless the entry pins one. Wildcard matching is case-sensitive on the allowlist. + +#### + +​ + +Keep skills-directory plugins loading + +Skills-directory plugins are the plugins users keep under `~/.claude/skills/` or a project’s `.claude/skills/` in folders that carry a `.claude-plugin/plugin.json`. If you set any allowlist without a `{ "source": "skills-dir" }` entry, they stop loading. Plain [skills](</docs/en/skills>), meaning a `SKILL.md` without that manifest, keep loading. + +#### + +​ + +Marketplaces hosted on claude.ai + +The allowlist and blocklist match a [marketplace hosted on claude.ai](</docs/en/plugins/install#add-from-claude-ai>) by its host. To allow or block one, add a `hostPattern` entry that matches `claude.ai` to `strictKnownMarketplaces` or `blockedMarketplaces`. On the allowlist, such an entry admits your organization’s claude.ai marketplaces and the claude.ai default marketplaces, but not a marketplace made of a member’s own claude.ai uploads or one whose scope claude.ai didn’t state. Requires Claude Code v2.1.273 or later. + +#### + +​ + +Lock every source out + +An empty allowlist, `[]`, locks every marketplace source out, including the official marketplace. This lockdown doesn’t cover the plugins [synced from claude.ai](</docs/en/plugins/loading#synced-plugins>), which Claude Code downloads from each user’s account rather than from a marketplace. To stop those as well, set [`syncClaudeAiPlugins`](</docs/en/settings-reference#syncclaudeaiplugins>) to `false` in managed settings, or turn off Skills for your organization on claude.ai. + +### + +​ + +Blocklist with `blockedMarketplaces` + +`blockedMarketplaces` takes the same source objects as `strictKnownMarketplaces` and is checked first, so a source on both lists is blocked. Blocklist matching is wider than allowlist matching: + + * Git URLs are canonicalized, so the `git@` and `https://` forms, `.git` suffixes, and trailing slashes of one `github.com` repository all match the same entry. + * A `github` entry also blocks the equivalent `git` URL, and the other way around. + * For an `owner/*` entry, the owner comparison is case-insensitive. + * An entry without `ref` or `path` blocks every ref and path of the repositories it matches. + +This entry blocks every repository under one GitHub owner: + + { + "blockedMarketplaces": [ + { "source": "github", "repo": "untrusted-org/*" } + ] + } + +The `url` entries in `blockedMarketplaces` also apply when a user adds an `https://` repository URL that Claude Code [clones rather than fetches](</docs/en/plugins/cli-reference#plugin-marketplace-add>), such as a bare `github.com` or `gitlab.com` repository URL. The user can’t add that URL if an entry names it. The match ignores the `.git` suffix and any ref the user appends after `#`. Requires Claude Code v2.1.232 or later. A `{ "source": "skills-dir" }` entry here stops skills-directory plugins from loading, from both `~/.claude/skills/` and a project’s `.claude/skills/`. A blocklist that names only that entry doesn’t count as an active restriction, so it doesn’t stop plugins whose marketplace Claude Code can’t find from loading. + +### + +​ + +Allow the official marketplace and your own + +Most organizations allow the official marketplace and their own, and register both so every machine has them. This managed settings policy allows both marketplaces, registers both, force-enables two plugins, and rejects `--plugin-dir`: + + { + "strictKnownMarketplaces": [ + { "source": "github", "repo": "anthropics/claude-plugins-official" }, + { "source": "github", "repo": "your-org/*" }, + { "source": "skills-dir" } + ], + "extraKnownMarketplaces": { + "claude-plugins-official": { + "source": { "source": "github", "repo": "anthropics/claude-plugins-official" } + }, + "your-marketplace": { + "source": { "source": "github", "repo": "your-org/your-marketplace" } + } + }, + "enabledPlugins": { + "code-formatter@your-marketplace": true, + "deploy-helper@your-marketplace": true + }, + "disableSideloadFlags": true + } + +On a machine with this policy, adding any source outside the list, for example `/plugin marketplace add https://example.com/other-marketplace.git`, fails with a message containing `is blocked by enterprise policy` followed by the allowed sources. `claude --plugin-dir ./x` exits with a message naming `disableSideloadFlags`. The `{ "source": "skills-dir" }` entry keeps skills-directory plugins loading under this allowlist. Remove that entry and they stop loading. Register both marketplaces with explicit `extraKnownMarketplaces` entries, as this policy does, rather than relying on the allowlist or on the official marketplace registering itself: + + * **The allowlist doesn’t register anything** : an `extraKnownMarketplaces` entry does, and it must itself pass the allowlist. Claude Code refuses to register a managed marketplace whose source the allowlist doesn’t match. + * **The official marketplace registers itself only in an interactive terminal session** : even there, it registers only when the allowlist permits it. A `-p` run or a terminal attached to a cloud session never registers it. + * **A blocked attempt is remembered** : if a machine ever ran under a policy that blocked the official marketplace, Claude Code records the blocked attempt and doesn’t retry after the policy changes. An `[]` lockdown is one such policy. That machine registers it again only through an `extraKnownMarketplaces` entry such as the one in this policy, an `enabledPlugins` entry for one of its plugins, or a manual `/plugin marketplace add`. + +## + +​ + +Set update policy + +You can set update policy per marketplace, for the whole fleet, or per user group through release channels. + +### + +​ + +Turn auto-update on or off per marketplace + +Plugin auto-update runs in the background after startup for marketplaces that have it turned on. For which marketplaces have it on by default, see [When auto-update runs](</docs/en/plugins/loading#when-auto-update-runs>). To decide for the fleet, set `"autoUpdate": true` or `false` on a managed `extraKnownMarketplaces` entry: + + * If the managed entry sets the field, Claude Code refuses the user’s `/plugin` toggle with an error that starts `Auto-update for '<name>' is set by`. + * If the managed entry leaves the field unset, the user’s toggle persists. + +### + +​ + +Turn updates off for the whole fleet + +To turn plugin auto-update off for every marketplace, set `DISABLE_AUTOUPDATER` in the managed `env` block, as this example does. The same variable also stops Claude Code’s own updates: + + { + "env": { + "DISABLE_AUTOUPDATER": "1" + } + } + +To stop Claude Code’s own updates but keep plugin auto-update, add `"FORCE_AUTOUPDATE_PLUGINS": "1"` to the same block. The other [environment variables that stop plugin auto-update](</docs/en/plugins/loading#when-auto-update-runs>) work the same way. `DISABLE_AUTOUPDATER` doesn’t cover plugins with a [`command` source](</docs/en/plugins/marketplace-reference#command-plugin-source>). Claude Code re-runs each enabled one’s command every session and installs the output when it changed. For what stops those runs, see [When a command source re-runs](</docs/en/plugins/loading#when-a-command-source-re-runs>). + +### + +​ + +Assign release channels to user groups + +To run stable and early-access channels, host two marketplaces that point at different refs of the same plugins. Then give each user group its own marketplace through either separate endpoint-managed settings or a gateway policy. Server-managed settings from the admin console [apply to every user in your organization](</docs/en/server-managed-settings#current-limitations>), so they can’t assign different settings to different groups. + + * Deploy separate [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>), such as a managed settings file or an MDM profile, to each group’s devices. To check whether the per-group file or profile applies on a device that also has an organization-wide source, see [How Claude Code combines managed sources](</docs/en/managed-settings#precedence-within-the-managed-tier>). + * Define one [Claude apps gateway policy](</docs/en/claude-apps-gateway-config#managed>) per group. The gateway applies the first policy whose match rule fits a user, so order the policies so that each user reaches their group’s policy. That policy’s `extraKnownMarketplaces` map doesn’t merge with any other policy’s, so list every marketplace the group needs in it, not only its channel marketplace. + +With either mechanism, the stable group receives this configuration: + + { + "extraKnownMarketplaces": { + "stable-tools": { + "source": { "source": "github", "repo": "your-org/stable-tools" } + } + } + } + +The early-access group receives `latest-tools` instead. To set up the two marketplaces, see [Run release channels](</docs/en/plugins/host-marketplace#run-release-channels>). + +## + +​ + +Recommend plugins + +Marketplace owners can attach `relevance` signals to entries so Claude Code suggests the plugin when a project matches. Suggestions from a marketplace appear only when it’s registered on the user’s machine, you list its name in `pluginSuggestionMarketplaces` in managed settings, and you declare its source in the same policy. Declare the source either as the marketplace’s `extraKnownMarketplaces` entry or as an allowlist entry. The official marketplace needs only the name. See [Enable suggestions in managed settings](</docs/en/plugins/relevance#enable-suggestions-in-managed-settings>). + +## + +​ + +Audit and review + +OpenTelemetry events and the Analytics API tell you what your fleet installs and runs. For what a plugin can run on a machine and what each trust tier permits, read [Plugin security](</docs/en/plugins/security>) before you approve a marketplace. + +### + +​ + +OpenTelemetry events + +`claude_code.plugin_installed` records each install, and `claude_code.plugin_loaded` records each enabled plugin at session start. Both events redact or omit third-party plugin and marketplace names unless you set `OTEL_LOG_TOOL_DETAILS=1`, as [Redacted plugin names in your backend](</docs/en/plugins/measure#redacted-plugin-names-in-your-backend>) shows. Field lists are under [Plugin installed event](</docs/en/monitoring-usage#plugin-installed-event>) and [Plugin loaded event](</docs/en/monitoring-usage#plugin-loaded-event>). + +### + +​ + +Analytics API + +On the Enterprise plan, `GET /v1/organizations/analytics/plugins` returns per-plugin, per-day install and invocation counts across Claude Code and Cowork. You can group the counts by user or RBAC group. Plugin activity that reaches Anthropic without a plugin name appears in one aggregate `third-party` row. See the [endpoint reference](<https://platform.claude.com/docs/en/api/admin/analytics/plugins/list>) and [Access data programmatically](</docs/en/analytics#access-data-programmatically>) for the key it needs. + +## + +​ + +Plan for what managed settings can’t enforce + +These requests from security reviews have no dedicated key in the current settings schema. The nearest existing controls are: + + * **Per-user or per-group targeting** : every plugin key applies to every user who receives the settings. Server-managed settings deliver one configuration per organization. For per-group policy, use separate endpoint-managed settings or gateway policies, as under Assign release channels to user groups. + * **Restricting entries inside an allowed marketplace** : the allowlist matches marketplace sources. To block one plugin from an allowed marketplace, set it to `false` in managed `enabledPlugins`. + * **Hiding`/plugin`**: no key disables the command. The nearest equivalent combines an allowlist naming only your marketplace, managed `enabledPlugins` entries for the plugins you supply, and `disableSideloadFlags`. + * **Gating`--plugin-dir` through the allowlist**: the allowlist doesn’t cover `--plugin-dir`. `disableSideloadFlags` does. + * **Enforcing the claude.ai plugin toggles through these keys** : [**Organization settings > Plugins & skills**](<https://claude.ai/admin-settings/skills?tab=inventory>) doesn’t set the keys on this page. What members and your organization turn on there reaches the CLI as [synced plugins](</docs/en/plugins/loading#synced-plugins>), which have their own controls. + +## + +​ + +Troubleshoot policy + +If plugin policy doesn’t behave as expected on a machine, check for these symptoms first: + + * **The managed file didn’t parse** : when a `managed-settings.json` isn’t valid JSON, Claude Code refuses to start and prints [an error naming the file](</docs/en/errors#managed-settings-document-could-not-be-parsed>). A file that parses but has one invalid entry keeps the rest of its policy. See [Invalid entries in managed settings](</docs/en/managed-settings#invalid-entries-in-managed-settings>). + * **The managed source didn’t load** : run `/status` and look for `Enterprise managed settings` in the `Setting sources` line. If it’s missing, the source didn’t load. + * **A user reports`blocked by enterprise policy`**: the message names the marketplace or its source. For an allowlist, it also lists the allowed sources. The user-facing entries are on [Troubleshoot plugins](</docs/en/plugins/troubleshooting>). + * **A plugin the user disabled in`~/.claude/settings.json` still loads**: another settings source re-enabled it, such as a managed `enabledPlugins` entry that force-enables it. `/plugin` and `claude plugin list` show `Disabled in ~/.claude/settings.json but still loads` with that settings source. + +## + +​ + +Next steps + + * [Marketplace reference](</docs/en/plugins/marketplace-reference#marketplace-sources>): the `source` values `extraKnownMarketplaces`, `strictKnownMarketplaces`, and `blockedMarketplaces` accept + * [Host and maintain a marketplace](</docs/en/plugins/host-marketplace>): run the marketplace your policy points at + * [Plugin security and trust](</docs/en/plugins/security>): what a plugin can do on a machine and how to review one before installing + * [Server-managed settings](</docs/en/server-managed-settings>): deliver these keys from the claude.ai admin console + * [Troubleshoot plugins](</docs/en/plugins/troubleshooting#blocked-by-your-organization>): the messages users see when policy blocks them
modified Output styles View current →
--- a/output-styles.md +++ b/output-styles.md @@ -147,7 +147,7 @@ Run `/output-style <style>` in the terminal, or run `/config` and select your style under **Output style**. Claude uses the new style starting with your next message. In the terminal, Claude Code reads style files when it starts, so if you create or edit one during a running session, restart Claude Code to pick up the change. -[Plugins](</docs/en/plugins-reference>) can also ship output styles in an `output-styles/` directory. +[Plugins](</docs/en/plugins/manifest-reference>) can also ship output styles in an `output-styles/` directory. ### @@ -204,5 +204,5 @@ * [Settings](</docs/en/settings>): where the `outputStyle` field lives and how settings precedence works * [Permission modes](</docs/en/permission-modes>): how the Proactive style compares to auto mode - * [Plugins](</docs/en/plugins>): package and distribute output styles alongside skills, hooks, and agents + * [Plugins](</docs/en/plugins/overview>): package and distribute output styles alongside skills, hooks, and agents * [Debug your configuration](</docs/en/debug-your-config>): diagnose why an output style isn’t taking effect
modified Choose a permission mode View current →
--- a/permission-modes.md +++ b/permission-modes.md @@ -256,7 +256,18 @@ Server-side classifier review -On Enterprise plans and accounts that use the Claude API, on [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, and whenever you point `ANTHROPIC_BASE_URL` at an [LLM gateway or proxy](</docs/en/llm-gateway>), Claude Code in auto mode asks the server to review the actions that go to the classifier as part of the session’s model requests. Where the server reviews them, its verdicts decide those actions. Where it doesn’t, most often because an LLM gateway or proxy interferes with the traffic, or because the platform, region, or credential doesn’t have server-side checks yet, Claude Code falls back to its own classifier requests, and once that fallback holds for the rest of the session it shows a [notice about classifier request charges](</docs/en/auto-mode-classifier-billing>) on accounts where those requests are billed. To skip asking the server and always use Claude Code’s own classifier requests, set [`CLAUDE_CODE_AUTO_MODE_SERVER=0`](</docs/en/env-vars>). The variable isn’t read on a direct connection to the Anthropic API. If you set `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` and leave `CLAUDE_CODE_AUTO_MODE_SERVER` unset, Claude Code also stops asking the server. Asking the server by default requires Claude Code v2.1.278 or later. +In auto mode, Claude Code can ask the server to check the actions that the decision order sends for review, as part of the session’s model requests, in place of sending its own classifier requests. These sessions ask: + + * **A direct connection to the Anthropic API** : in an interactive terminal session, on every claude.ai plan and on accounts that use the Claude API, as Anthropic rolls it out. Requires Claude Code v2.1.271 or later on Pro, Max, and Team plans, and v2.1.278 or later on Enterprise plans and Claude API accounts. From v2.1.282, a session that [doesn’t fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), for example because you turned telemetry off, asks the server by default in any kind of session. + * **A cloud provider, or an LLM gateway or proxy** : on [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, and whenever you point `ANTHROPIC_BASE_URL` at an [LLM gateway or proxy](</docs/en/llm-gateway>), whatever your plan. Asking by default requires Claude Code v2.1.278 or later. + * **A signed-in[Claude apps gateway](</docs/en/claude-apps-gateway>) session**: requires Claude Code v2.1.280 or later + +Where the server reviews the actions, its verdicts decide them. Two other outcomes are possible: + + * **The server doesn’t review the session** : a response completes with no review results, or the server answers that it doesn’t review this session. The most common causes are an LLM gateway or proxy that drops the request for review or the results, and a platform, region, or credential that doesn’t have server-side checks yet. Claude Code falls back to its own classifier requests. Once that fallback holds for the rest of the session, it shows a [notice about classifier request charges](</docs/en/auto-mode-classifier-billing>) on accounts where those requests are billed. + * **The server gives no verdict for an action** : Claude Code denies the action rather than run it unreviewed. On any connection, this happens when the response ends before the review results arrive or the results arrive in a form Claude Code can’t read. An LLM gateway or proxy that cuts responses short or rewrites the results can cause either. On a direct connection to the Anthropic API, it also happens when the server’s check fails for the action, for example by timing out. [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>) covers the denial message, what happens when denials repeat, and what to do. + +To skip asking the server and always use Claude Code’s own classifier requests, set [`CLAUDE_CODE_AUTO_MODE_SERVER=0`](</docs/en/env-vars>). On a direct connection to the Anthropic API, the variable requires Claude Code v2.1.281 or later. Setting it to `1` there turns server review on in a session that doesn’t have it yet, such as a `-p` or Agent SDK session, unless you’ve also set `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`. If you set `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` and leave `CLAUDE_CODE_AUTO_MODE_SERVER` unset, Claude Code also stops asking the server. ### @@ -394,6 +405,7 @@ * **A blocked action** : Claude Code shows a notification and lists the action in `/permissions` under the **Recently denied** tab, where you can press `r` to retry it with a manual approval. When the classifier produces [no verdict on the action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>), because a safety check separate from auto mode refused the classifier’s own request or its response didn’t parse, Claude Code denies the action without the notification or the **Recently denied** entry. * **Repeated blocks** : if the classifier blocks an action 3 times in a row or 20 times total, auto mode pauses and Claude Code resumes prompting. Approving the prompted action resumes auto mode. These thresholds are not configurable. Any allowed action resets the consecutive counter, while the total counter persists for the session and resets only when its own limit triggers a fallback. Claude Code doesn’t count a denial toward either threshold when [a safety check separate from auto mode refuses the classifier’s own request](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>); the linked entry covers how Claude Code handles those denials. * **Sessions that can’t prompt** : a [non-interactive](</docs/en/headless>) `-p` run without a [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) has no prompt to fall back to. When repeated blocks reach a threshold, the action doesn’t run and Claude keeps working. The same applies when [a safety check separate from auto mode refuses the classifier’s request](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>). Claude Code doesn’t stop the run in either case. + * **No verdict from the server** : under server-side classifier review, Claude Code denies an action the server gives no verdict for, and stops the turn after ten responses in a row with no verdict. See [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>). * **A mode switch during a check** : if you switch permission modes while a classifier check is pending, Claude Code discards a verdict the new mode wouldn’t have requested rather than applying it: you’re prompted for approval instead, or the action is auto-denied in `dontAsk` mode. Repeated blocks usually mean the classifier is missing context about your infrastructure. Use `/feedback` to report false positives, or have an administrator [configure trusted infrastructure](</docs/en/auto-mode-config>). @@ -408,6 +420,7 @@ * A shell command that carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>) also routes to the classifier even when an allow rule matches, because a rule approves the command, not its hosts * Ask rules that match on a command’s content, such as `Bash(git push *)`, fall back to a permission prompt 2. Read-only actions and file edits in your working directory are auto-approved, except writes to protected paths and the first read outside the working directories, which prompts you + * In a session with server-side classifier review, read-only and [sandboxed](</docs/en/sandboxing#sandbox-modes>) shell commands wait for that review and are blocked if it flags them 3. Everything else goes to the classifier. The connector tools and `requiresUserInteraction` MCP tools that prompt you directly in step 1 never reach the classifier, so neither an org-required approval nor a consent step is auto-approved 4. If the classifier blocks, Claude receives the reason and tries an alternative. In most sessions the reason names the rule the classifier matched, such as `[Data Exfiltration]`, rather than giving a written explanation; see [Review denials](</docs/en/auto-mode-config#review-denials>)
modified Configure permissions View current →
--- a/permissions.md +++ b/permissions.md @@ -257,7 +257,7 @@ Bypass permissions mode (`bypassPermissions`) -Auto-approves tool uses without prompting, except the cases listed in the warning below. Hooks still execute and can block operations if needed. +Auto-approves tool uses without prompting, except the cases listed in the warning below. Hooks still execute and can block operations if needed. On Linux and macOS, Claude Code refuses to start in this mode as root or under `sudo` outside a [recognized sandbox](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>), and the query fails before the first turn. Use with extreme caution. Claude has full system access in this mode. Only use in controlled environments where you trust all possible operations.`allowed_tools` does not constrain this mode. Every tool is approved, not just the ones you listed. These controls still apply:
modified Platforms and integrations View current →
--- a/platforms.md +++ b/platforms.md @@ -34,7 +34,7 @@ [GitLab CI/CD](</docs/en/gitlab-ci-cd>)| Same as GitHub Actions for GitLab| CI-driven automation on GitLab [Code Review](</docs/en/code-review>)| Reviews every PR automatically| Catching bugs before human review [Slack](</docs/en/slack>)| Responds to `@Claude` mentions in your channels| Turning bug reports into pull requests from team chat -[Claude Tag](</docs/en/claude-tag>)| Runs `@Claude` as your organization’s shared identity with admin-configured access| Shared team access on Team and Enterprise plans, instead of per-user Slack sessions +[Claude Tag](<https://claude.com/docs/claude-tag>)| Runs `@Claude` as your organization’s shared identity with admin-configured access| Shared team access on Team and Enterprise plans, instead of per-user Slack sessions For integrations not listed here, [MCP servers](</docs/en/mcp>) and [connectors](</docs/en/desktop#connect-external-tools>) let you connect almost anything: Linear, Notion, Google Drive, or your own internal APIs. @@ -89,7 +89,7 @@ * [GitLab CI/CD](</docs/en/gitlab-ci-cd>): the same for GitLab * [Code Review](</docs/en/code-review>): automatic review on every pull request * [Slack](</docs/en/slack>): send tasks from team chat, get PRs back - * [Claude Tag](</docs/en/claude-tag>): run `@Claude` as your organization’s shared identity on Team and Enterprise plans + * [Claude Tag](<https://claude.com/docs/claude-tag>): run `@Claude` as your organization’s shared identity on Team and Enterprise plans ###
modified Test plugins with evals View current →
Show diff (333 lines)
--- a/plugin-evals.md +++ b/plugin-evals.md @@ -1,4 +1,10 @@ -`claude plugin eval` runs your [plugin](</docs/en/plugins>) against a suite of test cases and scores the results. Each case is a realistic prompt plus one or more graders. A grader is a pass/fail check on what Claude produced, such as a regex over the reply, whether a particular tool was called, or a rubric that a second model judges the reply against. You don’t have to write the suite manually. `claude plugin eval init` asks you about your plugin, proposes the cases and graders, tries them, and writes the files. You can also ask Claude to do the same from a session you already have open. Use evals to measure how reliably your plugin steers Claude to the right outcome, to catch regressions when you change the plugin or a new model ships, and to see what the plugin contributes compared with no plugin at all. This page is for plugin and skill authors who have a working plugin and want to test its behavior, and for teams that gate plugin changes in CI. Its case format is separate from the `evals/evals.json` file the [skill-creator plugin](</docs/en/skills#run-evals-with-skill-creator>) uses. To create a plugin, see [Create plugins](</docs/en/plugins>); to check a plugin’s files for syntax and schema errors rather than its behavior, use [`claude plugin validate`](</docs/en/plugins-reference#plugin-validate>). +The `claude plugin eval` shell command runs your [plugin](</docs/en/plugins/overview>) against a suite of test cases and scores the results. Each case is a realistic prompt plus one or more graders. A grader is a pass/fail check on what Claude produced, such as a regex over the reply, whether a particular tool was called, or a rubric that a second model judges the reply against. You don’t have to write the suite manually. `claude plugin eval init` asks you about your plugin, proposes the cases and graders, tries them, and writes the files. You can also ask Claude to do the same from a session you already have open. Use evals to: + + * Measure how reliably your plugin leads Claude to produce the right outcome + * Catch regressions when you change the plugin or a new model is released + * See what the plugin contributes compared with no plugin + +This page is for plugin and skill authors who have a working plugin and want to test its behavior, and for teams that gate plugin changes in CI. Its case format is separate from the `evals/evals.json` file the [skill-creator plugin](</docs/en/skills#run-evals-with-skill-creator>) uses. To create a plugin, see [Create a plugin](</docs/en/plugins/create>); to check a plugin’s files for syntax and schema errors rather than its behavior, use [`claude plugin validate`](</docs/en/plugins/cli-reference#plugin-validate>). Every eval run and every judge grader is a real model call on your account, counted against your plan’s usage or your API bill, so check the requirements first. Then create your first eval suite, or go to Run evals in CI if you already have one. @@ -11,7 +17,7 @@ To run plugin evals you need: * Claude Code v2.1.269 or later. Run `claude --version` to check and `claude update` to upgrade. - * A plugin directory with a `plugin.json` or `.claude-plugin/plugin.json` manifest, or a [skills-directory plugin](</docs/en/plugins-reference#skills-directory-plugins>). + * A plugin directory with a `plugin.json` or `.claude-plugin/plugin.json` manifest, or a [skills-directory plugin](</docs/en/plugins/loading#plugins-shared-through-a-repository>). * The same authentication and model provider your normal Claude Code sessions use. Eval runs, judge-scored graders, and `claude plugin eval init` call the model with your credentials, so they count against your plan’s usage limits or your API bill. When the command reports a cost, the figure is a [list-price estimate](</docs/en/costs>) of those calls. ## @@ -36,7 +42,7 @@ How a case is scored -One run of a non-deterministic agent tells you little, so each case runs three times by default. A run’s score is the fraction of its graders that passed, weighted if you set weights, and the case’s score is the mean across its runs. A case passes when its score meets the `--threshold`, `1.0` by default. In model calls, a suite makes roughly cases × runs agent runs with the plugin and as many again for the no-plugin baseline, plus three short judge calls per `llm` or `baseline` grader per run. +One run of a non-deterministic agent tells you little, so each case runs three times by default. A run’s score is the fraction of its graders that passed, weighted if you set weights, and the case’s score is the mean across its runs. A case passes when its score meets the `--threshold`, `1.0` by default. In model calls, a suite makes roughly cases × runs agent runs with the plugin and the same number again for the no-plugin baseline, plus three short judge calls per `llm` or `baseline` grader per run. ### @@ -44,7 +50,7 @@ The no-plugin baseline -A high score on its own doesn’t tell you the plugin helped, because Claude might do as well without it. To separate the two, each case’s runs are repeated with no plugin loaded by default, and you get two scores, `WITH` and `W/OUT`. Their difference, `Δ`, is what the plugin contributed. If a case scores 1.0 both with and without the plugin, the plugin isn’t what made it pass. The two sets of runs are called the with-arm and the without-arm; Compare against a no-plugin baseline covers how graders are scored across them and how to turn the baseline off. +A high score on its own doesn’t tell you the plugin helped, because Claude might do as well without it. To separate the two, each case’s runs are repeated with no plugin loaded by default, and you get two scores, `WITH` and `W/OUT`. Their difference, `Δ`, is what the plugin contributed. If a case scores 1.0 both with and without the plugin, the plugin isn’t what made it pass. The two sets of runs are called the with-arm and the without-arm; Score against the no-plugin baseline covers how graders are scored across them and how to turn the baseline off. ## @@ -66,7 +72,7 @@ claude plugin eval init -If Claude Code doesn’t already trust this directory it first asks `Trust this plugin directory?`; answer `y`. An interactive Claude Code session then opens. Claude reads your plugin and asks you what a good result looks like, proposes prompts that should and shouldn’t trigger the plugin, designs graders for each, pilots them once to check they behave, and writes one case directory per prompt under `evals/`, each named after its prompt. When Claude tells you the suite is ready, exit that session with `/exit` or Ctrl+D to return to your shell.If you already have a Claude Code session open at the plugin root, you can instead ask Claude there to run `claude plugin eval init`. Claude runs the command and then asks you the same questions in that conversation.If you’d rather write a case yourself to see exactly what the files contain, follow Write a case manually and come back here to run it. +If Claude Code doesn’t already trust this directory it first asks `Trust this plugin directory?`; answer `y`.An interactive Claude Code session then opens. Claude reads your plugin and asks you what a good result looks like, proposes prompts that should and shouldn’t trigger the plugin, designs graders for each, runs them once as a trial to check they behave, and writes one case directory per prompt under `evals/`, each named after its prompt.When Claude tells you the suite is ready, exit that session with `/exit` or Ctrl+D to return to your shell.If you already have a Claude Code session open at the plugin root, you can instead ask Claude there to run `claude plugin eval init`. Claude runs the command and then asks you the same questions in that conversation.If you’d rather write a case yourself to see exactly what the files contain, follow Write a case manually and come back here to run it. 2 @@ -158,7 +164,7 @@ PASS if <what a correct response contains>. FAIL if <what a wrong or missing response looks like>. -Then add a second grader that checks whether your skill is what produced the answer. Create `evals/first-case/graders/skill-fired.md`, replacing `your-skill-name` with the `name` from your skill’s `SKILL.md`: +Then add a second grader that checks whether your skill is what produced the answer. Create `evals/first-case/graders/skill-fired.md`, replacing `your-skill-name` with the skill’s directory name under `skills/`, which is the name Claude invokes it by: --- type: tool_used @@ -193,7 +199,7 @@ An `llm` grader asks a model for a verdict, so its answer can differ between runs, and it differs more the longer the text it has to read. These habits keep a suite’s scores steady enough to trust: * For long output such as a generated file, grade it with a `regex` grader over the file’s contents, which checks the whole file the same way every time. Keep `llm` graders for short outputs, with rubrics written as concrete PASS and FAIL conditions. - * Give each case one grader on the result, such as the final message or a produced file, and one on how Claude got there, such as `tool_used` or `tool_order`. Together they tell you both whether the answer was right and whether your plugin produced it. + * Give each case one grader on the result, such as the final message or a produced file, and one on the steps Claude took to produce it, such as `tool_used` or `tool_order`. Together they tell you both whether the answer was right and whether your plugin produced it. * If a case’s `tool_used: Skill` grader passes but `Δ` is negative, suspect the judge before the plugin. A small judge model can mark a correct answer wrong because it’s formatted differently from what the rubric describes. Re-run with `--judge-model sonnet`, and tighten the rubric so formatting doesn’t decide the verdict. * To check that a build or test passed inside the run, have the prompt ask Claude to run it and write the outcome to a file, grade that file, and assert the command ran with a `tool_used` grader whose `input_match` names the command. @@ -206,9 +212,14 @@ When a plugin is under test, each case runs in two arms by default. The with-arm is its runs with the plugin loaded, and the without-arm is the same number of runs with no plugin at all. The summary and report show both scores and `Δ`, the with-arm score minus the without-arm score. Pass `--ablation none` to run only the with-arm, which halves the cost when you don’t need the comparison, such as while iterating on graders. In a two-arm run, some graders are reported with `scored: false`. A check like “the skill was invoked” can never pass without the plugin, so counting it would push the without-arm toward zero and inflate `Δ`. To keep the two arms comparable, Claude Code excludes such graders from the score in both arms and reports them in the with-arm as pass/fail indicators only. That includes: * Every `tool_used` grader whose `tool` is `Skill` + * Every `regex` grader with `target: mock_calls` and every `llm` grader with `focus: mock_calls`, when each mocked server in the case is one your plugin declares * Any grader you mark `arm: with-only` -If every grader in a case is one of these, they’re scored normally instead, since there would be nothing left to score. Set `arm: both` on a grader to score it in both arms regardless, which is what you want for a “must not invoke the skill” check with `min: 0` and `max: 0`. Under `--ablation none` nothing is excluded, so the same suite can produce a different absolute score in the two modes. +Three settings change that exclusion: + + * **Every grader excluded** : if every grader in a case is in the excluded set, they’re scored normally instead, since there would be nothing left to score. + * **`arm: both`** : set `arm: both` on a grader to score it in both arms regardless, which is what you want for a “must not invoke the skill” check with `min: 0` and `max: 0`. + * **`--ablation none`** : under `--ablation none` nothing is excluded, so the same suite can produce a different absolute score in the two modes. ### @@ -229,7 +240,7 @@ Set up fixtures and mocks -A case can need more than a prompt: files or a git repository in the workspace, an earlier conversation to continue, or answers from the MCP servers your plugin talks to. Each of those is set up beside the case so runs stay repeatable. +A case can need more than a prompt: files or a git repository in the workspace, an earlier conversation to continue, or answers from the MCP servers your plugin connects to. Each of those is set up beside the case so runs stay repeatable. ### @@ -237,7 +248,13 @@ Seed the workspace or conversation -Each run starts in an empty workspace. When a case needs more than the prompt, add a `case.yaml` beside `prompt.md` with a `context` block. To create fixture files or a git repository first, write a Bash script in the case directory and name it in `context.scaffold_script`. The script runs as you, outside the agent’s sandbox, and only when you pass `--scaffold`, so pass that flag only for suites you or your organization wrote. To continue an earlier conversation, save the transcript as a `.jsonl` file and name it in `context.history_file`, and the case’s prompt becomes the next user turn. To let Claude read fixture directories in the case during the run, list them in `context.add_dirs`. A `case.yaml` also needs `schema_version: "1.1"` and `name`; the case.yaml fields reference has the full list. This `case.yaml` seeds a workspace from a script and lets Claude read fixtures from a `resources/` directory: +Each run starts in an empty workspace. When a case needs more than the prompt, add a `case.yaml` beside `prompt.md` with a `context` block: + + * **Fixture files or a git repository** : write a Bash script in the case directory and name it in `context.scaffold_script`. The script runs as you, outside the agent’s sandbox, and only when you pass `--scaffold`, so pass that flag only for suites you or your organization wrote. + * **An earlier conversation to continue** : save the transcript as a `.jsonl` file and name it in `context.history_file`, and the case’s prompt becomes the next user turn. + * **Fixture directories Claude can read during the run** : list them in `context.add_dirs`. + +A `case.yaml` also needs `schema_version: "1.1"` and `name`; the case.yaml fields reference has the full list. This `case.yaml` seeds a workspace from a script and lets Claude read fixtures from a `resources/` directory: schema_version: "1.1" name: changelog-from-diff @@ -252,7 +269,7 @@ Mock MCP servers -You can evaluate a plugin whose skills call MCP tools without the real service behind them. Put one Markdown file per tool under `evals/mocks/<server>/<tool>.md` for the whole suite, or under a case’s own `mocks/` directory for one case, where `<server>` is the server’s name in your plugin’s [MCP configuration](</docs/en/plugins-reference#mcp-servers>). A run never starts your plugin’s real MCP servers unless you ask. Claude Code registers a stand-in under each server’s own name. Tools with a mock file answer from it and are allowed without an `--allow-tools` grant, and a tool with no mock file isn’t available to Claude. A server with no mocks at all appears in the case’s `mocked:` progress line as `plugin_<plugin>_<server>[not started: no mock]`. The file’s body is what the tool returns to Claude. This mock stands in for a `create_issue` tool on a server named `tracker`, checks the input Claude sends, and echoes the title back. Save it as `evals/mocks/tracker/create_issue.md`: +You can evaluate a plugin whose skills call MCP tools without the real service behind them. Put one Markdown file per tool under `evals/mocks/<server>/<tool>.md` for the whole suite, or under a case’s own `mocks/` directory for one case, where `<server>` is the server’s name in your plugin’s [MCP configuration](</docs/en/plugins/components#mcp-servers>). A run never starts your plugin’s real MCP servers unless you ask. Claude Code registers a substitute server under each server’s own name. Tools with a mock file answer from it and are allowed without an `--allow-tools` grant, and a tool with no mock file isn’t available to Claude. A server with no mocks at all appears in the case’s `mocked:` progress line as `plugin_<plugin>_<server>[not started: no mock]`. The file’s body is what the tool returns to Claude. This mock substitutes for a `create_issue` tool on a server named `tracker`, checks the input Claude sends, and echoes the title back. Save it as `evals/mocks/tracker/create_issue.md`: --- expect: @@ -262,7 +279,14 @@ Created issue #4821: {{input.title}} -Insert fields from the call’s input with `{{input.<field>}}`, and the contents of a fixture file beside the mock with `{{file:fixtures/{input.<field>}.json}}`. The `expect:` block guards the input. If a call violates it, the run aborts with score 0 and records why, so a case can assert what your plugin asked the server to do. Set `error: true` to return the body as a tool error instead, or `type: agent` to have a small model answer as the server from instructions in the body. The mock file reference lists every key and the `_server.md` and `_tools.json` files. To grade the calls themselves, point a grader at `target: mock_calls`. To run against the plugin’s real MCP servers instead, pass one of these flags. Either way those processes run as you, outside the run’s sandbox, and their tools need an `--allow-tools` grant: +A mock file’s body and frontmatter accept these options: + + * **Substitutions** : insert fields from the call’s input with `{{input.<field>}}`, and the contents of a fixture file beside the mock with `{{file:fixtures/{input.<field>}.json}}`. + * **`expect:`** : the `expect:` block guards the input. If a call violates it, the run aborts with score 0 and records why, so a case can assert what your plugin asked the server to do. + * **`error: true`** : set `error: true` to return the body as a tool error instead. + * **`type: agent`** : set `type: agent` to have a small model answer as the server from instructions in the body. + +The mock file reference lists every key and the `_server.md` and `_tools.json` files. To grade the calls themselves, point a grader at `target: mock_calls`. To run against the plugin’s real MCP servers instead, pass one of these flags. Either way those processes run as you, outside the run’s sandbox, and their tools need an `--allow-tools` grant: * **`--allow-real-servers`** : start the real process for each server you haven’t mocked, and keep answering mocked tools from their files * **`--mocks off`** : ignore `mocks/` entirely and start every server the plugin declares @@ -296,7 +320,7 @@ A plugin’s root directory, such as `.`| Every case under its eval directory, with that plugin loaded A single `prompt.md` or `case.yaml` file| That case, with its enclosing plugin loaded An installed plugin by name, `name` or `name@marketplace`| The cases in the installed copy’s eval directory, with the installed copy loaded. Results are written under `./evals/results/` in your current directory, or `./<dir>/results/` with `--eval-dir` -`name@skills-dir`| The same, for a [skills-directory plugin](</docs/en/plugins-reference#skills-directory-plugins>) +`name@skills-dir`| The same, for a [skills-directory plugin](</docs/en/plugins/loading#plugins-shared-through-a-repository>) Omitted| The current directory as a path Add `--case <glob>` to filter by case name and `--tag <tag>` to keep cases with any of the given tags. Put the target before `--tag`, `--allow-tools`, and `--json`. The first two take a list and `--json` takes an optional path, so each of them reads a target that follows as its own value. @@ -307,11 +331,11 @@ Grant tools -Runs never stop to ask for permission. Built-in tools that need a grant you didn’t give, such as `Bash`, `Write`, `Edit`, `WebFetch`, and `WebSearch`, are removed from the session, so Claude can’t call them at all. The allowlist is the read-only tools the case lists in `allowed_tools`, from `Read`, `Glob`, `Grep`, `NotebookRead`, `Skill`, `Agent`, `TodoWrite`, and the task tools `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, and `TaskStop`, plus whatever you grant with `--allow-tools`. That grant applies to every case in the run. To let cases use `Bash`, `Write`, `Edit`, `WebFetch`, or `WebSearch`, grant them yourself: +Runs never stop to ask for permission. Built-in tools that need a grant you didn’t give, such as `Bash`, `Write`, `Edit`, `WebFetch`, and `WebSearch`, are removed from the session, so Claude can’t call them at all. A run allows only the read-only tools the case lists in `allowed_tools`, from `Read`, `Glob`, `Grep`, `NotebookRead`, `Skill`, `AskUserQuestion`, `Agent`, `TodoWrite`, and the task tools `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, and `TaskStop`, plus whatever you grant with `--allow-tools`. That grant applies to every case in the run. To let cases use `Bash`, `Write`, `Edit`, `WebFetch`, or `WebSearch`, grant them yourself: claude plugin eval . --allow-tools Write Edit "Bash(npm test *)" -When a case asked for a tool you didn’t grant, the run lists it on stderr as `not granted`. Tools on a mocked MCP server need no grant. Tools on a real plugin MCP server need both the server started, with `--allow-real-servers` or `--mocks off`, and a grant by name, such as `--allow-tools "mcp__plugin_my-plugin_github__*"`; a plugin’s MCP tools are named `mcp__plugin_<plugin>_<server>__<tool>`. When you grant `Bash` in any form, every command runs under Claude Code’s [OS-level sandbox](</docs/en/sandboxing>). Writes are confined to the run’s workspace, your home directory and Claude Code configuration are unreadable, and network access is limited to domains you grant with `--allow-tools "WebFetch(domain:example.com)"`. If you grant Bash or PowerShell on a machine with no sandbox backend, Claude Code refuses each run rather than running it unconfined, and the case shows a run error and usually scores 0. Native Windows has no backend, so run shell-granting suites under WSL2; on Linux, install `bubblewrap` and `socat` first. See the [sandboxing prerequisites](</docs/en/sandboxing>). +When a case asked for a tool you didn’t grant, the progress output lists it as `not granted`. Tools on a mocked MCP server need no grant. Tools on a real plugin MCP server need both the server started, with `--allow-real-servers` or `--mocks off`, and a grant by name, such as `--allow-tools "mcp__plugin_my-plugin_github__*"`; a plugin’s MCP tools are named `mcp__plugin_<plugin>_<server>__<tool>`. When you grant `Bash` in any form, every command runs under Claude Code’s [OS-level sandbox](</docs/en/sandboxing>). Writes are confined to the run’s workspace, your home directory and Claude Code configuration are unreadable, and network access is limited to domains you grant with `--allow-tools "WebFetch(domain:example.com)"`. If you grant Bash or PowerShell on a machine with no sandbox backend, Claude Code refuses each run rather than running it unconfined, and the case shows a run error and usually scores 0. Native Windows has no backend, so run shell-granting suites under WSL2; on Linux, install `bubblewrap` and `socat` first. See the [sandboxing prerequisites](</docs/en/sandboxing>). ### @@ -329,7 +353,7 @@ `--judge-model <model>`| A small fast model| Model for `llm` and `baseline` graders `--ablation <mode>`| `with-without` when a plugin resolves, else `none`| Whether to also run each case without the plugin to measure what it adds. `none` runs one arm; `with-without` adds the no-plugin baseline `--threshold <0..1>`| `1.0`| A case passes when its with-arm score is at least this. Any case below it makes the command exit 1 -`--max-cost-usd <usd>`| No ceiling| A ceiling on the run’s list-price cost estimate, not on plan usage. Checked before each run starts. Once spent, nothing further starts; runs already in flight finish, so spend can pass the ceiling by those runs. If any run is left unstarted, the command exits 2 with partial results +`--max-cost-usd <usd>`| No ceiling| A ceiling on the run’s list-price cost estimate, not on plan usage. Checked before each run starts. Once spent, nothing further starts; runs that already started finish, so spend can pass the ceiling by those runs. If any run is left unstarted, the command exits 2 with partial results `--allow-tools <tools...>`| None| Grant tools beyond the read-only set. See Grant tools `--scaffold`| Off| Run each case’s `scaffold_script` `--trust-plugin`| Off| Skip the first-run trust prompt for a plugin whose code and suite you’d run yourself. Pass it in CI so the job is never refused by or left waiting at the prompt. See What a run can access @@ -368,7 +392,13 @@ 130| Interrupted. Partial results are written 143| Terminated, such as by a CI timeout -Problems writing or publishing the HTML report never change the exit code. To see why a case scored low, run it locally without `--json` so the per-run progress and grader lines print. A CI runner needs a Claude Code install and [credentials in the environment](</docs/en/authentication>) such as `ANTHROPIC_API_KEY`. Without `--trust-plugin`, a job whose checkout directory Claude Code doesn’t already trust is refused with exit 1 when it has no terminal, or waits at the prompt when the runner allocates one. `claude plugin eval init` needs a terminal to ask you its questions; in CI, run `claude plugin eval init --bare <name>` to get the blank template. To keep costs predictable, give quick every-change suites only graders that don’t call a judge, use `--ablation none` where you don’t need `Δ`, and leave `partial: true` documents and runs with `skippedPaidGraders` out of any trend you chart. +Problems writing or publishing the HTML report never change the exit code. To see why a case scored low, run it locally without `--json` so the per-run progress and grader lines print. A CI runner also needs these in place: + + * **Install and credentials** : a CI runner needs a Claude Code install and [credentials in the environment](</docs/en/authentication>) such as `ANTHROPIC_API_KEY`. + * **Trust** : without `--trust-plugin`, a job whose checkout directory Claude Code doesn’t already trust needs the first-run trust prompt, and a run that can’t ask is refused with exit 1. + * **`init` in CI**: `claude plugin eval init` needs a terminal to ask you its questions; in CI, run `claude plugin eval init --bare <name>` to get the blank template. + +To keep costs predictable, give quick every-change suites only graders that don’t call a judge, use `--ablation none` where you don’t need `Δ`, and leave `partial: true` documents and runs with `skippedPaidGraders` out of any trend you chart. ## @@ -386,7 +416,7 @@ `report.html` is a single self-contained file that makes no external requests, so you can attach it to a CI job or open it from disk. This example is the top of a report for a three-case suite run with `--threshold 0.8`; the cost shown is a list-price estimate and varies with the model and the number of cases: Read it from the top down: - * **The verdict line and tiles** answer whether the plugin helped across the whole suite. Suite score is the mean of the per-case with-plugin scores, Ablation Δ is how far that sits above or below the baseline score, and Cases counts how many met the threshold. Perfect runs is the share of with-plugin runs where every grader passed. + * **The verdict line and tiles** answer whether the plugin helped across the whole suite. Suite score is the mean of the per-case with-plugin scores, Ablation Δ is how far that is above or below the baseline score, and Cases counts how many met the threshold. Perfect runs is the share of with-plugin runs where every grader passed. * **Each case card** shows the case’s own `Δ` and with-plugin score, with a tick on the bar at the threshold. A case whose `Δ` is negative gets a red left edge, so regressions stand out when you scroll. * **Inside a case** , the with-plugin runs come first and the baseline runs after. Each run lists its graders with a pass or fail chip. A failed grader is already expanded with its explanation, and an `llm` grader also shows the judge’s votes and the evidence it was shown, which is where you find out why a run scored low. Graders that don’t count toward the score, such as `tool_used: Skill`, carry a `plugin-fired indicator` badge. * **Prompt and Graders** , below the runs, show the case’s prompt and each grader’s rubric or pattern, so someone reading the report without the suite can see what was asked and what counted as good. @@ -421,7 +451,7 @@ What a run can access -`claude plugin eval` loads the target plugin’s skills and hooks and runs its eval suite on your machine, as you. Pointing it at a plugin is the same trust decision as `claude --plugin-dir`, so only evaluate plugins you trust. The isolation described in this section limits what the agent under test can reach; it isn’t a boundary against the plugin’s own code, and a suite that passes says nothing about whether the plugin is safe. +`claude plugin eval` loads the target plugin’s skills, hooks, and agents and runs its eval suite on your machine, as you. Pointing it at a plugin is the same trust decision as `claude --plugin-dir`, so only evaluate plugins you trust. The isolation described in this section limits what the agent under test can reach; it isn’t a boundary against the plugin’s own code, and a suite that passes says nothing about whether the plugin is safe. ### @@ -429,7 +459,13 @@ Trust the plugin directory -The first time you run `claude plugin eval` against a directory, Claude Code asks `Trust this plugin directory?` before it loads anything from it, unless you already accepted the trust prompt there in an interactive `claude` session. Inside a git repository, answering yes trusts the whole repository, for interactive sessions too. When stdin or stdout isn’t a terminal, or under `--json`, the run can’t ask and is refused with exit 1; pass `--trust-plugin` to assert the trust yourself, only for a plugin you’d run on your own machine. A target you name rather than give as a path, meaning an installed plugin or a skills-directory plugin, skips the prompt. Some parts of the plugin and suite run only when you pass their flag for that run: a case’s `scaffold_script` with `--scaffold`, tools beyond the read-only set with `--allow-tools`, and the plugin’s real MCP servers with `--allow-real-servers` or `--mocks off`. A case’s `allowed_tools` and a skill’s own `allowed-tools` frontmatter can’t widen any of them. When the plugin ships hooks you didn’t write, or you start its real MCP servers, treat its scores as advisory unless you ran it in an isolated environment such as a container or CI runner, since hooks and servers run outside the agent’s sandbox and could touch the files the graders read. +The first time you run `claude plugin eval` against a directory, Claude Code asks `Trust this plugin directory?` before it loads anything from it, unless you already accepted the trust prompt there in an interactive `claude` session. Inside a git repository, answering yes trusts the whole repository, for interactive sessions too. When stdin or stdout isn’t a terminal, under `--json`, or when the `CI` environment variable is set to a true value such as `true`, the run can’t ask and is refused with exit 1; pass `--trust-plugin` to assert the trust yourself, only for a plugin you’d run on your own machine. A target you name rather than give as a path, meaning an installed plugin or a skills-directory plugin, skips the prompt. Some parts of the plugin and suite run only when you pass their flag for that run: + + * A case’s `scaffold_script` with `--scaffold` + * Tools beyond the read-only set with `--allow-tools` + * The plugin’s real MCP servers with `--allow-real-servers` or `--mocks off` + +A case’s `allowed_tools` and a skill’s own `allowed-tools` frontmatter can’t widen any of them. When the plugin includes hooks you didn’t write, or you start its real MCP servers, treat its scores as advisory unless you ran it in an isolated environment such as a container or CI runner, since hooks and servers run outside the agent’s sandbox and could modify the files the graders read. ### @@ -437,7 +473,7 @@ How runs are isolated -Each run gets a throwaway home directory, working directory, and Claude Code configuration, and the agent under test runs there as a `claude -p` child process with only your plugin loaded. Keep these consequences in mind when you write cases: +Each run gets a temporary home directory, working directory, and Claude Code configuration, and the agent under test runs there as a `claude -p` child process with only your plugin loaded. Keep these consequences in mind when you write cases: * **Nothing personal or project-level loads.** Your user settings, hooks, `CLAUDE.md` files, MCP servers, other installed plugins, memory, and skills are absent, and no project-scoped `.claude/` or `.mcp.json` above the sandbox is read. Most of your shell environment is withheld too; only an allowlist and `EVAL_*` variables reach the run. If the plugin needs setup, ship it in the plugin, create it in a `scaffold_script`, or pass `EVAL_*` variables. * **Managed policy can still restrict a run.** Restrictions in [managed settings](</docs/en/managed-settings>) an administrator deployed to the machine apply inside a run, so results on a managed machine can differ from an unmanaged one by that policy. @@ -495,7 +531,7 @@ `timeout_seconds`| `300`| Wall-clock cap per run, up to 3600 `allowed_tools`| `[]`| Tools the case wants, such as `[Read, Glob, Grep, Skill]`. Read-only tools are granted when listed here; for anything else, see Grant tools `append_system_prompt`| | Text appended to the child session’s system prompt -`env`| `{}`| Extra environment variables for the child session. Keys must match `EVAL_[A-Z0-9_]*`; any other key fails the run. The run inherits only an allowlist from your shell: basics such as `PATH` and locale, proxy and certificate settings, the variables that select and authenticate your model provider, most `ANTHROPIC_*` and `CLAUDE_CODE_*` configuration, and `EVAL_*`. To hand the plugin anything else, such as a toolchain setting, export it as an `EVAL_*` variable +`env`| `{}`| Extra environment variables for the child session. Keys must match `EVAL_[A-Z0-9_]*`; any other key fails the run. The run inherits only an allowlist from your shell: basics such as `PATH` and locale, proxy and certificate settings, the variables that select and authenticate your model provider, most `ANTHROPIC_*` and `CLAUDE_CODE_*` configuration, and `EVAL_*`. To pass the plugin anything else, such as a toolchain setting, export it as an `EVAL_*` variable ### @@ -503,7 +539,7 @@ case.yaml fields -`case.yaml` describes the same case in YAML and adds the fields that point at other files. It requires `schema_version: "1.1"` and `name`. The `prompt.md` fields `description`, `tags`, `plugins`, `runs`, and `expected_outcome` go at the top level; `model`, `max_turns`, `timeout_seconds`, `allowed_tools`, `append_system_prompt`, and `env` go under `execution:`. When both files exist, `prompt.md` frontmatter overrides the matching `case.yaml` fields, the `prompt.md` body is the prompt, and `graders/*.md` are added after any graders listed in `case.yaml`. These fields exist only in `case.yaml`: +`case.yaml` is an alternative or companion to `prompt.md`: it describes a case in YAML and adds the fields that point at other files. It requires `schema_version: "1.1"` and `name`. The `prompt.md` fields `description`, `tags`, `plugins`, `runs`, and `expected_outcome` go at the top level; `model`, `max_turns`, `timeout_seconds`, `allowed_tools`, `append_system_prompt`, and `env` go under `execution:`. When both files exist, `prompt.md` frontmatter overrides the matching `case.yaml` fields, the `prompt.md` body is the prompt, and `graders/*.md` are added after any graders listed in `case.yaml`. These fields exist only in `case.yaml`: Field| Purpose ---|--- @@ -525,7 +561,7 @@ ---|---|--- `type`| required| One of the grader types `weight`| `1`| Relative weight in the run’s score. Any positive number -`arm`| unset| `with-only` excludes the grader from scoring in a two-arm run; `both` forces a `tool_used: Skill` grader to be scored in both arms +`arm`| unset| `with-only` excludes the grader from scoring in a two-arm run; `both` forces a grader Claude Code would otherwise exclude to be scored in both arms #### @@ -570,7 +606,7 @@ Key| Default| Purpose ---|---|--- -`type`| `fixed`| `fixed` returns the body as written. `agent` treats the body as instructions for a small model that plays the server for the run and sees earlier calls as history +`type`| `fixed`| `fixed` returns the body as written. `agent` treats the body as instructions for a small model that acts as the server for the run and sees earlier calls as history `expect`| unset| A map from dotted input paths to a type name such as `string`, `number`, `boolean`, `array`, or `object`, a `/regex/`, a literal, or a list of allowed literals. A call that violates it aborts the run with score 0 and is reported as `aborted` with the server, tool, and reason `error`| `false`| `fixed` only. Return the body as a tool error `abort_when`| unset| `agent` only. Prose listing the only conditions under which the agent may abort the run @@ -588,7 +624,7 @@ Troubleshooting -These are the problems authors hit most often, keyed on what you see. +These are the problems authors encounter most often, keyed on what you see. ### @@ -612,7 +648,7 @@ ”is not a trusted plugin directory, and this run cannot stop to ask you about it” -This is the first run against a directory Claude Code doesn’t trust yet, and it can’t ask you because stdin or stdout isn’t a terminal or you passed `--json`. Run `claude plugin eval <dir>` once in a terminal and answer the prompt, or pass `--trust-plugin` if you trust the plugin’s code and suite. See What a run can access. +This is the first run against a directory Claude Code doesn’t trust yet, and it can’t ask you because stdin or stdout isn’t a terminal, you passed `--json`, or the `CI` environment variable is set to a true value such as `true`. Run `claude plugin eval <dir>` once in a terminal and answer the prompt, or pass `--trust-plugin` if you trust the plugin’s code and suite. See What a run can access. ### @@ -634,6 +670,14 @@ ​ +”Agent type ’…’ not found” for one of your plugin’s agents + +By default each case runs both with your plugin and without it, and the runs without it are the no-plugin baseline. When Claude dispatches one of your plugin’s agents in a baseline run, the Agent tool call fails with `Agent type '<plugin>:<agent-name>' not found. Available agents: ...`. The list names only agents that exist without the plugin, such as the [built-in subagents](</docs/en/sub-agents#built-in-subagents>). The error is expected, since `Δ` compares your plugin’s runs against the baseline. In the JSON result, the baseline runs are under `cases[].arms.without`. In runs with your plugin loaded, a case that lists `Agent` in `allowed_tools` can dispatch one of your plugin’s agents by its namespaced name, such as `my-plugin:code-reviewer` for the `code-reviewer` agent in a plugin named `my-plugin`. To skip the baseline runs, pass `--ablation none`. + +### + +​ + Everything scores zero although the right files were produced Your graders target `files`, the list of created paths, when you meant the file’s contents. Use `{ source: file, path: <path> }` as the `target` or `focus`. Separately, `file_exists` counts only files created during the run, so a file the scaffold created or that Claude only edited is invisible to it; grade its contents, or use `tool_used` on `Edit`. @@ -644,7 +688,9 @@ A regex over the trace doesn’t match text I can see -The default `target` is `last_message`, not the trace. When you do target `trace`, it’s JSON per line, so quotes appear as `\"`. Regexes use JavaScript syntax, so put `i` in `flags` rather than writing `(?i)`. + * **Wrong target** : the default `target` is `last_message`, not the trace. + * **JSON escaping** : when you do target `trace`, it’s JSON per line, so quotes appear as `\"`. + * **Regex syntax** : regexes use JavaScript syntax, so put `i` in `flags` rather than writing `(?i)`. ### @@ -660,7 +706,7 @@ The run exits 1 but the results look fine -The default `--threshold` is 1.0, so the command exits 1 when any case scores below perfect. Set a threshold that matches your bar. Exit 1 also covers a case file that failed to load, which is reported on stderr above the table. +The default `--threshold` is 1.0, so the command exits 1 when any case scores below perfect. Set a threshold that matches the score you require. Exit 1 also covers a case file that failed to load, which is reported on stderr above the table. ### @@ -676,7 +722,7 @@ A grader shows passed: false under a run that scored 1.0 -That grader is excluded from the score by design in a two-arm run, and its `scored` field is `false`. See Compare against a no-plugin baseline. +That grader is excluded from the score by design in a two-arm run, and its `scored` field is `false`. See Score against the no-plugin baseline. ### @@ -700,8 +746,9 @@ See also - * [Create plugins](</docs/en/plugins>): build the plugin you’re testing, and load it with `--plugin-dir` during development - * [Plugins reference](</docs/en/plugins-reference#plugin-eval>): the `plugin eval` and `plugin eval init` command entries and the manifest’s `experimental.evals` key + * [Create a plugin](</docs/en/plugins/create>): build the plugin you’re testing, and load it with `--plugin-dir` during development + * [Plugin commands reference](</docs/en/plugins/cli-reference#plugin-eval>): the `plugin eval` and `plugin eval init` command entries. The manifest’s [`experimental.evals`](</docs/en/plugins/manifest-reference#fields>) key is on the manifest reference * [Skills](</docs/en/skills>): how a skill’s description decides when Claude invokes it, which is what a case that checks whether the skill triggers is measuring * [Sandboxing](</docs/en/sandboxing>): the OS-level sandbox that applies when you grant Bash to a run - * [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>): publish the plugin once its suite passes + * [Publish a plugin](</docs/en/plugins/publish>): publish the plugin once its suite passes + * [Measure plugin cost and usage](</docs/en/plugins/measure>): what the plugin adds to each session’s context and whether people still use it
modified Plugins in the SDK View current →
--- a/plugins.md +++ b/plugins.md @@ -5,7 +5,7 @@ * **Hooks** : event handlers that respond to tool use and other events * **MCP servers** : external tool integrations via Model Context Protocol -For complete information on plugin structure and how to create plugins, see [Plugins](</docs/en/plugins>). +For complete information on plugin structure and how to create plugins, see [Plugins](</docs/en/plugins/overview>). ## @@ -13,7 +13,7 @@ Loading plugins -Load plugins by providing their local file system paths in your options configuration. The `type` field must be `"local"`, the only value the SDK accepts. The SDK supports loading multiple plugins from different locations. To use a plugin distributed through a [marketplace](</docs/en/plugin-marketplaces>) or remote repository, download it first and provide the local directory path. For the directory layout a plugin needs, see the Plugin structure reference below. +Load plugins by providing their local file system paths in your options configuration. The `type` field must be `"local"`, the only value the SDK accepts. The SDK supports loading multiple plugins from different locations. To use a plugin distributed through a [marketplace](</docs/en/plugins/overview>) or remote repository, download it first and provide the local directory path. For the directory layout a plugin needs, see the Plugin structure reference below. TypeScript @@ -128,7 +128,7 @@ ​ -Using plugin skills +Use plugin skills Skills from plugins are automatically namespaced with the plugin name to avoid conflicts. To invoke one directly, send `/plugin-name:skill-name` as the prompt. @@ -336,8 +336,8 @@ See also - * [Plugins](</docs/en/plugins>) \- Complete plugin development guide - * [Plugins reference](</docs/en/plugins-reference>) \- Technical specifications + * [Plugins](</docs/en/plugins/overview>) \- Complete plugin development guide + * [Plugins reference](</docs/en/plugins/manifest-reference>) \- Technical specifications * [Commands](</docs/en/agent-sdk/skills#dispatch-commands-by-name>) \- Dispatching commands in the SDK * [Subagents](</docs/en/agent-sdk/subagents>) \- Working with specialized agents * [Skills](</docs/en/agent-sdk/skills>) \- Using Agent Skills
modified How Claude Code uses prompt caching View current →
--- a/prompt-caching.md +++ b/prompt-caching.md @@ -103,7 +103,7 @@ Enabling or disabling a plugin -When you enable or disable a [plugin](</docs/en/plugins>), what the change costs depends on which component types the plugin provides. The cases below cover each component type, when Claude Code applies the change, and what happens when you disable a plugin again in the same session. +When you enable or disable a [plugin](</docs/en/plugins/overview>), what the change costs depends on which component types the plugin provides. The cases below cover each component type, when Claude Code applies the change, and what happens when you disable a plugin again in the same session. #### @@ -119,7 +119,7 @@ Plugins that provide MCP servers -When you enable or disable a plugin that provides [MCP servers](</docs/en/plugins-reference#mcp-servers>), Claude Code follows the same rules as when you connect or disconnect an MCP server: +When you enable or disable a plugin that provides [MCP servers](</docs/en/plugins/components#mcp-servers>), Claude Code follows the same rules as when you connect or disconnect an MCP server: * If Claude Code defers the server’s tools, it keeps the cache. * If Claude Code loads them into the prefix, the next request re-reads the entire conversation. @@ -130,7 +130,7 @@ Code intelligence plugins -When you enable a [code intelligence plugin](</docs/en/discover-plugins#code-intelligence>), Claude gets the [LSP tool](</docs/en/tools-reference#lsp-tool-behavior>). +When you enable a [code intelligence plugin](</docs/en/plugins/code-intelligence>), Claude gets the [LSP tool](</docs/en/tools-reference#lsp-tool-behavior>). #### @@ -138,14 +138,14 @@ When plugin changes apply -A change you make in the `/plugin` menu goes through [`/reload-plugins`](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>), which Claude Code runs for you when you close the menu. You pay the cost, whether appended announcements or a full re-read, on the first turn after the change applies. Claude Code can also apply a change on its own: - - * For a plugin with a `command` source, Claude Code [can reload the plugin itself](</docs/en/plugin-marketplaces#when-claude-code-re-runs-the-command>). - * When you [install a plugin from the `/plugin` interface](</docs/en/discover-plugins#install-plugins>), Claude Code can activate it during the install. The install summary tells you whether it did. +A change you make in the `/plugin` menu goes through [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>), which Claude Code runs for you when you close the menu. You pay the cost, whether appended announcements or a full re-read, on the first turn after the change applies. Claude Code can also apply a change on its own: + + * For a plugin with a `command` source, Claude Code [can reload the plugin itself](</docs/en/plugins/loading#when-a-command-source-re-runs>). + * When you [install a plugin from the `/plugin` interface](</docs/en/plugins/install#install-a-plugin>), Claude Code can activate it during the install. The install summary tells you whether it did. * When you [move the session with `/cd`](</docs/en/permissions#move-the-session-to-another-directory>) on v2.1.246 or later, Claude Code applies the plugins the new directory’s settings enable as part of the move, without the full re-read warning that holds a `/reload-plugins`. - * In interactive sessions, when you add or remove a plugin in a [folder of plugins](</docs/en/plugins#test-your-plugins-locally>) you passed with `--plugin-dir`, the change applies right away. If applying it would trigger a full re-read, Claude Code holds the change instead and shows a notice to run `/reload-plugins`. Requires Claude Code v2.1.265 or later. - -When `/reload-plugins` runs and the reload would trigger a full re-read, Claude Code shows a warning and doesn’t apply the reload. Run `/reload-plugins --force` to apply it anyway. `/reload-plugins` also runs in sessions without an interactive terminal, such as the desktop app, the Agent SDK, and [non-interactive mode](</docs/en/headless>) with `-p`, when you type it into the session directly. Requires Claude Code v2.1.260 or later. In those sessions the reload applies everything except plugin MCP server changes, which [take effect in your next session](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) and so never cost a full re-read mid-session. + * In interactive sessions, when you add or remove a plugin in a [folder of plugins](</docs/en/plugins/create#load-a-directory-or-archive-for-one-session>) you passed with `--plugin-dir`, the change applies right away. If applying it would trigger a full re-read, Claude Code holds the change instead and shows a notice to run `/reload-plugins`. Requires Claude Code v2.1.265 or later. + +When `/reload-plugins` runs and the reload would trigger a full re-read, Claude Code shows a warning and doesn’t apply the reload. Run `/reload-plugins --force` to apply it anyway. `/reload-plugins` also runs in sessions without an interactive terminal, such as the desktop app, the Agent SDK, and [non-interactive mode](</docs/en/headless>) with `-p`, when you type it into the session directly. Requires Claude Code v2.1.260 or later. In those sessions the reload applies everything except plugin MCP server changes, which [take effect in your next session](</docs/en/plugins/cli-reference#reload-plugins>) and so never cost a full re-read mid-session. ####
added Publish and distribute a plugin View current →
Show diff (221 lines)
--- a/publish.md +++ b/publish.md @@ -0,0 +1,218 @@ +Publishing a Claude Code plugin means listing it in a marketplace, a JSON catalog that lists plugins and where to fetch each one, so that other people can install it by name and receive your updates. You can run your own marketplace or submit your plugin to Anthropic’s community marketplace. To share a plugin without publishing it, send people the plugin’s directory or a `.zip` of it to load themselves. This page is for the author of a working plugin who is ready to share it. + +These cases are covered on other pages: + + * **Your plugin isn’t finished yet** : start with [Create a plugin](</docs/en/plugins/create>) + * **You maintain a CLI or SDK with a plugin in an official marketplace** : see [Recommend your plugin from your CLI](</docs/en/plugins/cli-hints>) + +Start with Choose how to distribute to compare the distribution options. If you already know your route, go to Prepare your plugin for release, then follow your route’s section for what to tell your users and how they receive your updates. + +## + +​ + +Choose how to distribute + +Choose a distribution option based on who needs to install the plugin: + +Route| Who can install| What you need| Do users get your updates automatically? +---|---|---|--- +No marketplace| The people you send the plugin folder or a `.zip` of it| The plugin’s folder| None. They load the copy you sent +Your own marketplace| Anyone who can reach the repository, which can be a private one your team can clone| A git repository or other host with a `.claude-plugin/marketplace.json` that lists your plugin| Off +Anthropic’s community marketplace| Anyone who adds `anthropics/claude-plugins-community`| A submission through the plugin directory submission form| Off + +Auto-update is a per-marketplace setting on the user’s side that fetches new versions in the background. + +## + +​ + +Prepare your plugin for release + +The name, the version, validation, and an install from a marketplace decide whether a release works for the people who install it. Check them before the first release and again before each later one. + +1 + +Choose a permanent name + +Users install, enable, and configure your plugin by `name@marketplace`, so a renamed plugin is a different plugin to every existing install. Choose a kebab-case name such as `deploy-helper`, because `claude plugin validate` warns on other forms, and treat it as permanent. Set `displayName` in `plugin.json` for the label users see. + +2 + +Decide how you'll version + +If you set `version` in `plugin.json` and later push commits without changing it, `claude plugin update` prints `<name> is already at the latest version (1.0.0).` and users keep the old copy. Either increment `version` on every release, or omit it in a git-hosted marketplace so Claude Code uses the commit SHA instead. See [Versions and updates](</docs/en/plugins/loading#versions-and-updates>). + +3 + +Validate + +In your shell, run `claude plugin validate --strict ./your-plugin`. A clean run prints `✔ Validation passed`. + + * **In CI** : keep `--strict`, which also fails the run with exit code 1 on warnings such as an unknown manifest field or a missing `version`. Drop `--strict` if you chose to omit `version` in the previous step. + * **Paths** : validation reports component paths that don’t start with `./`. Inside hook commands and MCP server configs, refer to files as `${CLAUDE_PLUGIN_ROOT}/...`. See [path rules](</docs/en/plugins/manifest-reference#path-rules>). + +4 + +Install it from a local marketplace + +In your shell, add a local marketplace that lists the plugin with `claude plugin marketplace add ./path-to-marketplace`, install the plugin from it, and start a session to confirm it loads. + + * For the smallest marketplace that works, see [Create a marketplace](</docs/en/plugins/create-marketplace>). + * To know whether an install loads your source directory or a cached copy, see [In-place and copied plugins](</docs/en/plugins/loading#in-place-and-copied-plugins>). + +5 + +Fill in the metadata users see + +Set `description`, `author`, `homepage`, and `repository` in `plugin.json`, and add a `README.md` at the plugin root. `homepage` must parse as a URL. The [manifest reference](</docs/en/plugins/manifest-reference#fields>) lists every field. + +6 + +Run your eval suite + +If you have an eval suite, run `claude plugin eval` in your shell. It runs the plugin’s test cases and scores the results, which catches regressions when you change the plugin. See [Test plugins with evals](</docs/en/plugin-evals>). + +## + +​ + +Share a plugin without a marketplace + +If the plugin is in a git repository, people can clone it and load the checkout, or start Claude Code from their shell with `--plugin-url` pointed at a `.zip` you attach to a release. To get your next version they pull or download again. If it isn’t in a repository, send them the directory or a `.zip` of it. They load it in one of two ways: + + * **For one session** : they start Claude Code from their shell with `claude --plugin-dir ./deploy-helper`, where the path is the clone, the unzipped folder, or the `.zip` itself. See [Flags that load a plugin for one session](</docs/en/plugins/cli-reference#flags-that-load-a-plugin-for-one-session>). + * **For every session** : they move the plugin directory, with its `.claude-plugin/plugin.json`, under `~/.claude/skills/` so Claude Code [loads it in every session](</docs/en/plugins/loading#find-where-a-plugin-came-from>). + +Adding a `.claude-plugin/marketplace.json` to that same repository is what lets people install by name and update with a command; see Publish through your own marketplace. + +### + +​ + +Ship a plugin with your own tool + +If you maintain a CLI or SDK, publish the plugin in a marketplace and have your installer or post-install message run or print the two commands a user needs: `claude plugin marketplace add <source>`, then `claude plugin install <name>@<marketplace>`. For in-session discovery when someone uses your tool, see [Recommend your plugin from your CLI](</docs/en/plugins/cli-hints>). + +## + +​ + +Publish through your own marketplace + +Your own marketplace is a `.claude-plugin/marketplace.json` file that lists your plugin, added to a git repository. Once the file is in the repository, the plugin is published, with no submission form. You can keep the file in the plugin’s own repository or in a separate one. + +### + +​ + +Add the marketplace file to your repository + +To publish from the plugin’s own repository, save the marketplace file beside `plugin.json` in `.claude-plugin/`, with one entry whose `source` is `"./"`, the repository root. Give the entry the same `name` as `plugin.json`, per [Keep the entry name and the manifest name the same](</docs/en/plugins/create-marketplace#keep-the-entry-name-and-the-manifest-name-the-same>): + +.claude-plugin/marketplace.json + + { + "name": "your-marketplace", + "owner": { "name": "Your Name" }, + "plugins": [ + { "name": "deploy-helper", "source": "./" } + ] + } + +In your shell, run `claude plugin validate .` in the repository to check the file before you push. [Create a marketplace](</docs/en/plugins/create-marketplace>) covers the layout with several plugins in one repository. + +### + +​ + +Control who can install + +Anyone who can clone the repository can install from it, so if the repository is private, the marketplace is private too. For hosts other than a git repository, see [Host a marketplace](</docs/en/plugins/host-marketplace>). To reach everyone at a company, including people who don’t use git, see [Roll out to a whole company](</docs/en/plugins/host-marketplace#roll-out-to-a-whole-company>). + +### + +​ + +Tell users how to install + +Tell your users to add the marketplace and then install the plugin from their shell, replacing the source and names with yours: + + * Add the marketplace once: `claude plugin marketplace add your-org/your-marketplace`, where the argument is a GitHub `owner/repo` shorthand, a URL, or a path + * Install the plugin: `claude plugin install deploy-helper@your-marketplace` + * Or do both from inside a session: `/plugin install deploy-helper --marketplace your-org/your-marketplace`. Requires Claude Code v2.1.275 or later. See [Add a marketplace and install in one command](</docs/en/plugins/install#add-a-marketplace-and-install-in-one-command>) + +### + +​ + +Ship updates to users + +Users receive a release when they ask for it or when auto-update is on for your marketplace: + + * **On request** : `claude plugin update deploy-helper@your-marketplace` in the user’s shell refreshes the marketplace and installs the new copy when your plugin’s version has changed + * **Auto-update** : off by default for your marketplace. See [Turn on auto-update](</docs/en/plugins/host-marketplace#turn-on-auto-update>). Once on, it does the same as `claude plugin update` on a delay after the session starts + +[Install plugins](</docs/en/plugins/install>) covers the user-side commands, and [when auto-update runs](</docs/en/plugins/loading#when-auto-update-runs>) covers the timing. + +## + +​ + +Submit to the community marketplace + +Anthropic’s community marketplace, `claude-community`, is the public marketplace that lists plugins submitted through the plugin directory submission form. Users add the community marketplace in a Claude Code session with `/plugin marketplace add anthropics/claude-plugins-community` and install from it as `@claude-community`. For how the community marketplace differs from the official marketplace, see [Anthropic’s marketplaces](</docs/en/plugins/anthropic-marketplaces>). To submit your plugin to the community marketplace, use one of the in-app forms: + + * **claude.ai** : [claude.ai/admin-settings/directory/submissions/plugins/new](<https://claude.ai/admin-settings/directory/submissions/plugins/new>) + * **Console** : [platform.claude.com/plugins/submit](<https://platform.claude.com/plugins/submit>) + +The claude.ai form requires a Team or Enterprise organization and the Directory permission, which Owners hold by default. Individual authors who aren’t part of a Team or Enterprise organization can use the Console form instead. In your shell, run `claude plugin validate ./your-plugin` locally before you submit, replacing `./your-plugin` with the path to your plugin directory. When validation passes, Claude Code prints `✔ Validation passed`, or `✔ Validation passed with warnings` if there are warnings. Warnings don’t fail validation; add `--strict` to treat them as errors. Listed plugins appear in the [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>) catalog, in nearly every case pinned to a specific commit SHA. There can be a delay between submitting and your plugin appearing in `marketplace.json`. To check whether your plugin is installable yet, search for its name in the [community catalog](<https://github.com/anthropics/claude-plugins-community/blob/main/.claude-plugin/marketplace.json>). The official marketplace, `claude-plugins-official`, doesn’t take submissions through these forms. If you work with an Anthropic partner contact, ask them about an official-marketplace listing. + +## + +​ + +Ship updates, renames, and removals + +### + +​ + +Release a new version + +If you publish through your own marketplace and your `plugin.json` sets `version`, increment it and push. Users who run `claude plugin update` or have auto-update on then receive the new version, as described under Ship updates to users. + +### + +​ + +Tag a release + +Tag the release in git when other plugins declare a version range on yours, because those ranges resolve against tags. Otherwise you don’t need a tag. To tag, run `claude plugin tag` in your shell from the plugin directory. It creates a `{name}--v{version}` tag. Add `--push` to send the tag to `origin`. The [`plugin tag` reference](</docs/en/plugins/cli-reference#plugin-tag>) lists its flags. + +### + +​ + +Rename or remove a plugin + +Never change a published plugin’s `name`. After a rename, users who already installed it lose the plugin, because their install is recorded under the old name. A `renames` entry in your marketplace file migrates them instead. Change `displayName` when you want a different label. If a rename is unavoidable, use the marketplace file’s `renames` map so that existing installs migrate instead of failing with [`Plugin "<name>" not found in marketplace`](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>). To remove a plugin from the marketplace, or for the full `renames` details, see [Rename or remove a plugin](</docs/en/plugins/host-marketplace#rename-or-remove-a-plugin>) on the hosting page. The [marketplace reference](</docs/en/plugins/marketplace-reference#top-level-fields>) has the field. + +## + +​ + +Declare dependencies + +If your plugin needs another plugin from the same marketplace to be enabled, list it in the `dependencies` array of `plugin.json`. Each entry is a bare name or an object with a semver `version` range. When a user installs your plugin, Claude Code installs and enables the dependency too. [Plugin dependencies](</docs/en/plugins/dependencies>) covers the range syntax, cross-marketplace dependencies, and how users prune dependencies they no longer need. + +## + +​ + +Next steps + + * [Host and maintain a marketplace](</docs/en/plugins/host-marketplace>): release new versions and keep users up to date + * [Plugin dependencies](</docs/en/plugins/dependencies>): declare and version the plugins yours relies on + * [Recommend your plugin from your CLI](</docs/en/plugins/cli-hints>): prompt Claude Code users of your CLI to install the plugin + * [Measure plugin cost and usage](</docs/en/plugins/measure>): see what your plugin costs in context and whether people use it
modified Agent SDK reference - Python View current →
--- a/python.md +++ b/python.md @@ -914,14 +914,14 @@ `cli_path`| `str | Path | None`| `None`| Custom path to the Claude Code CLI executable `settings`| `str | None`| `None`| Path to a settings file or an inline JSON string `add_dirs`| `list[str | Path]`| `[]`| Additional directories Claude can access. The SDK passes each entry to Claude Code as `--add-dir`, so with the `project` setting source Claude Code also [loads the directory’s skills, commands, and subagents](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) -`env`| `dict[str, str]`| `{}`| Environment variables merged on top of the inherited process environment. See [Environment variables](</docs/en/env-vars>) for variables the underlying CLI reads, and Handle slow or stalled API responses for timeout-related variables +`env`| `dict[str, str]`| `{}`| Environment variables merged on top of the inherited process environment. See [Environment variables](</docs/en/env-vars>) for variables the underlying CLI reads, and Handle slow or stalled API responses for timeout-related variables. Set `CLAUDE_AGENT_SDK_CLIENT_APP` to identify your app in the User-Agent header `extra_args`| `dict[str, str | None]`| `{}`| Additional CLI arguments to pass directly to the CLI `max_buffer_size`| `int | None`| `None`| Maximum bytes when buffering CLI stdout -`debug_stderr`| `Any`| `sys.stderr`| _Deprecated_ \- File-like object for debug output. Use `stderr` callback instead +`debug_stderr`| `Any`| `sys.stderr`| _Deprecated_ \- The SDK ignores this value. Use the `stderr` callback for CLI stderr output `stderr`| `Callable[[str], None] | None`| `None`| Callback function for stderr output from CLI `can_use_tool`| `CanUseTool` ` | None`| `None`| Tool permission callback, invoked only when the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) falls through to a prompt. Not invoked for calls auto-approved by `allowed_tools`, allow rules, or `permission_mode`. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). See `CanUseTool` for details `hooks`| `dict[HookEvent, list[HookMatcher]] | None`| `None`| Hook configurations for intercepting events -`user`| `str | None`| `None`| User identifier +`user`| `str | None`| `None`| On POSIX platforms, the OS user account the Claude Code subprocess runs as. Claude Code keeps the parent process’s environment, including `HOME`, and runs in `cwd` `include_partial_messages`| `bool`| `False`| Include partial message streaming events. When enabled, `StreamEvent` messages are yielded `include_hook_events`| `bool`| `False`| Include hook lifecycle events in the message stream as `HookEventMessage` objects `forward_subagent_text`| `bool`| `False`| Forward subagent text and thinking blocks in the message stream. Without this option, Claude Code emits subagent `tool_use` and `tool_result` blocks but not text or thinking. Requires Python Agent SDK 0.2.140 or later @@ -1846,7 +1846,7 @@ Field| Type| Description ---|---|--- -`status`| `RateLimitStatus`| Current status. `"allowed_warning"` means approaching the limit; `"rejected"` means the limit was hit +`status`| `RateLimitStatus`| Current status, one of `"allowed"`, `"allowed_warning"`, or `"rejected"`. `"allowed_warning"` means approaching the limit; `"rejected"` means the limit was hit `resets_at`| `int | None`| Unix timestamp when the rate limit window resets `rate_limit_type`| `RateLimitType | None`| Which rate limit window applies `utilization`| `float | None`| Fraction of the rate limit consumed (0.0 to 1.0)
modified Quickstart View current →
--- a/quickstart.md +++ b/quickstart.md @@ -229,7 +229,7 @@ This is what makes the Agent SDK different: Claude executes tools directly instead of asking you to implement them. -If you see an authentication error such as `Not logged in` or `Invalid API key`, make sure you’ve set the `ANTHROPIC_API_KEY` environment variable in the shell where you run your agent. The SDK doesn’t load `.env` files automatically. See the [full troubleshooting guide](</docs/en/troubleshooting>) for more help. +If you see an authentication error such as `Not logged in` or `Invalid API key`, make sure you’ve set the `ANTHROPIC_API_KEY` environment variable in the shell where you run your agent. The SDK doesn’t load `.env` files automatically.For the causes and fixes behind these and other authentication errors, see [Authentication errors](</docs/en/errors#authentication-errors>) in the Error reference. ### @@ -336,4 +336,4 @@ * **[MCP servers](</docs/en/agent-sdk/mcp>)** : connect to databases, browsers, APIs, and other external systems * **[Hosting](</docs/en/agent-sdk/hosting>)** : deploy agents to Docker, cloud, and CI/CD * **[Example agents](<https://github.com/anthropics/claude-agent-sdk-demos>)** : see complete examples: email assistant, research agent, and more - * **[Troubleshooting](</docs/en/agent-sdk/troubleshooting>)** : fix Agent SDK errors by the exact message you see + * **[Troubleshooting](</docs/en/agent-sdk/troubleshooting>)** : fix errors when the CLI fails to start or exits, or a result arrives without structured output
added Recommend plugins for your org View current →
Show diff (228 lines)
--- a/relevance.md +++ b/relevance.md @@ -0,0 +1,225 @@ +Claude Code can suggest installing a plugin from your organization’s marketplace when a user’s session matches signals you define for that plugin. Signals include the working directory, files Claude has read, and commands Claude has run. You define them by adding a `relevance` block to the plugin’s entry in `marketplace.json`. A marketplace operator writes the `relevance` entries. An administrator then allowlists the marketplace in managed settings. Users see no suggestions from a marketplace until it’s allowlisted. + +These cases are covered on other pages: + + * **You want to install plugins** : see [Install and manage plugins](</docs/en/plugins/install>) + * **You want to turn suggestions off** : see Understand how plugin relevance works + +Start with the sections for your role: + + * **Marketplace operators** : read how suggestions work, then add relevance to a plugin entry and validate your marketplace + * **Administrators** : enable suggestions in managed settings + +## + +​ + +Understand how plugin relevance works + +Each plugin entry in `marketplace.json` can include a `relevance` object. The object names a topic and one or more signals. A signal is a pattern that Claude Code tests against the current session, such as the working directory or files Claude has read. Signal matching happens locally on the user’s machine and adds no network traffic. Claude Code doesn’t report which signals matched or their values to Anthropic or to the marketplace operator. When a signal matches and the plugin isn’t already installed, Claude Code suggests the plugin in these places: + + * **Spinner tip** : a message with the `/plugin install` command appears below the spinner while Claude is responding. + * **Session-start notification** : if a `cwd` signal matches the working directory, a one-line notification appears before the user sends a first message. + * **`/plugin` Discover tab**: the plugin is pinned to the top of the Discover list. + +Preview what the user sees shows the exact text of each and how often they repeat. Claude Code never installs the plugin automatically. The user always confirms. The spinner tip and the session-start notification both stop appearing when the user or project sets [`spinnerTipsEnabled`](</docs/en/settings-reference#spinnertipsenabled>) to `false`, or when a [`spinnerTipsOverride`](</docs/en/settings-reference#spinnertipsoverride>) with `excludeDefault` replaces the built-in tips. The Discover-tab pin isn’t affected by either setting. + +## + +​ + +Add relevance to a plugin entry + +Add a `relevance` object to the plugin’s entry in your `marketplace.json`. The following example declares that the `terraform-helpers` plugin is relevant when Claude reads a `.tf` file or runs `terraform`: + + { + "name": "your-marketplace", + "owner": { "name": "Your Org" }, + "plugins": [ + { + "name": "terraform-helpers", + "source": "./plugins/terraform-helpers", + "description": "Your organization's Terraform conventions and helpers", + "relevance": { + "topic": "Terraform", + "signals": { + "cli": ["terraform"], + "filesRead": ["**/*.tf"] + } + } + } + ] + } + +While none of its signals match, the plugin keeps its normal position in the Discover list and doesn’t appear as a spinner tip. To check the block before publishing, validate your marketplace. + +## + +​ + +Field reference + +The `relevance` object and its nested `signals` object accept the fields in the following tables. Older clients still load a marketplace that uses `relevance` fields they don’t recognize, because unknown fields under `relevance` and `relevance.signals` are ignored at load time. A recognized field whose value exceeds its limit in the field reference invalidates the whole plugin entry, and users can’t install that plugin from the marketplace until you fix it; `claude plugin validate` reports the same limits. + +### + +​ + +`relevance` + +Field| Type| Description +---|---|--- +`topic`| string| Optional. The phrase that fills “Working with _topic_?” in the spinner tip. Defaults to the plugin name with each hyphen segment capitalized. Maximum 64 characters. +`signals`| object| Matchers that determine when the plugin is relevant. Claude Code suggests the plugin only if at least one signal is set. See `relevance.signals`. + +The `topic` is often the product name, for example `Terraform`. Use a domain such as `design` when the plugin name doesn’t sound natural as a topic. + +### + +​ + +`relevance.signals` + +The `signals` object accepts the following fields. + +Field| Type| Description| Limit +---|---|---|--- +`cwd`| array of strings| Glob patterns matched against the session’s working directory. See working directory matching.| 10 patterns of 256 characters each +`cli`| array of strings| Command names from shell commands Claude has run this session, for example `["terraform"]`. Exact match. See command name matching.| 10 entries of 64 characters each +`hosts`| array of strings| Hostnames seen in `http://` or `https://` URLs in Bash commands this session, for example `["registry.terraform.io"]`. Bare lowercase hostname only: no scheme, port, or path. Exact case-insensitive match.| 20 entries of 128 characters each +`filesRead`| array of strings| Glob patterns matched against the paths of files Claude has read this session, for example `["**/*.tf"]`. Forward-slash normalized and case-insensitive.| 10 patterns of 256 characters each +`manifestDeps`| array of objects| Dependencies declared in package manifests Claude has read this session. Each entry is `{ "file": "...", "pattern": "..." }`, where both values are regular expressions. See manifest dependency matching.| 10 entries, each value at most 256 characters. Manifest files larger than 512 KB are skipped + +The `filesRead` and `manifestDeps` signals also match against files Claude has written or edited this session and against the project’s auto-loaded `CLAUDE.md` memory files. + +#### + +​ + +Working directory matching + +`cwd` is the only signal that can match at session start, before the user sends a first message. Claude Code matches each `cwd` pattern as follows: + + * The pattern is matched against the working directory as an absolute path. When the session is inside a git repository, it’s also matched against the working directory’s path relative to the repository root. + * Matching is forward-slash normalized and case-insensitive. + * Every pattern matches the directory itself and everything under it, so `infra`, `infra/`, and `infra/**` behave identically. + +#### + +​ + +Command name matching + +Claude Code records one command name for each shell command Claude runs: the first token after any leading environment variable assignments and `sudo`. Compound commands contribute only their leading command, so `cd infra && terraform plan` records `cd`, not `terraform`. + +#### + +​ + +Manifest dependency matching + +Each `manifestDeps` entry pairs two JavaScript `RegExp` source strings: + + * `file`: matched case-insensitively against the manifest file’s path. The path is typically absolute, so anchor the pattern at the end rather than the start. Paths aren’t separator-normalized for this signal, so Windows paths use backslashes. + * `pattern`: matched case-sensitively against that file’s contents. + +The following example uses `manifestDeps` to suggest your plugin once Claude has read a `package.json` that depends on your SDK’s npm package, named `your-sdk` here. + + { + "name": "your-plugin", + "source": "./plugins/your-plugin", + "relevance": { + "signals": { + "manifestDeps": [ + { + "file": "[/\\\\]package\\.json$", + "pattern": "\"your-sdk\"\\s*:" + } + ] + } + } + } + +In this example, the `file` pattern uses `[/\\\\]` so it matches both forward-slash and backslash path separators, and `\\.` so the dot is literal. In JSON, each backslash in the regular expression is written twice. + +## + +​ + +Validate your marketplace + +In your shell, run `claude plugin validate` against your marketplace directory to check the `relevance` block before publishing: + + claude plugin validate ./my-marketplace + +The validator reports errors and warnings on the `relevance` block, including these: + + * Reports unknown keys under `relevance` and `relevance.signals` as warnings + * Flags a `relevance` value that isn’t an object + * Rejects a `signals.hosts` entry that includes a scheme, port, or path + +Each finding prints with the path of the field it concerns, and the output ends with `Validation passed`, `Validation passed with warnings`, or `Validation failed`. + +## + +​ + +Enable suggestions in managed settings + +Users see no suggestions from a marketplace until an administrator allowlists it in [managed settings](</docs/en/plugins/org>), even when its `marketplace.json` declares `relevance`. To allowlist a marketplace, edit your managed settings as follows: + + * Add the marketplace name to `pluginSuggestionMarketplaces`. + * For any marketplace other than the official Anthropic marketplace, also declare the marketplace source, either as that name’s entry in [`extraKnownMarketplaces`](</docs/en/plugins/org#require-a-marketplace-and-its-plugins>) or as an entry in [`strictKnownMarketplaces`](</docs/en/plugins/org#allowlist-with-strictknownmarketplaces>). + +On a machine where the marketplace isn’t registered, or is registered under the allowlisted name from a different source, no suggestions from it appear. The source check stops an unrelated source from registering under an allowlisted name to get its plugins suggested across your org. The following `managed-settings.json` registers an org marketplace from a GitHub repository and enables its suggestions: + + { + "extraKnownMarketplaces": { + "your-marketplace": { + "source": { + "source": "github", + "repo": "your-org/your-marketplace" + } + } + }, + "pluginSuggestionMarketplaces": ["your-marketplace"] + } + +The official marketplace’s name can only register from the official Anthropic source, so it needs no source declaration. For the official marketplace, allowlist the name alone: + + { + "pluginSuggestionMarketplaces": ["claude-plugins-official"] + } + +## + +​ + +Preview what the user sees + +When a plugin’s `relevance` signal matches during a session, the tip below the spinner reads: + + Working with Terraform? Install the terraform-helpers plugin: + /plugin install terraform-helpers@your-marketplace + +When a `cwd` signal matches at session start, the one-line notification reads: + + plugin suggestion: terraform-helpers@your-marketplace · /plugin + +In the `/plugin` Discover tab, the plugin is pinned above the other results with an annotation that names the matching signal, such as `suggested for this directory` or `suggested for terraform commands`. Claude Code limits how often it suggests a given plugin: + + * The suggestion appears at most once every three sessions across the spinner tip and the session-start notification combined. + * The session-start notification stops appearing once the spinner tip and the notification have shown the plugin a combined total of two times. + * Neither the spinner tip nor the session-start notification repeats once the plugin is installed. + * The Discover tab pins the plugin the first time the user opens the tab while the plugin’s signals match. Claude Code records that in `~/.claude.json`, so every later time the user opens `/plugin` on that machine, the plugin appears in normal order. + +## + +​ + +See also + + * [Host a marketplace](</docs/en/plugins/host-marketplace>): run the marketplace that hosts your plugins + * [Marketplace reference](</docs/en/plugins/marketplace-reference#plugin-entries>): every field a plugin entry accepts + * [Recommend your plugin from your CLI](</docs/en/plugins/cli-hints>): prompt users from your own CLI instead of from Claude Code’s session signals + * [Manage plugins for your organization](</docs/en/plugins/org>): `extraKnownMarketplaces`, `strictKnownMarketplaces`, and the rest of the plugin policy keys
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -207,9 +207,9 @@ Trusted Devices -Trusted Devices is currently in beta. Features and functionality may evolve as the experience is refined.Trusted Devices is available on Team and Enterprise plans. It is off by default until an Owner enables it. - -Trusted Devices is an organization-wide setting that requires members to verify their device before they can view or steer Remote Control sessions from claude.ai, the Claude mobile apps, or Claude Desktop. It ties Remote Control access to a known device and a recent authentication, not just a signed-in account. When the setting is on, interacting with a Remote Control session requires both of the following: +Trusted Devices is currently in beta. Features and functionality may evolve as the experience is refined.Trusted Devices is available on Pro, Max, Team, and Enterprise plans and is off by default. On Team and Enterprise plans, an Owner turns it on for the organization. On Pro and Max plans, you turn on **Require trusted devices** yourself in your settings, on the Cowork or Account page. + +Trusted Devices requires each member of your organization, or you alone on a Pro or Max plan, to verify their device before they can view or steer Remote Control sessions from claude.ai, the Claude mobile apps, or Claude Desktop. It ties Remote Control access to a known device and a recent authentication, not just a signed-in account. When the setting is on, interacting with a Remote Control session requires both of the following: * **An enrolled device** : each browser, phone, or desktop app a member uses for Remote Control enrolls its own credential. Enrollment is only offered shortly after a full sign-in, so a device joins the trusted list as part of a real authentication rather than silently in the background. * **A recent sign-in** : the member’s sign-in must be no more than 18 hours old. Instead of signing in again each day, members confirm presence with Face ID, Touch ID, Windows Hello, or a passkey. This biometric step-up refreshes the session immediately. @@ -220,15 +220,15 @@ ​ -Enable Trusted Devices for your organization - -An Owner enables the setting from the Claude Code admin console. +Enable Trusted Devices for a Team or Enterprise organization + +An Owner enables the setting from the claude.ai organization settings. 1 -Open Claude Code admin settings - -Go to [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). The **Require trusted devices** toggle appears under the Remote Control setting. +Go to the Capabilities page + +Go to [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). The **Require trusted devices** toggle appears in that section. 2
modified Configure the sandboxed Bash tool View current →
--- a/sandboxing.md +++ b/sandboxing.md @@ -110,7 +110,7 @@ * Content-scoped [ask rules](</docs/en/permissions>) like `Bash(git push *)` still force a prompt even for sandboxed commands * A bare `Bash` ask rule, or the equivalent `Bash(*)` form, is skipped for commands that run sandboxed; it still applies to commands that fall back to the regular permission flow. In [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>), the rule isn’t skipped: it prompts for sandboxed commands too, including read-only ones. Before v2.1.212, the skip applied in plan mode as well -Auto-allow mode works independently of your permission mode setting, except in [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) and, in auto mode, for a command that carries per-command allowed domains. Even if you’re not in “accept edits” mode, sandboxed Bash commands run automatically when auto-allow is enabled. This means Bash commands that modify files within the sandbox boundaries execute without prompting, even in Manual mode, where the file edit tools would prompt.In plan mode, auto-allow doesn’t widen approvals; see [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) for how Claude Code gates commands while you plan. Before v2.1.212, auto-allow ran sandboxed commands without a prompt in plan mode too. +Auto-allow mode works independently of your permission mode setting, with three exceptions: [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>), an auto mode command that carries per-command allowed domains, and [server-side classifier review](</docs/en/permission-modes#how-the-classifier-evaluates-actions>) of sandboxed commands in auto mode. Even if you’re not in “accept edits” mode, sandboxed Bash commands run automatically when auto-allow is enabled. This means Bash commands that modify files within the sandbox boundaries execute without prompting, even in Manual mode, where the file edit tools would prompt.In plan mode, auto-allow doesn’t widen approvals; see [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) for how Claude Code gates commands while you plan. Before v2.1.212, auto-allow ran sandboxed commands without a prompt in plan mode too. #### @@ -260,7 +260,7 @@ Protect credentials -The `sandbox.credentials` setting declares credential files and environment variables to protect from sandboxed commands. Each entry names a file path or an environment variable and a `mode`. The dedicated `credentials` block keeps credential rules grouped together and separate from general filesystem rules. Requires Claude Code v2.1.187 or later. For entries with `"mode": "deny"`, file paths are denied for reads inside the sandbox, the same restriction that `filesystem.denyRead` applies, and environment variables are unset before each sandboxed command runs. The file protection is part of the filesystem layer, so it doesn’t apply if you disable filesystem isolation; the environment variable protection still does. The example below blocks reads of the AWS credentials file and the SSH directory and removes `GITHUB_TOKEN` and `NPM_TOKEN` from the environment of sandboxed commands: +The `sandbox.credentials` setting declares credential files and environment variables to protect from sandboxed commands. Each entry names a file path or an environment variable and a `mode`. The dedicated `credentials` block keeps credential rules grouped together and separate from general filesystem rules. For entries with `"mode": "deny"`, file paths are denied for reads inside the sandbox, the same restriction that `filesystem.denyRead` applies, and environment variables are unset before each sandboxed command runs. The file protection is part of the filesystem layer, so it doesn’t apply if you disable filesystem isolation; the environment variable protection still does. The example below blocks reads of the AWS credentials file and the SSH directory and removes `GITHUB_TOKEN` and `NPM_TOKEN` from the environment of sandboxed commands: { "sandbox": {
modified Catch security issues as Claude writes code View current →
--- a/security-guidance.md +++ b/security-guidance.md @@ -17,7 +17,7 @@ Install the plugin -In a terminal Claude Code session, install from the [official Anthropic marketplace](</docs/en/discover-plugins#official-anthropic-marketplace>): +In a terminal Claude Code session, install from the [official Anthropic marketplace](</docs/en/plugins/anthropic-marketplaces>): /plugin install security-guidance@claude-plugins-official @@ -25,14 +25,14 @@ * **Claude desktop app, local or SSH session** : open the [plugin browser](</docs/en/desktop#install-plugins>) by clicking the **+** button next to the prompt, then **Plugins** , then **Add plugin** * **VS Code extension** : install from the [**Manage plugins** dialog](</docs/en/vs-code#manage-plugins>) - * **Cloud sessions** : enable the plugin for your claude.ai account so Claude Code loads it as a [synced plugin](</docs/en/plugins-reference#synced-plugins>). A cloud session doesn’t load plugins from your user settings or from the repository’s `.claude/settings.json`, as [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>) explains + * **Cloud sessions** : a cloud session doesn’t load plugins from your user settings or from the repository’s `.claude/settings.json`, as [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>) explains. For plugins your organization distributes through managed settings, see [Manage plugins for your organization](</docs/en/plugins/org>) The terminal install prompts for a scope. Choose user scope to write the plugin to your user settings, so it loads in every new local session you start on this machine. If the install fails, match the message Claude Code reports: * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install. - * The plugin is [not found in the marketplace](</docs/en/discover-plugins#install-plugins>): check the plugin name. - -Check the install summary. If it reports `Run /reload-plugins to activate.`, see [Apply plugin changes without restarting](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) to activate the plugin in your current session. + * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name. + +Check the install summary. If it reports `Run /reload-plugins to activate.`, see [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>) to activate the plugin in your current session. ### @@ -277,4 +277,4 @@ * [Code Review](</docs/en/code-review>): set up the PR-time multi-agent review * [Automate actions with hooks](</docs/en/hooks-guide>): build your own checks at the same lifecycle points - * [Discover and install plugins](</docs/en/discover-plugins#official-anthropic-marketplace>): browse other official plugins + * [Find plugins in the official marketplace](</docs/en/plugins/anthropic-marketplaces#find-plugins-in-the-official-marketplace>): where to browse the other official plugins
modified Configure server-managed settings View current →
--- a/server-managed-settings.md +++ b/server-managed-settings.md @@ -221,7 +221,7 @@ "forceRemoteSettingsRefresh": true } -You can also set this key in an [endpoint-managed](</docs/en/managed-settings#delivery-mechanisms>) MDM profile or system `managed-settings.json` file to enforce fail-closed behavior on first launch, before any server payload has arrived. In Claude Code v2.1.191 or later, this flag is an exception to the precedence rule above: Claude Code honors it when any admin-controlled managed source sets it, even if a cached server-managed payload is also present, so it doesn’t ignore an MDM-delivered value when server-managed settings exist. When a [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings, its output replaces every other managed source for the keys Claude Code reads after startup. For the sources Claude Code reads this key from, see [its settings entry](</docs/en/settings-reference#forceremotesettingsrefresh>). The `policyHelper` entry says which sources Claude Code reads the helper from and when it runs. The settings fetch also sends a `Cache-Control: no-cache` header so intermediate HTTP proxies don’t serve a stale response. Before enabling this setting, ensure your network policies allow connectivity to `api.anthropic.com`. If that endpoint is unreachable, the CLI exits at startup and users cannot start Claude Code. The `claude auth` subcommands such as `claude auth login` are exempt from this check and from the gateway startup exit, so users can re-authenticate when expired credentials are the reason the settings fetch fails. +You can also set this key in an [endpoint-managed](</docs/en/managed-settings#delivery-mechanisms>) MDM profile or system `managed-settings.json` file to enforce fail-closed behavior on first launch, before any server payload has arrived. This flag is an exception to the precedence rule above: Claude Code honors it when any admin-controlled managed source sets it, even if a cached server-managed payload is also present, so it doesn’t ignore an MDM-delivered value when server-managed settings exist. When a [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings, its output replaces every other managed source for the keys Claude Code reads after startup. For the sources Claude Code reads this key from, see [its settings entry](</docs/en/settings-reference#forceremotesettingsrefresh>). The `policyHelper` entry says which sources Claude Code reads the helper from and when it runs. The settings fetch also sends a `Cache-Control: no-cache` header so intermediate HTTP proxies don’t serve a stale response. Before enabling this setting, ensure your network policies allow connectivity to `api.anthropic.com`. If that endpoint is unreachable, the CLI exits at startup and users cannot start Claude Code. The `claude auth` subcommands such as `claude auth login` are exempt from this check and from the gateway startup exit, so users can re-authenticate when expired credentials are the reason the settings fetch fails. ### @@ -292,7 +292,7 @@ * A directly configured API key * A `user_oauth` [Anthropic profile](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), unless the profile sets a `base_url` other than the Anthropic API. Requires Claude Code v2.1.257 or later. -Neither keys returned by an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script nor [Workload Identity Federation](<https://platform.claude.com/docs/en/manage-claude/workload-identity-federation>) credentials trigger the settings fetch. In a [Cowork](<https://claude.com/docs/cowork/overview>) session in the Claude Desktop app, Claude Code doesn’t fetch server-managed settings from the claude.ai admin console, even when the user signs in with a Team or Enterprise account. [Where and when a policy applies](</docs/en/managed-settings#where-and-when-a-policy-applies>) covers which policy reaches Cowork sessions on the user’s machine and remote Cowork sessions. If you export a `CLAUDE_CODE_USE_*` provider variable or a non-default `ANTHROPIC_BASE_URL` in your shell, Claude Code skips the settings fetch for your sessions. `claude doctor` and `/status` report the skipped fetch and its cause. You can’t clear the export with a server-managed `env` block, because the block arrives through the fetch that the export prevents. An [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) `env` block doesn’t restore the fetch either: Claude Code checks eligibility before it applies managed `env` blocks, so the endpoint-managed value changes the session’s provider selection but the fetch stays skipped. To restore server-managed delivery, remove the export from your shell, or set the variable to `""` in your user settings `env` block, which applies before the eligibility check. To enforce policy without relying on users to change their shells, deliver the settings through the endpoint-managed channel instead. For Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) deployments, a self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) provides the equivalent remote managed-settings delivery: gateway-signed-in clients fetch managed settings from the gateway instead of `api.anthropic.com`. The failure semantics differ at startup: a gateway client that can’t reach the gateway exits with an error instead of falling back to cached settings, while the hourly background refresh is fail-open on both channels. +Neither keys returned by an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script nor [Workload Identity Federation](<https://platform.claude.com/docs/en/manage-claude/workload-identity-federation>) credentials trigger the settings fetch. In a [Cowork](<https://claude.com/docs/cowork/overview>) session in the Claude Desktop app, Claude Code doesn’t fetch server-managed settings from the claude.ai admin console, even when the user signs in with a Team or Enterprise account. [Where and when a policy applies](</docs/en/managed-settings#where-and-when-a-policy-applies>) covers which policy reaches Cowork sessions on the user’s machine and remote Cowork sessions. claude.ai still applies your [`strictKnownMarketplaces`](</docs/en/settings-reference#strictknownmarketplaces>) and [`blockedMarketplaces`](</docs/en/settings-reference#blockedmarketplaces>) lists itself when a Cowork user adds a marketplace from a git repository on claude.ai or from **Customize** in the Cowork tab. [How restrictions work](</docs/en/plugins/org#restrict-what-users-can-install>) describes that check. If you export a `CLAUDE_CODE_USE_*` provider variable or a non-default `ANTHROPIC_BASE_URL` in your shell, Claude Code skips the settings fetch for your sessions. `claude doctor` and `/status` report the skipped fetch and its cause. You can’t clear the export with a server-managed `env` block, because the block arrives through the fetch that the export prevents. An [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) `env` block doesn’t restore the fetch either: Claude Code checks eligibility before it applies managed `env` blocks, so the endpoint-managed value changes the session’s provider selection but the fetch stays skipped. To restore server-managed delivery, remove the export from your shell, or set the variable to `""` in your user settings `env` block, which applies before the eligibility check. To enforce policy without relying on users to change their shells, deliver the settings through the endpoint-managed channel instead. For Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) deployments, a self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) provides the equivalent remote managed-settings delivery: gateway-signed-in clients fetch managed settings from the gateway instead of `api.anthropic.com`. The failure semantics differ at startup: a gateway client that can’t reach the gateway exits with an error instead of falling back to cached settings, while the hourly background refresh is fail-open on both channels. ##
modified Settings files and precedence View current →
--- a/settings.md +++ b/settings.md @@ -58,7 +58,7 @@ Share settings with your team -Commit `.claude/settings.json` so everyone who clones the repository gets the same permissions, hooks, telemetry, and plugins. Each teammate can still override it for themselves in their own `.claude/settings.local.json`, so personal exceptions don’t need a commit. For a complete team file, see [a team’s shared settings](</docs/en/settings-example#a-teams-shared-settings>). Some of what you commit waits until each teammate [trusts the folder](</docs/en/permissions#project-allow-rules-and-workspace-trust>), and a few keys never take effect from a repository file; Troubleshoot a setting that doesn’t apply covers both. +Commit `.claude/settings.json` so everyone who clones the repository gets the same permissions, hooks, and plugins. Each teammate can still override it for themselves in their own `.claude/settings.local.json`, so personal exceptions don’t need a commit. For a complete team file, see [a team’s shared settings](</docs/en/settings-example#a-teams-shared-settings>). Some of what you commit waits until each teammate [trusts the folder](</docs/en/permissions#project-allow-rules-and-workspace-trust>), and a few keys never take effect from a repository file; Troubleshoot a setting that doesn’t apply covers both. ### @@ -286,7 +286,7 @@ * **A higher level sets it.** Another settings file, a `--settings` flag, or a managed source sets the key above yours; the stack says which. A flag or environment variable can also override the key on its own, decided key by key; the key’s entry on the [settings reference](</docs/en/settings-reference>) says which one Claude Code uses, and the [`env` entry](</docs/en/settings-reference#env>) covers a managed `env` value versus a shell export. * **A security key keeps its strict value.** For a few keys Claude Code honors the restrictive value from any file, so a project `true` for [`disableClaudeAiConnectors`](</docs/en/settings-reference#disableclaudeaiconnectors>) stays on; see Exceptions to managed settings precedence. - * **The file can’t set that value.** [`permissions.defaultMode`](</docs/en/settings-reference#permissions-defaultmode>) values `auto` and `bypassPermissions` don’t take effect from project or local settings; set them in user or managed settings instead, or pass `--permission-mode` for one session. Before v2.1.257, `bypassPermissions` took effect from any file. + * **The file can’t set that value.** [`permissions.defaultMode`](</docs/en/settings-reference#permissions-defaultmode>) values `auto` and `bypassPermissions` don’t take effect from project or local settings; set them in user or managed settings instead, or pass `--permission-mode` for one session. Before v2.1.257, `bypassPermissions` took effect from any file. A telemetry export variable in an [`env`](</docs/en/settings-reference#env>) block doesn’t take effect from project or local settings either, apart from a few off values. [Variables Claude Code ignores in `env`](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) lists the variables and those values. * **The file is broken.** Invalid JSON or a rejected value makes Claude Code skip the file or the entry; see Fix a broken settings file. #### @@ -313,7 +313,7 @@ Two things keep a key in `.claude/settings.json` from applying for everyone who clones it: - * **Claude Code ignores the key in a repository file.** Look for `User, local, or managed`, `User or managed`, `Managed`, or `Global config` in the Scope column of the [settings index](</docs/en/settings-reference#settings-index>). Those keys never apply from the shared file, apart from a few that a repository file can still switch off. Each of those entries says so on its Scope line. `Global config` keys apply only from `~/.claude.json`. + * **Claude Code ignores the key in a repository file.** Look for `User, local, or managed`, `User or managed`, `Managed`, or `Global config` in the Scope column of the [settings index](</docs/en/settings-reference#settings-index>). Those keys never apply from the shared file, apart from a few that a repository file can still switch off. Each of those entries says so on its Scope line. `Global config` keys apply only from `~/.claude.json`. Inside the `env` key, the telemetry export variables never apply from the shared file either, apart from a few off values; see [Variables Claude Code ignores in `env`](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). * **The key waits for trust.** `permissions.allow` rules, `permissions.additionalDirectories`, `extraKnownMarketplaces`, and most [`env`](</docs/en/settings-reference#env>) values apply only after each teammate [trusts the folder](</docs/en/permissions#project-allow-rules-and-workspace-trust>). Until then they still see prompts and don’t get plugins from a marketplace the file declares. `deny` and `ask` rules apply right away. ####
modified Example settings files View current →
--- a/settings-example.md +++ b/settings-example.md @@ -90,9 +90,10 @@ A team’s shared settings -One team’s shared settings, committed to the repository so everyone who clones it gets the same permissions, hooks, telemetry, and plugin marketplace. Save a file like this at `.claude/settings.json` at the top of the repository. What to know before you commit one: +One team’s shared settings, committed to the repository so everyone who clones it gets the same permissions, hooks, and plugin marketplace. Save a file like this at `.claude/settings.json` at the top of the repository. What to know before you commit one: * **Cloud sessions read it too.** A [cloud session](</docs/en/settings#settings-in-cloud-sessions>) starts from a clone of the repository, so the committed file applies there as well. + * **Telemetry goes in managed or personal settings.** Claude Code ignores the [OpenTelemetry exporter variables](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) in a repository’s settings files, apart from some values that turn telemetry off. Set them in [managed settings](</docs/en/monitoring-usage#administrator-configuration>) for your organization, or in each person’s `~/.claude/settings.json`. * **Allow rules wait for trust.** Allow rules and `extraKnownMarketplaces` entries take effect after each person [trusts this folder itself](</docs/en/permissions#project-allow-rules-and-workspace-trust>), not only a parent folder; deny and ask rules apply in every session, trusted or not. * **The hook is a script in the repo.** This file’s hook runs `.claude/hooks/block-rm.sh`; [How a hook resolves](</docs/en/hooks#how-a-hook-resolves>) walks through writing it. * **Rules match the command and path as written.** `Bash(git push *)` doesn’t match [`git -C . push`](</docs/en/permissions#bash-rule-limits>). `Read(./.env)` on its own stops the file tools and commands that name the file, such as `cat .env`, but not [`grep -r` run over the directory](</docs/en/permissions#read-and-edit>); the `sandbox` block in this file closes that gap, because the sandbox [adds your `Read` deny paths](</docs/en/settings-reference#sandbox-filesystem-denyread>) to what every sandboxed command can’t read. @@ -118,12 +119,6 @@ "Read(./.env.*)", "Read(./secrets/**)" ] - }, - "env": { - "CLAUDE_CODE_ENABLE_TELEMETRY": "1", - "OTEL_METRICS_EXPORTER": "otlp", - "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc", - "OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.example.com:4317" }, "hooks": { "PreToolUse": [ @@ -186,13 +181,6 @@ "Read(./.env.*)", "Read(./secrets/**)" ] - }, - // Send OpenTelemetry metrics to the team's collector over gRPC; replace the endpoint with your collector's URL - "env": { - "CLAUDE_CODE_ENABLE_TELEMETRY": "1", - "OTEL_METRICS_EXPORTER": "otlp", - "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc", - "OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.example.com:4317" }, // Before every Bash command, run a script in the repo that can block it "hooks": {
modified All settings View current →
Show diff (461 lines)
--- a/settings-reference.md +++ b/settings-reference.md @@ -45,7 +45,7 @@ `axScreenReader`| Render [screen-reader friendly output](</docs/en/accessibility>)| Interface and terminal| Any file `bashEditDiffEnabled`| Record the [files that changed while a Bash command ran](</docs/en/hooks#bash>) in every permission mode| Interface and terminal| User or managed `bashOutputMaxChars`| Set how much of a successful command’s [output](</docs/en/tools-reference#output-limits>) Claude receives inline| Memory and context| Any file -`blockedMarketplaces`| Block [plugin marketplace](</docs/en/plugin-marketplaces>) sources for your organization| Plugins and skills| Managed +`blockedMarketplaces`| Block [plugin marketplace](</docs/en/plugins/overview>) sources for your organization| Plugins and skills| Managed `browserExternalPageTools`| Keep Claude’s tools off external pages in the [desktop](</docs/en/desktop>) Browser pane| Tools| Managed `channelsEnabled`| Allow [channels](</docs/en/channels#enable-channels-for-your-organization>) for your organization| Plugins and skills| Managed `claudeMd`| Inject organization-wide [CLAUDE.md](</docs/en/memory#deploy-organization-wide-claude-md>) instructions from managed settings| Memory and context| Managed @@ -66,13 +66,13 @@ `disableBrowserExternalNavigation`| Limit the [desktop](</docs/en/desktop>) Browser pane to localhost for people and Claude| Tools| Managed `disableBundledSkills`| Turn off the [skills](</docs/en/skills#bundled-skills>) and [workflows](</docs/en/workflows>) included with Claude Code| Plugins and skills| Any file `disableClaudeAiConnectors`| Turn off [claude.ai connectors](</docs/en/mcp#disable-claude-ai-connectors>) so Claude Code doesn’t fetch them| MCP| Any file -`disableCommandPluginSources`| Block [plugins](</docs/en/plugins>) that install by running a marketplace-declared command| Plugins and skills| Managed +`disableCommandPluginSources`| Block [plugins](</docs/en/plugins/overview>) that install by running a marketplace-declared command| Plugins and skills| Managed `disableDeepLinkRegistration`| Stop Claude Code from registering the [`claude-cli://` handler](</docs/en/deep-links>)| Remote, desktop, and notifications| Any file `disableDesktopLocalSessions`| Turn off [Desktop Code sessions](</docs/en/desktop#local-sessions-on-managed-devices>) that run on the device, leaving SSH to other hosts and cloud| Remote, desktop, and notifications| Managed `disabledMcpjsonServers`| Reject specific servers from a project’s [`.mcp.json`](</docs/en/mcp#project-scope>)| MCP| Any file `disableMobileSimulatorTools`| Block Claude’s tools in the [desktop](</docs/en/desktop>) iOS Simulator pane| Tools| Managed `disableRemoteControl`| Turn off [Remote Control](</docs/en/remote-control>) everywhere it can start| Remote, desktop, and notifications| Any file -`disableSideloadFlags`| Reject the CLI flags that sideload [plugins](</docs/en/plugins>), [subagents](</docs/en/sub-agents>), and [MCP servers](</docs/en/mcp>)| Enterprise and managed settings| Managed +`disableSideloadFlags`| Reject the CLI flags that sideload [plugins](</docs/en/plugins/overview>), [subagents](</docs/en/sub-agents>), and [MCP servers](</docs/en/mcp>)| Enterprise and managed settings| Managed `disableSkillShellExecution`| Stop [skills](</docs/en/skills>) and custom commands from running inline shell| Plugins and skills| Any file `disableWorkflows`| Turn [dynamic workflows](</docs/en/workflows>) off for everyone; use `enableWorkflows` for yourself| Hooks and automation| Any file `editorMode`| Use [vim key bindings](</docs/en/interactive-mode#vim-editor-mode>) in the input prompt| Interface and terminal| Any file @@ -81,12 +81,12 @@ `enableAllProjectMcpServers`| Approve every server in project [`.mcp.json`](</docs/en/mcp#project-server-approvals-and-workspace-trust>) files without a prompt| MCP| Any file `enableArtifact`| Turn the [Artifact tool](</docs/en/artifacts>) off with a `false` in any file; no file can turn it back on| Remote, desktop, and notifications| Any file `enabledMcpjsonServers`| Approve specific servers from a project’s [`.mcp.json`](</docs/en/mcp#project-server-approvals-and-workspace-trust>)| MCP| Any file -`enabledPlugins`| Turn individual [plugins](</docs/en/plugins>) on or off per scope| Plugins and skills| Any file +`enabledPlugins`| Turn individual [plugins](</docs/en/plugins/overview>) on or off per scope| Plugins and skills| Any file `enableWorkflows`| Turn [dynamic workflows](</docs/en/workflows>) on or off against your plan’s default| Hooks and automation| Any file `enforceAvailableModels`| Keep the [`/model` Default choice](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) inside your `availableModels` allowlist| Model and responses| Any file `env`| Set [environment variables](</docs/en/env-vars#in-settings-files>) for every session and its subprocesses| Memory and context| Any file `externalEditorContext`| Show Claude’s last response as comments when you press [Ctrl+G](</docs/en/interactive-mode#general-controls>) to edit| Global config settings| Global config -`extraKnownMarketplaces`| Register [marketplaces](</docs/en/plugin-marketplaces>) for a repository or an organization| Plugins and skills| Any file +`extraKnownMarketplaces`| Register [marketplaces](</docs/en/plugins/overview>) for a repository or an organization| Plugins and skills| Any file `fallbackModel`| Name [backup models](</docs/en/model-config#fallback-model-chains>) for when the primary is overloaded| Model and responses| Any file `fastMode`| Turn [fast mode](</docs/en/fast-mode>) on for sessions where it’s available| Model and responses| Any file `fastModePerSessionOptIn`| Require people to turn [fast mode](</docs/en/fast-mode>) on each session| Model and responses| Any file @@ -131,9 +131,9 @@ `permissions.deny`| Block listed [tool uses](</docs/en/permissions#permission-rule-syntax>), including reads of files that hold secrets| Permission settings| Any file `permissions.disableBypassPermissionsMode`| Prevent anyone from entering [bypassPermissions mode](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>)| Permission settings| Any file `plansDirectory`| Choose where [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) writes plan files| Memory and context| Any file -`pluginConfigs`| Store the answers you gave a [plugin](</docs/en/plugins>)’s configuration dialog| Plugins and skills| User or managed -`pluginSuggestionMarketplaces`| Choose which [marketplaces](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) can surface plugin install suggestions in `/plugin`| Plugins and skills| Managed -`pluginTrustMessage`| Add your own text to the [plugin](</docs/en/plugins>) trust warning| Plugins and skills| Managed +`pluginConfigs`| Store the answers you gave a [plugin](</docs/en/plugins/overview>)’s configuration dialog| Plugins and skills| User or managed +`pluginSuggestionMarketplaces`| Choose which [marketplaces](</docs/en/plugins/org#restrict-what-users-can-install>) can surface plugin install suggestions in `/plugin`| Plugins and skills| Managed +`pluginTrustMessage`| Add your own text to the [plugin](</docs/en/plugins/overview>) trust warning| Plugins and skills| Managed `policyHelper`| Run an executable that computes [managed settings](</docs/en/managed-settings#compute-the-policy-with-a-helper-program>) at startup| Enterprise and managed settings| Managed `policyHelper.path`| Name the [helper executable](</docs/en/managed-settings#compute-the-policy-with-a-helper-program>) Claude Code runs| Enterprise and managed settings| Managed `policyHelper.refreshIntervalMs`| Re-run the [helper](</docs/en/managed-settings#compute-the-policy-with-a-helper-program>) in the background on an interval| Enterprise and managed settings| Managed @@ -204,7 +204,7 @@ `sshConfigs`| Add [SSH connections](</docs/en/desktop#pre-configure-ssh-connections-for-your-team>) to the Desktop environment dropdown| Remote, desktop, and notifications| User or managed `sshHostAllowlist`| Limit which hosts [Desktop SSH sessions](</docs/en/desktop#restrict-which-ssh-hosts-users-can-connect-to>) can reach| Remote, desktop, and notifications| Managed `statusLine`| Run your own command to render a [status line](</docs/en/statusline>) below the prompt| Interface and terminal| Any file -`strictKnownMarketplaces`| Allowlist the [marketplace](</docs/en/plugin-marketplaces>) sources users can add and install from| Plugins and skills| Managed +`strictKnownMarketplaces`| Allowlist the [marketplace](</docs/en/plugins/overview>) sources users can add and install from| Plugins and skills| Managed `strictPluginOnlyCustomization`| Block [skills](</docs/en/skills>), [agents](</docs/en/sub-agents>), [hooks](</docs/en/hooks>), and [MCP servers](</docs/en/mcp>) from user and project sources| Plugins and skills| Managed `strictPluginOnlyCustomization.agents`| Lock [agents](</docs/en/sub-agents>) to plugin and managed sources| Plugins and skills| Managed `strictPluginOnlyCustomization.hooks`| Lock [hooks](</docs/en/hooks>) to plugin and managed sources| Plugins and skills| Managed @@ -213,7 +213,7 @@ `subagentPromptCacheTtl`| Choose the [prompt cache lifetime](</docs/en/prompt-caching#cache-lifetime>) for subagents and other requests outside the main conversation| Model and responses| Any file `subagentStatusLine`| Rewrite rows in the [subagent](</docs/en/sub-agents>) task display with your own command| Interface and terminal| Any file `switchModelsOnFlag`| Switch models automatically or pause when a [safety classifier](</docs/en/model-config#ask-before-switching>) flags a request| Model and responses| Any file -`syncClaudeAiPlugins`| Stop loading the [plugins enabled on your claude.ai account](</docs/en/plugins-reference#synced-plugins>) and stop downloading new ones| Plugins and skills| User, local, or managed +`syncClaudeAiPlugins`| Stop loading the [plugins enabled on your claude.ai account](</docs/en/plugins/loading#synced-plugins>) and stop downloading new ones| Plugins and skills| User, local, or managed `syncClaudeAiSkills`| Stop loading the [skills enabled on your claude.ai account](</docs/en/skills#how-synced-skills-behave>) and stop downloading new ones| Plugins and skills| User, local, or managed `syntaxHighlightingDisabled`| Turn off syntax highlighting in diffs and code blocks| Interface and terminal| Any file `taskOutputMaxChars`| Removed in v2.1.277, together with the `TaskOutput` tool it sized| Memory and context| Any file @@ -1727,7 +1727,7 @@ `sandbox.credentials` -Declare the credential files and environment variables to [protect from sandboxed commands](</docs/en/sandboxing#protect-credentials>). Each entry names a file `path` or a variable `name` and a `mode`: `deny` hides the credential inside the sandbox, and `mask` shows sandboxed commands a placeholder while the [sandbox proxy](</docs/en/sandboxing#mask-credentials>) substitutes the real value on outbound requests. Claude Code protects only the entries you list; there is no built-in credential deny list. Requires Claude Code v2.1.187 or later. +Declare the credential files and environment variables to [protect from sandboxed commands](</docs/en/sandboxing#protect-credentials>). Each entry names a file `path` or a variable `name` and a `mode`: `deny` hides the credential inside the sandbox, and `mask` shows sandboxed commands a placeholder while the [sandbox proxy](</docs/en/sandboxing#mask-credentials>) substitutes the real value on outbound requests. Claude Code protects only the entries you list; there is no built-in credential deny list. * **Scope** : `Any file`. Claude Code honors `mask` entries, `allowPlaintextInject`, `awsPairs`, and `sigv4` only from user settings, managed settings, and the `--settings` flag. * **Type** : object with `files`, `envVars`, `allowPlaintextInject`, `awsPairs`, and `sigv4` @@ -1746,7 +1746,7 @@ } } -The `deny` file protection is part of the filesystem layer, so it doesn’t apply when you [disable filesystem isolation](</docs/en/sandboxing#disable-filesystem-isolation>); the environment variable protection still does. Requires Claude Code v2.1.187 or later. +The `deny` file protection is part of the filesystem layer, so it doesn’t apply when you [disable filesystem isolation](</docs/en/sandboxing#disable-filesystem-isolation>); the environment variable protection still does. #### @@ -1768,7 +1768,7 @@ `sandbox.credentials.files` -Protect credential files or directories from sandboxed commands. With `"mode": "deny"`, Claude Code blocks reads of the path inside the sandbox, the same read block as `sandbox.filesystem.denyRead`. With `"mode": "mask"`, sandboxed commands on Linux and WSL2 read a sentinel copy of the file, and the sandbox proxy substitutes the real value on outbound requests to that entry’s `injectHosts`; on macOS the file is unreadable inside the sandbox instead. Requires Claude Code v2.1.187 or later, and `"mode": "mask"` requires v2.1.221 or later. +Protect credential files or directories from sandboxed commands. With `"mode": "deny"`, Claude Code blocks reads of the path inside the sandbox, the same read block as `sandbox.filesystem.denyRead`. With `"mode": "mask"`, sandboxed commands on Linux and WSL2 read a sentinel copy of the file, and the sandbox proxy substitutes the real value on outbound requests to that entry’s `injectHosts`; on macOS the file is unreadable inside the sandbox instead. `"mode": "mask"` requires Claude Code v2.1.221 or later. * **Scope** : `Any file`. Claude Code drops `mask` entries from project `.claude/settings.json` and local `.claude/settings.local.json`. * **Type** : array of objects, each with `path` and a `mode` of `"deny"` or `"mask"`, plus the optional mask fields for files @@ -1789,7 +1789,7 @@ } } -Paths use the same prefixes as the `sandbox.filesystem.*` settings, and Claude Code merges the arrays from every settings scope the session loads. [Protect credentials](</docs/en/sandboxing#protect-credentials>) covers what still applies from sources you exclude with `--setting-sources`. Requires Claude Code v2.1.187 or later; `mask` entries require v2.1.221 or later. `mask` substitution runs only through the sandbox proxy, so set `sandbox.network.tlsTerminate`, or `allowPlaintextInject` for plain-HTTP test networks. `mask` applies to a single file, so list each credential file individually. Claude Code accepts but ignores the `mask` fields on a `deny` entry. [Mask credential files](</docs/en/sandboxing#mask-credential-files>) covers which settings sources are honored and when an entry falls back to `deny`. +Paths use the same prefixes as the `sandbox.filesystem.*` settings, and Claude Code merges the arrays from every settings scope the session loads. [Protect credentials](</docs/en/sandboxing#protect-credentials>) covers what still applies from sources you exclude with `--setting-sources`. `mask` entries require Claude Code v2.1.221 or later. `mask` substitution runs only through the sandbox proxy, so set `sandbox.network.tlsTerminate`, or `allowPlaintextInject` for plain-HTTP test networks. `mask` applies to a single file, so list each credential file individually. Claude Code accepts but ignores the `mask` fields on a `deny` entry. [Mask credential files](</docs/en/sandboxing#mask-credential-files>) covers which settings sources are honored and when an entry falls back to `deny`. #### @@ -1835,7 +1835,7 @@ `sandbox.credentials.envVars` -Protect environment variables from sandboxed commands. With `"mode": "deny"`, Claude Code removes the variable from the environment of sandboxed commands. With `"mode": "mask"`, sandboxed commands see a per-session sentinel value, and the sandbox proxy substitutes the real value on outbound requests to that entry’s `injectHosts`, so tools such as `gh` and `npm` keep authenticating without ever holding the real credential. Requires Claude Code v2.1.187 or later, and `"mode": "mask"` requires v2.1.199 or later. +Protect environment variables from sandboxed commands. With `"mode": "deny"`, Claude Code removes the variable from the environment of sandboxed commands. With `"mode": "mask"`, sandboxed commands see a per-session sentinel value, and the sandbox proxy substitutes the real value on outbound requests to that entry’s `injectHosts`, so tools such as `gh` and `npm` keep authenticating without ever holding the real credential. `"mode": "mask"` requires Claude Code v2.1.199 or later. * **Scope** : `Any file`. Claude Code drops `mask` entries from project `.claude/settings.json` and local `.claude/settings.local.json`. * **Type** : array of objects, each with `name` and a `mode` of `"deny"` or `"mask"`, plus the optional mask fields for environment variables @@ -1856,7 +1856,7 @@ } } -The `name` must start with a letter or underscore and contain only letters, digits, and underscores. Claude Code merges the arrays from every settings scope the session loads, and applies `deny` when the same variable appears with both modes. [Protect credentials](</docs/en/sandboxing#protect-credentials>) covers what still applies from sources you exclude with `--setting-sources`. Requires Claude Code v2.1.187 or later; `mask` entries require v2.1.199 or later. `mask` substitution runs only through the sandbox proxy, so set `sandbox.network.tlsTerminate`, or `allowPlaintextInject` for plain-HTTP test networks; see [Mask environment variables](</docs/en/sandboxing#mask-environment-variables>). Claude Code accepts but ignores the `mask` fields on a `deny` entry. +The `name` must start with a letter or underscore and contain only letters, digits, and underscores. Claude Code merges the arrays from every settings scope the session loads, and applies `deny` when the same variable appears with both modes. [Protect credentials](</docs/en/sandboxing#protect-credentials>) covers what still applies from sources you exclude with `--setting-sources`. `mask` entries require Claude Code v2.1.199 or later. `mask` substitution runs only through the sandbox proxy, so set `sandbox.network.tlsTerminate`, or `allowPlaintextInject` for plain-HTTP test networks; see [Mask environment variables](</docs/en/sandboxing#mask-environment-variables>). Claude Code accepts but ignores the `mask` fields on a `deny` entry. #### @@ -2451,7 +2451,7 @@ `env` -Set environment variables for every session and for the subprocesses Claude Code starts from it. Any variable in the [environment variables reference](</docs/en/env-vars>) can go here, which is how you apply one to every session or roll it out to your team. +Set environment variables for every session and for the subprocesses Claude Code starts from it. Most variables in the [environment variables reference](</docs/en/env-vars>) can go here, which is how you apply one to every session or roll it out to your team. Project and local settings can’t set some of them. * **Scope** : `Any file` * **Type** : object mapping variable names to string values @@ -2474,7 +2474,7 @@ How `env` values interact with your shell - * A value here overwrites the same variable exported in your shell, and when more than one settings file sets a variable, the [highest-precedence](</docs/en/settings#settings-precedence>) one applies. + * A value here overwrites the same variable exported in your shell, and when more than one settings file sets a variable, the [highest-precedence](</docs/en/settings#settings-precedence>) one applies. Variables Claude Code ignores in `env` lists the exceptions for project and local settings. * To cancel a shell export, set the variable to `""`. Claude Code treats an empty value as unset for provider selection, and subprocesses inherit the empty value. * `NO_COLOR` and `FORCE_COLOR` set here reach only subprocesses. To change Claude Code’s own interface colors, set them in your shell before launching `claude`. * Values here are plain text in the settings file and reach every subprocess Claude Code starts. For an OTLP bearer token that rotates, use `otelHeadersHelper`; for API credentials, use `apiKeyHelper`. @@ -2487,7 +2487,7 @@ * From user settings, `--settings`, and managed settings: at startup, and again in the running session when a saved change alters the merged `env`. * From project and local settings: after you trust the workspace, or at startup in `-p` mode, which never shows the trust dialog, and again when a saved change alters the merged `env`. - * Variables Claude Code classifies as safe, such as model selection, timeouts and limits, feature toggles, and telemetry settings: at startup from every settings file, apart from the variables project and local settings can’t set. + * Variables Claude Code classifies as safe, such as model selection, timeouts and limits, and feature toggles: at startup from every settings file, apart from the variables project and local settings can’t set. * After you [move the session with `/cd`](</docs/en/permissions#move-the-session-to-another-directory>) on v2.1.246 or later: the new directory’s project and local `env` values, on top of the previous directory’s. #### @@ -2496,11 +2496,18 @@ Variables Claude Code ignores in `env` - * Project and local settings can’t set variables that a checked-out repository shouldn’t control; set those in your shell, user settings, or managed settings instead. Claude Code drops each one and logs a warning you can see with `claude --debug`. They include: + * Project and local settings can’t set variables that a checked-out repository shouldn’t control; set those in your shell, user settings, or managed settings instead. Claude Code drops each one, apart from a few values that turn telemetry off, and logs a warning you can see with `claude --debug`. They include: * Variables that choose where Claude Code stores or writes its own files: `CLAUDE_CONFIG_DIR`, `CLAUDE_CODE_TMPDIR`, and the operating-system directory variables such as `HOME`, `TMPDIR`, `TMP`, `TEMP`, and the `XDG_*` family. * Variables that export session content: [`OTEL_LOG_RAW_API_BODIES`](</docs/en/env-vars#variables>) and the detailed beta tracing pair `ENABLE_BETA_TRACING_DETAILED` and `BETA_TRACING_ENDPOINT`. + * The [OpenTelemetry exporter](</docs/en/monitoring-usage>) variables that turn telemetry on, choose where it goes, or choose what content it captures: + * `CLAUDE_CODE_ENABLE_TELEMETRY`, plus the enhanced telemetry beta pair `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA` and `ENABLE_ENHANCED_TELEMETRY_BETA` + * The exporter selectors `OTEL_LOGS_EXPORTER`, `OTEL_METRICS_EXPORTER`, and `OTEL_TRACES_EXPORTER` + * The content variables `OTEL_LOG_USER_PROMPTS`, `OTEL_LOG_ASSISTANT_RESPONSES`, `OTEL_LOG_TOOL_CONTENT`, and `OTEL_LOG_TOOL_DETAILS` + * `OTEL_EXPORTER_OTLP_*` variables whose names end in `_ENDPOINT`, `_HEADERS`, `_PROTOCOL`, `_CERTIFICATE`, `_CLIENT_KEY`, or `_INSECURE`, in the generic and per-signal forms, such as `OTEL_EXPORTER_OTLP_ENDPOINT` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` + * `OTEL_EXPORTER_PROMETHEUS_HOST` and `OTEL_EXPORTER_PROMETHEUS_PORT` +Only these values still apply from project and local settings, because they turn something off: `none` for the three exporter selectors, and an off value such as `0` for `OTEL_LOG_USER_PROMPTS`, `OTEL_LOG_TOOL_CONTENT`, and `OTEL_LOG_TOOL_DETAILS`. Such a value overrides the same variable in your user settings, but not one that the environment you start Claude Code from, a `--settings` file, or managed settings sets. When a project or local settings file sets a variable in this group, a local interactive session shows a notice at startup. Run `/status` or `claude doctor` to see which ones Claude Code ignored and which turned telemetry off; both list names, never values. A non-interactive run with `-p` or an Agent SDK session shows no notice, so check that your collector still receives data after you upgrade. If it doesn’t, set the variables in your user settings, managed settings, the job’s environment, or a file you pass with `--settings`. Ignoring this group in project and local settings requires Claude Code v2.1.282 or later. * Variables that change how Claude Code starts or syncs, such as `CLAUDE_CODE_PROCESS_WRAPPER`, `CLAUDE_CODE_SYNC_SKILLS`, `CLAUDE_CODE_SYNC_PLUGINS`, `CLAUDE_CODE_PLUGIN_CACHE_DIR`, and `CLAUDE_CODE_PLUGIN_SEED_DIR`. -Before v2.1.251, project and local settings could set every variable this list names except `HOME`, `XDG_CONFIG_HOME`, and the variables that change how Claude Code starts or syncs. +Before v2.1.251, project and local settings could also set the variables in this list that choose where Claude Code writes its files or that export session content, except `HOME` and `XDG_CONFIG_HOME`. * Identity variables that Claude Code’s hosting environments own, such as `CLAUDE_CODE_REMOTE` and `CLAUDE_CODE_ACCOUNT_UUID`, are ignored from every file. * [`CLAUDE_CODE_MESSAGING_SOCKET` and `CLAUDE_CODE_MESSAGING_TOKEN`](</docs/en/env-vars#variables>), which Claude Code exports itself, are ignored from every file. Ignoring the socket variable requires Claude Code v2.1.224 or later, and ignoring the token requires v2.1.228 or later. * [`CLAUDE_CODE_PROJECT_DIR_NAME`](</docs/en/sessions#name-the-project-directory-yourself>), which Claude Code reads from the launch environment only, is ignored from every file; requires v2.1.234 or later. @@ -2993,7 +3000,7 @@ `respondToBashCommands` -Choose whether Claude responds after you run a shell command with the [`!` prefix](</docs/en/interactive-mode#shell-mode-with-prefix>) in the input box. By default, Claude Code adds the command’s output to the conversation and Claude replies to it. Set this key to `false` to add the output to context without a reply, so you can run several commands and ask about them together. Requires Claude Code v2.1.186 or later. +Choose whether Claude responds after you run a shell command with the [`!` prefix](</docs/en/interactive-mode#shell-mode-with-prefix>) in the input box. By default, Claude Code adds the command’s output to the conversation and Claude replies to it. Set this key to `false` to add the output to context without a reply, so you can run several commands and ask about them together. * **Scope** : `Any file` * **Type** : Boolean @@ -3007,7 +3014,7 @@ "respondToBashCommands": false } -See [Shell mode with `!` prefix](</docs/en/interactive-mode#shell-mode-with-prefix>). Requires Claude Code v2.1.186 or later. +See [Shell mode with `!` prefix](</docs/en/interactive-mode#shell-mode-with-prefix>). ### @@ -3544,10 +3551,10 @@ Customize the attribution Claude Code adds to git commits and pull requests. Commits get a [git trailer](<https://git-scm.com/docs/git-interpret-trailers>) such as `Co-Authored-By` by default; pull request descriptions get plain text. Set each part separately with the sub-keys below. * **Scope** : `Any file` - * **Type** : object with `commit` and `pr` strings and a `sessionUrl` Boolean + * **Type** : object with `commit` and `pr` strings and a `sessionUrl` Boolean, or `false` to hide all attribution. The `false` value requires Claude Code v2.1.281 or later; earlier versions reject it and [skip the whole user, project, or local settings file](</docs/en/settings#fix-a-broken-settings-file>) that holds it * **Default** : unset, so Claude Code uses the standard attribution shown under each sub-key -This example replaces the commit attribution, removes pull request attribution, and drops the session link: +To hide all attribution, set `attribution` to `false`. In a settings file that earlier versions also read, set `commit` and `pr` to empty strings and `sessionUrl` to `false` instead. This example replaces the commit attribution, removes pull request attribution, and drops the session link: settings.json @@ -3559,7 +3566,7 @@ } } -To hide all attribution, set `commit` and `pr` to empty strings and `sessionUrl` to `false`. Once you set `commit` or `pr`, Claude Code ignores the deprecated `includeCoAuthoredBy` setting and uses its default text for whichever of the two you left unset. Claude Code tells Claude that your own instructions about attribution, such as a CLAUDE.md or [memory](</docs/en/memory>) rule, take precedence over these commit and PR lines, unless the line is set in [managed settings](</docs/en/managed-settings>). +Once you set `commit` or `pr`, Claude Code ignores the deprecated `includeCoAuthoredBy` setting and uses its default text for whichever of the two you left unset. Claude Code tells Claude that your own instructions about attribution, such as a CLAUDE.md or [memory](</docs/en/memory>) rule, take precedence over these commit and PR lines, unless the line is set in [managed settings](</docs/en/managed-settings>). ### @@ -3583,7 +3590,7 @@ "includeCoAuthoredBy": false } -To hide all attribution today, set `attribution.commit` and `attribution.pr` to empty strings and `attribution.sessionUrl` to `false`. +To hide all attribution, see `attribution`. ### @@ -3753,8 +3760,8 @@ * **Managed and SDK hooks run** : hooks from managed settings and hooks the [Agent SDK](</docs/en/agent-sdk/overview>) registers in process * **Force-enabled plugin hooks run** : hooks from plugins your managed settings force-enable through `enabledPlugins`. Claude Code matches on the full `plugin@marketplace` ID, so a plugin with the same name from a different marketplace stays blocked. This lets you distribute vetted hooks through an organization marketplace while blocking everything else * **Everything else is blocked** : user, project, and local hooks, hooks from other plugins, and hooks declared in agent frontmatter - * **Command-sourced plugins are disabled** : Claude Code also disables plugins with a [`command` source](</docs/en/plugin-marketplaces#command-sources>), including plugins force-enabled in managed `enabledPlugins`, unless you set `disableCommandPluginSources` to `false` explicitly - * **Marketplace`headersHelper` commands are blocked**: Claude Code also blocks marketplace [`headersHelper` commands](</docs/en/plugin-marketplaces#authenticate-archive-downloads>) unless `disableCommandPluginSources` is explicitly set to `false`, except for a marketplace that managed settings themselves declare. Requires Claude Code v2.1.238 or later + * **Command-sourced plugins are disabled** : Claude Code also disables plugins with a [`command` source](</docs/en/plugins/marketplace-reference#command-plugin-source>), including plugins force-enabled in managed `enabledPlugins`, unless you set `disableCommandPluginSources` to `false` explicitly + * **Marketplace`headersHelper` commands are blocked**: Claude Code also blocks marketplace [`headersHelper` commands](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>) unless `disableCommandPluginSources` is explicitly set to `false`, except for a marketplace that managed settings themselves declare. Requires Claude Code v2.1.238 or later * **Status line and file suggestion narrow to managed settings** : Claude Code reads [`statusLine`](</docs/en/statusline>), `fileSuggestion`, and [`subagentStatusLine`](</docs/en/statusline#subagent-status-lines>) from managed settings only, following the status line and file suggestion gates The [`/goal`](</docs/en/goal>) command can’t run while this key is set, because it depends on hooks. @@ -3948,7 +3955,7 @@ Plugins and skills -Enable plugins, register marketplaces, restrict which plugin sources an organization allows, and control which skills load. For installing and building plugins, see [Plugins](</docs/en/plugins>). +Enable plugins, register marketplaces, restrict which plugin sources an organization allows, and control which skills load. For installing and building plugins, see [Plugins](</docs/en/plugins/overview>). ### @@ -4052,7 +4059,7 @@ `syncClaudeAiPlugins` -Turn off the download of the [plugins enabled for your claude.ai account](</docs/en/plugins-reference#synced-plugins>). Claude Code downloads them into `~/.claude/plugins/synced/` at the start of terminal sessions where you sign in with your claude.ai account, and in Cowork and cloud sessions, and loads each one as `<name>@synced`. Set `false` to stop that download and stop loading the plugins it already synced. Claude Code honors only `false`: `true` is the same as unset and doesn’t turn syncing on where it’s otherwise off. Requires Claude Code v2.1.273 or later. +Turn off the download of the [plugins enabled for your claude.ai account](</docs/en/plugins/loading#synced-plugins>). Claude Code downloads them into `~/.claude/plugins/synced/` at the start of terminal sessions where you sign in with your claude.ai account and in Cowork sessions, and loads each one as `<name>@synced`. Set `false` to stop that download and stop loading the plugins it already synced. Claude Code honors only `false`: `true` is the same as unset and doesn’t turn syncing on where it’s otherwise off. Requires Claude Code v2.1.273 or later. * **Scope** : `User, local, or managed`, and files passed with `--settings`. A repository can’t turn it off for you. * **Type** : Boolean @@ -4099,7 +4106,7 @@ `blockedMarketplaces` -Block plugin marketplace sources for your organization. Claude Code checks the blocklist on marketplace add and on plugin install, update, refresh, and auto-update, so a marketplace someone added before you set the policy can’t be used to fetch plugins either. Blocked sources are checked before download, so they never touch the filesystem. +Block plugin marketplace sources for your organization. Claude Code checks the blocklist on marketplace add and on plugin install, update, refresh, and auto-update, so a marketplace someone added before you set the policy can’t be used to fetch plugins either. Blocked sources are checked before download, so they never touch the filesystem. If you set this key in the [claude.ai admin console](</docs/en/server-managed-settings>), claude.ai also applies it when anyone in your organization adds a marketplace from a git repository on claude.ai, as [How restrictions work](</docs/en/plugins/org#restrict-what-users-can-install>) describes. * **Scope** : `Managed` * **Type** : array of marketplace source objects, in the same forms as `strictKnownMarketplaces` @@ -4115,7 +4122,7 @@ ] } -A `github` entry may use the owner-wildcard form `"owner/*"` to block every repository under that GitHub owner, which requires Claude Code v2.1.223 or later. Add `{ "source": "skills-dir" }` to stop Claude Code loading [`@skills-dir` plugins](</docs/en/plugins-reference#skills-directory-plugins>) from `~/.claude/skills/` without restricting any marketplace. See [Managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>). +A `github` entry may use the owner-wildcard form `"owner/*"` to block every repository under that GitHub owner, which requires Claude Code v2.1.223 or later. Add `{ "source": "skills-dir" }` to stop Claude Code loading [`@skills-dir` plugins](</docs/en/plugins/loading#plugins-shared-through-a-repository>) from `~/.claude/skills/` without restricting any marketplace. See [Managed marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>). ### @@ -4145,7 +4152,7 @@ `disableCommandPluginSources` -Block the [`command` plugin source](</docs/en/plugin-marketplaces#command-sources>), which installs a plugin by running a marketplace-declared command on the user’s machine. When you set it to `true`, Claude Code never runs the command, doesn’t install or update command-sourced plugins, and stops loading the ones already installed. Set it to `false` to allow them explicitly. Whenever it blocks command sources, whether you set it to `true` or leave it unset under `allowManagedHooksOnly`, it also blocks marketplace [`headersHelper` commands](</docs/en/plugin-marketplaces#authenticate-archive-downloads>), except for a marketplace that managed settings themselves declare. Requires Claude Code v2.1.229 or later, and the `headersHelper` block requires v2.1.238 or later. +Block the [`command` plugin source](</docs/en/plugins/marketplace-reference#command-plugin-source>), which installs a plugin by running a marketplace-declared command on the user’s machine. When you set it to `true`, Claude Code never runs the command, doesn’t install or update command-sourced plugins, and stops loading the ones already installed. Set it to `false` to allow them explicitly. Whenever it blocks command sources, whether you set it to `true` or leave it unset under `allowManagedHooksOnly`, it also blocks marketplace [`headersHelper` commands](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>), except for a marketplace that managed settings themselves declare. Requires Claude Code v2.1.229 or later, and the `headersHelper` block requires v2.1.238 or later. * **Scope** : `Managed` * **Type** : Boolean @@ -4179,7 +4186,7 @@ "pluginSuggestionMarketplaces": ["acme-corp-plugins"] } -A name takes effect only when the marketplace is registered on the machine and its registered source is also declared in the same managed settings, either as the `extraKnownMarketplaces` entry for that name or as an entry of `strictKnownMarketplaces`. Claude Code ignores a marketplace registered from a different source under an allowlisted name. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source. See [Suggest plugins by context](</docs/en/plugin-relevance>). +A name takes effect only when the marketplace is registered on the machine and its registered source is also declared in the same managed settings, either as the `extraKnownMarketplaces` entry for that name or as an entry of `strictKnownMarketplaces`. Claude Code ignores a marketplace registered from a different source under an allowlisted name. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source. See [Suggest plugins by context](</docs/en/plugins/relevance>). ### @@ -4205,7 +4212,7 @@ `strictKnownMarketplaces` -Restrict which plugin marketplace sources people in your organization can add and install plugins from. Claude Code enforces the allowlist on marketplace add and on plugin install, update, refresh, and auto-update, before any network or filesystem operation, so a marketplace someone added before you set the policy can’t be used to fetch plugins once its source no longer matches. Blocked users see an error naming the managed policy. +Restrict which plugin marketplace sources people in your organization can add and install plugins from. Claude Code enforces the allowlist on marketplace add and on plugin install, update, refresh, and auto-update, before any network or filesystem operation, so a marketplace someone added before you set the policy can’t be used to fetch plugins once its source no longer matches. Blocked users see an error naming the managed policy. If you set this key in the [claude.ai admin console](</docs/en/server-managed-settings>), claude.ai also applies it when anyone in your organization adds a marketplace from a git repository on claude.ai, as [How restrictions work](</docs/en/plugins/org#restrict-what-users-can-install>) describes. * **Scope** : `Managed` * **Type** : array of marketplace source objects; see Allowed source types @@ -4223,7 +4230,7 @@ ] } -You can also write this key as `allowedMarketplaces`; Marketplace key aliases describes how Claude Code treats the alias and which version accepts it. This key is a policy gate: it controls what users may add but registers nothing. To restrict and pre-register in one file, see Combine with `extraKnownMarketplaces`. For the user-facing view, see [Managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>). +You can also write this key as `allowedMarketplaces`; Marketplace key aliases describes how Claude Code treats the alias and which version accepts it. This key is a policy gate: it controls what users may add but registers nothing. To restrict and pre-register in one file, see Combine with `extraKnownMarketplaces`. For the user-facing view, see [Managed marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>). #### @@ -4240,13 +4247,13 @@ `url`| `{ "source": "url", "url": "https://plugins.example.com/marketplace.json", "headers": { "Authorization": "Bearer ${TOKEN}" } }`| `url` required; `headers` adds HTTP headers for authenticated access `file`| `{ "source": "file", "path": "/opt/acme-corp/plugins/marketplace.json" }`| `path` required, the absolute path to a `marketplace.json` file `directory`| `{ "source": "directory", "path": "/opt/acme-corp/approved-marketplaces" }`| `path` required, the absolute path to a directory containing `.claude-plugin/marketplace.json` -`hostPattern`| `{ "source": "hostPattern", "hostPattern": "^github\\.example\\.com$" }`| `hostPattern` required, a regex matched against the marketplace host -`pathPattern`| `{ "source": "pathPattern", "pathPattern": "^/opt/approved/" }`| `pathPattern` required, a regex matched against the `path` of `file` and `directory` sources +`hostPattern`| `{ "source": "hostPattern", "hostPattern": "^github\\.example\\.com$" }`| `hostPattern` required, a regex matched anywhere in the marketplace host; anchor it with `^` and `$` to match the whole host +`pathPattern`| `{ "source": "pathPattern", "pathPattern": "^/opt/approved/" }`| `pathPattern` required, a regex matched anywhere in the `path` of `file` and `directory` sources; start it with `^` to pin a prefix `skills-dir`| `{ "source": "skills-dir" }`| No fields. Opts the `~/.claude/skills/` plugin scan back in Three source types carry rules beyond the table: - * **`url`** : a URL marketplace downloads only the `marketplace.json` file, and Claude Code doesn’t fetch plugin files by relative path from that server, so its plugins must use a [plugin source](</docs/en/plugin-marketplaces#plugin-sources>) other than a relative path, such as an archive URL, which can be on the same host. For plugins with relative paths, use a Git-based marketplace instead. See [Plugins with relative paths fail in URL-based marketplaces](</docs/en/plugin-marketplaces#plugins-with-relative-paths-fail-in-url-based-marketplaces>). + * **`url`** : a URL marketplace downloads only the `marketplace.json` file, and Claude Code doesn’t fetch plugin files by relative path from that server, so its plugins must use a [plugin source](</docs/en/plugins/marketplace-reference#plugin-sources>) other than a relative path, such as an archive URL, which can be on the same host. For plugins with relative paths, use a Git-based marketplace instead. See [Plugins with relative paths fail in URL-based marketplaces](</docs/en/plugins/troubleshooting#plugins-with-relative-paths-fail-in-url-based-marketplaces>). * **`hostPattern`** : use it to allow every marketplace on an internal GitHub Enterprise or GitLab server without listing each repository. Claude Code matches `github` sources against `github.com`, takes the hostname from `url` sources, and takes it from `git` sources depending on the [git URL](<https://git-scm.com/docs/git-clone#_git_urls>)’s form: * A URL with a scheme, such as `https://` or `ssh://`: the hostname in the URL. * An SSH address without a scheme, in git’s `user@host:path` form, such as `git@git.example.com:tools/plugins.git`: the host between `@` and `:`, which is the host git connects to. @@ -4254,7 +4261,7 @@ `file` and `directory` sources have no host and never match a `hostPattern` entry. * **`pathPattern`** : use it to allow filesystem marketplaces alongside `hostPattern` entries for network sources. `".*"` allows every local path; a narrower pattern such as `"^/opt/approved/"` restricts to a directory. -Any allowlist, even an empty one, also stops Claude Code loading [`@skills-dir` plugins](</docs/en/plugins-reference#skills-directory-plugins>) from `~/.claude/skills/`. Add the `{ "source": "skills-dir" }` entry to keep loading them; the entry has no meaning outside this key and `blockedMarketplaces`. +Any allowlist, even an empty one, also stops Claude Code loading [`@skills-dir` plugins](</docs/en/plugins/loading#plugins-shared-through-a-repository>) from `~/.claude/skills/`. Add the `{ "source": "skills-dir" }` entry to keep loading them; the entry has no meaning outside this key and `blockedMarketplaces`. #### @@ -4272,7 +4279,7 @@ ] } -Only the whole repository-name position can be a wildcard. Claude Code compares entries such as `*`, `*/plugins`, or `acme-corp/tools-*` literally, so they match no repository. The matching rules differ between the two settings: +Only the whole repository-name position can be a wildcard. Claude Code ignores entries such as `*`, `*/plugins`, or `acme-corp/tools-*` as invalid, so they match no repository. The matching rules differ between the two settings: Rule| `strictKnownMarketplaces`| `blockedMarketplaces` ---|---|--- @@ -4314,10 +4321,11 @@ ] } -With this entry, Claude Code keeps an already-registered official marketplace available and, on a fresh machine, registers the marketplace automatically the first time you start Claude Code interactively. Automatic registration most commonly misses: - - * Non-interactive environments that run before the machine’s first interactive launch. - * Machines where Claude Code already ran interactively under a policy that blocked the marketplace, such as the empty-array lockdown. Claude Code records the blocked attempt and doesn’t retry after the policy changes. +With this entry, Claude Code keeps an already-registered official marketplace available and, on a fresh machine, registers the marketplace automatically the first time you start an interactive terminal session. Automatic registration most commonly misses: + + * Non-interactive environments that run before the machine’s first interactive terminal session. + * Machines where Claude Code has only run through the VS Code extension. + * Machines where Claude Code already ran an interactive terminal session under a policy that blocked the marketplace, such as the empty-array lockdown. Claude Code records the blocked attempt and doesn’t retry after the policy changes. On these machines, add the marketplace to `extraKnownMarketplaces` in the same `managed-settings.json` so Claude Code registers it automatically, or run `claude plugin marketplace add anthropics/claude-plugins-official`. @@ -4455,7 +4463,7 @@ `enabledPlugins` -Turn individual [plugins](</docs/en/plugins>) on or off, keyed by `plugin-name@marketplace-name`. A plugin with no entry at any scope falls back to its [`defaultEnabled`](</docs/en/plugins-reference#default-enablement>) value. When you enable or disable a plugin with `/plugin` or `claude plugin enable`, Claude Code writes this key for you. +Turn individual [plugins](</docs/en/plugins/overview>) on or off, keyed by `plugin-name@marketplace-name`. A plugin with no entry at any scope falls back to its [`defaultEnabled`](</docs/en/plugins/manifest-reference#fields>) value. When you enable or disable a plugin with `/plugin` or `claude plugin enable`, Claude Code writes this key for you. * **Scope** : `Any file` * **Type** : object mapping `plugin-name@marketplace-name` to a Boolean @@ -4480,7 +4488,7 @@ * **Local settings** : per-machine overrides, gitignored when Claude Code saves a setting there * **Managed settings** : organization-wide policy. A plugin set to `false` here is blocked from installation at every scope and hidden from the marketplace -Project settings take precedence over user settings, so setting a plugin to `false` in `~/.claude/settings.json` doesn’t disable a plugin that the project’s `.claude/settings.json` enables. To opt out of a project-enabled plugin on your machine, set it to `false` in `.claude/settings.local.json` instead. Plugins force-enabled by managed settings can’t be disabled this way, since managed settings override local settings. Enabling a plugin from an external source such as a GitHub repository or npm package in a project’s `.claude/settings.json` doesn’t install it for other people. On every path that loads plugins, Claude Code reports the plugin as not installed until each user [installs it themselves](</docs/en/discover-plugins#configure-team-marketplaces>). +Project settings take precedence over user settings, so setting a plugin to `false` in `~/.claude/settings.json` doesn’t disable a plugin that the project’s `.claude/settings.json` enables. To opt out of a project-enabled plugin on your machine, set it to `false` in `.claude/settings.local.json` instead. Plugins force-enabled by managed settings can’t be disabled this way, since managed settings override local settings. Enabling a plugin from an external source such as a GitHub repository or npm package in a project’s `.claude/settings.json` doesn’t install it for other people. On every path that loads plugins, Claude Code reports the plugin as not installed until each user [installs it themselves](</docs/en/plugins/org#require-plugins-per-repository>). ### @@ -4515,7 +4523,7 @@ } } -[What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) compares the trust gate with the other content a repository can supply. You can also write this key as `additionalMarketplaces`; see Marketplace key aliases. Set `"autoUpdate": true` alongside `source` to make Claude Code refresh that marketplace and update its installed plugins in the background after startup. When omitted, `claude-plugins-official` and most other official Anthropic marketplaces default to `true`, and third-party marketplaces default to `false`. See [Configure auto-updates](</docs/en/discover-plugins#configure-auto-updates>). When more than one settings file defines a marketplace entry under the same name, Claude Code uses the entry from the [highest-precedence file](</docs/en/settings#settings-precedence>) whole. That entry replaces the lower-precedence entry and inherits none of its fields, so a redefinition can’t combine one file’s `source.headers` credential with a URL another file controls. Before v2.1.228, Claude Code merged same-name entries field by field, so an entry in a higher-precedence file could inherit fields it didn’t set, including another file’s `headers`. +[What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) compares the trust gate with the other content a repository can supply. You can also write this key as `additionalMarketplaces`; see Marketplace key aliases. Set `"autoUpdate": true` alongside `source` to make Claude Code refresh that marketplace and update its installed plugins in the background after startup. When omitted, `claude-plugins-official` and most other official Anthropic marketplaces default to `true`, and third-party marketplaces default to `false`. See [Configure auto-updates](</docs/en/plugins/install#keep-plugins-updated>). When more than one settings file defines a marketplace entry under the same name, Claude Code uses the entry from the [highest-precedence file](</docs/en/settings#settings-precedence>) whole. That entry replaces the lower-precedence entry and inherits none of its fields, so a redefinition can’t combine one file’s `source.headers` credential with a URL another file controls. Before v2.1.228, Claude Code merged same-name entries field by field, so an entry in a higher-precedence file could inherit fields it didn’t set, including another file’s `headers`. #### @@ -4532,12 +4540,12 @@ * **`directory`** : a local filesystem path, with `path`, for development only * **`settings`** : an inline marketplace declared directly in the settings file without a hosted repository, with `name` and `plugins` -The `git` source type works with any git hosting service, including self-hosted GitLab and Bitbucket. Claude Code clones the repository with the same authentication that `git clone` would use on that machine: configured credential helpers or SSH keys. A provider token such as `GITHUB_TOKEN` takes effect only through a credential helper that reads it. See [Private repositories](</docs/en/plugin-marketplaces#private-repositories>) for setup details. For `github` and `git` sources, Claude Code never downloads [Git LFS](<https://git-lfs.com>) content when it clones the marketplace repository to add or update it. LFS-tracked files are checked out as pointer files, and the add or update output reports how many. The `skipLfs` field inside the `source` object is accepted and has no effect. Before v2.1.274, Claude Code downloaded LFS content unless you set `"skipLfs": true`. For a `url` source, set `headersHelper` inside the `source` object when the credential in `headers` expires and a command has to produce a fresh one. Requires Claude Code v2.1.238 or later. For what the command must print and where Claude Code runs it, see [Write the headersHelper command](</docs/en/plugin-marketplaces#write-the-headershelper-command>), and for the cases where Claude Code doesn’t run it, see [When Claude Code skips a headersHelper command](</docs/en/plugin-marketplaces#when-claude-code-skips-a-headershelper-command-or-drops-its-output>). Once you set `headersHelper` on an `https://` marketplace URL, Claude Code runs the command at two points, reusing one run’s output for up to 60 seconds: +The `git` source type works with any git hosting service, including self-hosted GitLab and Bitbucket. Claude Code clones the repository with the same authentication that `git clone` would use on that machine: configured credential helpers or SSH keys. A provider token such as `GITHUB_TOKEN` takes effect through a credential helper that reads it. See [Private repositories](</docs/en/plugins/host-marketplace#grant-access-to-a-private-marketplace>) for setup details. For `github` and `git` sources, Claude Code never downloads [Git LFS](<https://git-lfs.com>) content when it clones the marketplace repository to add or update it. LFS-tracked files are checked out as pointer files, and the add or update output reports how many. The `skipLfs` field inside the `source` object is accepted and has no effect. Before v2.1.274, Claude Code downloaded LFS content unless you set `"skipLfs": true`. For a `url` source, set `headersHelper` inside the `source` object when the credential in `headers` expires and a command has to produce a fresh one. Requires Claude Code v2.1.238 or later. For what the command must print and where Claude Code runs it, see [Write the headersHelper command](</docs/en/plugins/host-marketplace#write-the-headershelper-command>), and for the cases where Claude Code doesn’t run it, see [When Claude Code skips a headersHelper command](</docs/en/plugins/host-marketplace#when-claude-code-skips-a-headershelper-command-or-drops-its-output>). Once you set `headersHelper` on an `https://` marketplace URL, Claude Code runs the command at two points, reusing one run’s output for up to 60 seconds: * Before each fetch of that marketplace’s `marketplace.json`, including a later refresh. Claude Code sends the printed headers with that fetch. * Before each plugin archive download on the marketplace URL’s origin, meaning the same scheme, host, and port. Claude Code sends the output with that download, and no other download gets the headers. -Claude Code ignores any `headersHelper` set in the `.claude/settings.json` or `.claude/settings.local.json` of a directory you add with [`--add-dir`](</docs/en/permissions#what-runs-before-you-trust-a-folder>), on a `url` source and on an inline plugin entry alike, and sends only the fixed `headers` set in that file. [How users accept a headersHelper command](</docs/en/plugin-marketplaces#how-users-accept-a-headershelper-command>) covers the other settings files. Plugins listed in a `settings` source must reference external sources such as GitHub or npm, and the `name` must match the marketplace key. You still enable each plugin separately in `enabledPlugins`. This example declares one plugin inline: +Claude Code ignores any `headersHelper` set in the `.claude/settings.json` or `.claude/settings.local.json` of a directory you add with [`--add-dir`](</docs/en/permissions#what-runs-before-you-trust-a-folder>), on a `url` source and on an inline plugin entry alike, and sends only the fixed `headers` set in that file. [How users accept a headersHelper command](</docs/en/plugins/host-marketplace#how-users-accept-a-headershelper-command>) covers the other settings files. Plugins listed in a `settings` source must reference external sources such as GitHub or npm, and the `name` must match the marketplace key. You still enable each plugin separately in `enabledPlugins`. This example declares one plugin inline: settings.json @@ -4561,11 +4569,11 @@ } } -A plugin entry under `source: 'settings'` whose own `source` is an [`archive`](</docs/en/plugin-marketplaces#zip-archives>) can set `headers` for the archive download. If the value you would put in `headers` is short-lived, such as a token your registry mints on request, set a `headersHelper` command instead. An entry may set both. Both fields require Claude Code v2.1.238 or later. Claude Code sends the entry’s `headers`, and whatever the command prints, with that plugin’s archive download and with no other download. Claude Code runs the command only when a user [installs or updates that one plugin by itself](</docs/en/plugin-marketplaces#how-users-accept-a-headershelper-command>). Three further rules depend on which file holds the entry: - - * **`strict`** : unlike an entry in a marketplace’s `marketplace.json`, an entry in settings doesn’t need `"strict": false`, because a settings file carries no manifest fields to inline. See [Strict mode](</docs/en/plugin-marketplaces#strict-mode>). +A plugin entry under `source: 'settings'` whose own `source` is an [`archive`](</docs/en/plugins/marketplace-reference#archive-plugin-source>) can set `headers` for the archive download. If the value you would put in `headers` is short-lived, such as a token your registry mints on request, set a `headersHelper` command instead. An entry may set both. Both fields require Claude Code v2.1.238 or later. Claude Code sends the entry’s `headers`, and whatever the command prints, with that plugin’s archive download and with no other download. Claude Code runs the command only when a user [installs or updates that one plugin by itself](</docs/en/plugins/host-marketplace#how-users-accept-a-headershelper-command>). Three further rules depend on which file holds the entry: + + * **`strict`** : unlike an entry in a marketplace’s `marketplace.json`, an entry in settings doesn’t need `"strict": false`, because a settings file carries no manifest fields to inline. See [Strict mode](</docs/en/plugins/marketplace-reference#strict-mode>). * **Folder trust** : for an entry in a project’s `.claude/settings.json` or `.claude/settings.local.json`, Claude Code runs the command only after the user has also [trusted that folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>). - * **Header filter** : Claude Code drops [request-routing and client-identity header names](</docs/en/plugin-marketplaces#when-claude-code-skips-a-headershelper-command-or-drops-its-output>) from an entry in a project’s `.claude/settings.json` or `.claude/settings.local.json`, because a repository can supply those files. Claude Code applies the same filter to a catalog entry and to an entry in an `--add-dir` directory’s settings, and no filter to an entry in your user settings, a `--settings` file, or managed settings. + * **Header filter** : Claude Code drops [request-routing and client-identity header names](</docs/en/plugins/host-marketplace#when-claude-code-skips-a-headershelper-command-or-drops-its-output>) from an entry in a project’s `.claude/settings.json` or `.claude/settings.local.json`, because a repository can supply those files. Claude Code applies the same filter to a catalog entry and to an entry in an `--add-dir` directory’s settings, and no filter to an entry in your user settings, a `--settings` file, or managed settings. #### @@ -4586,7 +4594,7 @@ `pluginConfigs` -Store the non-sensitive answers you give a plugin’s [`userConfig`](</docs/en/plugins-reference#user-configuration>) configuration dialog, keyed by plugin ID. Claude Code writes this key to your user settings when you fill in the dialog, so you don’t need to edit it by hand. Claude Code stores sensitive options in the macOS Keychain instead, falling back to `~/.claude/.credentials.json` when the Keychain rejects the write; on platforms without a supported keychain, it stores them in `~/.claude/.credentials.json`. +Store the non-sensitive answers you give a plugin’s [`userConfig`](</docs/en/plugins/manifest-reference#user-configuration>) configuration dialog, keyed by plugin ID. Claude Code writes this key to your user settings when you fill in the dialog, so you don’t need to edit it by hand. Claude Code stores sensitive options in the macOS Keychain instead, falling back to `~/.claude/.credentials.json` when the Keychain rejects the write; on platforms without a supported keychain, it stores them in `~/.claude/.credentials.json`. * **Scope** : `User or managed` * **Type** : object mapping a plugin ID to an object with an `options` field, mapping each option name to a string, number, Boolean, or array of strings, and an optional `mcpServers` field holding per-server user configuration values in the same shape @@ -4852,7 +4860,7 @@ "agent": "code-reviewer" } -A plugin’s own `settings.json` can also supply this key; see [Ship default settings with your plugin](</docs/en/plugins#ship-default-settings-with-your-plugin>). +A plugin’s own `settings.json` can also supply this key; see [Ship default settings with your plugin](</docs/en/plugins/components#default-settings>). ### @@ -4954,7 +4962,7 @@ * `"in-process"`: teammates run inside your main terminal pane * `"auto"`: split panes when you’re running inside tmux, or inside iTerm2 with `it2` on your `PATH` or tmux installed; in-process otherwise * `"tmux"`: split panes using tmux or iTerm2, detected from your terminal - * `"iterm2"`: iTerm2 native split panes through the `it2` CLI, in Claude Code v2.1.186 or later + * `"iterm2"`: iTerm2 native split panes through the `it2` CLI * **Default** : `"in-process"` * **Per-session overrides** : `--teammate-mode` takes precedence over this key for one session @@ -4963,8 +4971,6 @@ { "teammateMode": "auto" } - -The `iterm2` value requires Claude Code v2.1.186 or later. ### @@ -5891,7 +5897,7 @@ "disableSideloadFlags": true } -Claude Code still accepts a `--mcp-config` whose servers are all in-process `type: "sdk"` entries, so the Agent SDK and VS Code extension keep working. Users can still add servers with `claude mcp add` or a `.mcp.json` file; for per-server control, set [`allowedMcpServers`](</docs/en/managed-mcp>) as well. Requires Claude Code v2.1.193 or later. In cloud sessions, Claude Code also ignores server-delivered mid-session MCP updates, the path behind cloud session configuration and SDK `setMcpServers()` calls that reach those sessions. In-process `type: "sdk"` entries stay exempt there too. Before v2.1.239, a server-delivered `--mcp-config` blocked a cloud session from starting. +Claude Code still accepts a `--mcp-config` whose servers are all in-process `type: "sdk"` entries, so the Agent SDK and VS Code extension keep working. Users can still add servers with `claude mcp add` or a `.mcp.json` file; for per-server control, set [`allowedMcpServers`](</docs/en/managed-mcp>) as well. Requires Claude Code v2.1.193 or later. The same check covers plugin folders named in the [`CLAUDE_CODE_PLUGIN_DIRS`](</docs/en/env-vars#variables>) environment variable, which requires Claude Code v2.1.280 or later. When the variable names a folder, Claude Code exits with the same error, and the error says to unset the variable. In cloud sessions, Claude Code also ignores server-delivered mid-session MCP updates, the path behind cloud session configuration and SDK `setMcpServers()` calls that reach those sessions. In-process `type: "sdk"` entries stay exempt there too. Before v2.1.239, a server-delivered `--mcp-config` blocked a cloud session from starting. ###
modified Customize your status line View current →
--- a/statusline.md +++ b/statusline.md @@ -1062,7 +1062,7 @@ } } -The command runs once per refresh tick and receives all visible subagent rows as a single JSON object on stdin. The input includes the [base hook fields](</docs/en/hooks#common-input-fields>), a `columns` field with the usable row width, and a `tasks` array. Each task has `id`, `name`, `type`, `status`, `description`, `label`, `startTime`, `model`, `effort`, `contextWindowSize`, `tokenCount`, `tokenSamples`, and `cwd`. The per-task `model` field is the resolved model ID the task runs on. `contextWindowSize` is that model’s context window in tokens, computed the same way as the main status line’s `context_window.context_window_size`, so you can render a per-row percentage from `tokenCount`. Both fields require Claude Code v2.1.205 or later and are omitted for a task whose model isn’t resolved yet. The per-task `effort` field is the reasoning effort set for that subagent, in its [definition frontmatter](</docs/en/sub-agents#supported-frontmatter-fields>) or on the individual invocation. The value is either one of the effort level strings `low`, `medium`, `high`, `xhigh`, or `max`, or a numeric token budget. The field reports the configured value as written: if the model doesn’t support that level, the effort Claude Code actually applies may differ. The field requires Claude Code v2.1.214 or later and is absent when the subagent inherits the session’s effort level. Write one JSON line to stdout per row you want to override, in the form `{"id": "<task id>", "content": "<row body>"}`. The `content` string is rendered as-is, including ANSI colors and OSC 8 hyperlinks. Omit a task’s `id` to keep the default rendering for that row; emit an empty `content` string to hide it. The same trust, `disableAllHooks`, and [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) gates that apply to `statusLine` apply here. Plugins can ship a default `subagentStatusLine` in their [`settings.json`](</docs/en/plugins-reference#standard-plugin-layout>), but unlike hooks, plugin values don’t run under `allowManagedHooksOnly` even when the plugin is force-enabled in managed settings `enabledPlugins`. +The command runs once per refresh tick and receives all visible subagent rows as a single JSON object on stdin. The input includes the [base hook fields](</docs/en/hooks#common-input-fields>), a `columns` field with the usable row width, and a `tasks` array. Each task has `id`, `name`, `type`, `status`, `description`, `label`, `startTime`, `model`, `effort`, `contextWindowSize`, `tokenCount`, `tokenSamples`, and `cwd`. The per-task `model` field is the resolved model ID the task runs on. `contextWindowSize` is that model’s context window in tokens, computed the same way as the main status line’s `context_window.context_window_size`, so you can render a per-row percentage from `tokenCount`. Both fields require Claude Code v2.1.205 or later and are omitted for a task whose model isn’t resolved yet. The per-task `effort` field is the reasoning effort set for that subagent, in its [definition frontmatter](</docs/en/sub-agents#supported-frontmatter-fields>) or on the individual invocation. The value is either one of the effort level strings `low`, `medium`, `high`, `xhigh`, or `max`, or a numeric token budget. The field reports the configured value as written: if the model doesn’t support that level, the effort Claude Code actually applies may differ. The field requires Claude Code v2.1.214 or later and is absent when the subagent inherits the session’s effort level. Write one JSON line to stdout per row you want to override, in the form `{"id": "<task id>", "content": "<row body>"}`. The `content` string is rendered as-is, including ANSI colors and OSC 8 hyperlinks. Omit a task’s `id` to keep the default rendering for that row; emit an empty `content` string to hide it. The same trust, `disableAllHooks`, and [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) gates that apply to `statusLine` apply here. Plugins can ship a default `subagentStatusLine` in their [`settings.json`](</docs/en/plugins/manifest-reference#standard-layout>), but unlike hooks, plugin values don’t run under `allowManagedHooksOnly` even when the plugin is force-enabled in managed settings `enabledPlugins`. ##
modified Create custom subagents View current →
Show diff (109 lines)
--- a/sub-agents.md +++ b/sub-agents.md @@ -144,9 +144,9 @@ `--agents` CLI flag| Current session| 2| Pass JSON when launching Claude Code `.claude/agents/`| Current project| 3| Ask Claude, or create the file manually `~/.claude/agents/`| All your projects| 4| Ask Claude, or create the file manually -Plugin’s `agents/` directory| Where plugin is enabled| 5 (lowest)| Installed with [plugins](</docs/en/plugins>) - -**Project subagents** (`.claude/agents/`) are ideal for subagents specific to a codebase. Check them into version control so your team can use and improve them collaboratively. Project subagents are discovered by walking up from the current working directory, so every `.claude/agents/` between there and the repository root is scanned. As of v2.1.178, when more than one of these nested directories defines the same `name`, Claude Code uses the definition closest to the working directory. When you add a directory with `--add-dir` or `/add-dir`, Claude Code also loads its `.claude/agents/` folder, alongside your project subagents. See [Additional directories](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) for which other configuration types load from `--add-dir`. To share subagents across projects without `--add-dir`, use `~/.claude/agents/` or a [plugin](</docs/en/plugins>). **User subagents** (`~/.claude/agents/`) are personal subagents available in all your projects. Claude Code scans `.claude/agents/` and `~/.claude/agents/` recursively, so you can organize definitions into subfolders such as `agents/review/` or `agents/research/`. The subdirectory path doesn’t affect how a subagent is identified or invoked, because identity comes only from the `name` frontmatter field. Keep `name` values unique across the whole tree: if two files under the same `.claude/agents/` directory, including its subfolders, declare the same name, Claude Code loads only one of them, chosen by filesystem read order rather than a documented precedence. Across nested project directories, the definition closest to the working directory wins, as described above. The [`/doctor`](</docs/en/commands#all-commands>) setup checkup reports files in the same directory that share a name and proposes renaming or removing all but one. Before v2.1.205, `/doctor` opened a diagnostics screen that listed duplicates and showed which definition was active. Plugin `agents/` directories are also scanned recursively. Unlike project and user scopes, a subfolder inside a plugin’s `agents/` directory becomes part of the scoped identifier: a file at `agents/review/security.md` in plugin `my-plugin` registers as `my-plugin:review:security`. **CLI-defined subagents** are passed as JSON when launching Claude Code. They exist only for that session and aren’t saved to disk, making them useful for quick testing or automation scripts. You can define multiple subagents in a single `--agents` call: +Plugin’s `agents/` directory| Where plugin is enabled| 5 (lowest)| Installed with [plugins](</docs/en/plugins/overview>) + +**Project subagents** (`.claude/agents/`) are ideal for subagents specific to a codebase. Check them into version control so your team can use and improve them collaboratively. Project subagents are discovered by walking up from the current working directory, so every `.claude/agents/` between there and the repository root is scanned. When more than one of these nested directories defines the same `name`, Claude Code uses the definition closest to the working directory. When you add a directory with `--add-dir` or `/add-dir`, Claude Code also loads its `.claude/agents/` folder, alongside your project subagents. See [Additional directories](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) for which other configuration types load from `--add-dir`. To share subagents across projects without `--add-dir`, use `~/.claude/agents/` or a [plugin](</docs/en/plugins/overview>). **User subagents** (`~/.claude/agents/`) are personal subagents available in all your projects. Claude Code scans `.claude/agents/` and `~/.claude/agents/` recursively, so you can organize definitions into subfolders such as `agents/review/` or `agents/research/`. The subdirectory path doesn’t affect how a subagent is identified or invoked, because identity comes only from the `name` frontmatter field. Keep `name` values unique across the whole tree: if two files under the same `.claude/agents/` directory, including its subfolders, declare the same name, Claude Code loads only one of them, chosen by filesystem read order rather than a documented precedence. Across nested project directories, the definition closest to the working directory wins, as described above. The [`/doctor`](</docs/en/commands#all-commands>) setup checkup reports files in the same directory that share a name and proposes renaming or removing all but one. Before v2.1.205, `/doctor` opened a diagnostics screen that listed duplicates and showed which definition was active. Plugin `agents/` directories are also scanned recursively. Unlike project and user scopes, a subfolder inside a plugin’s `agents/` directory becomes part of the scoped identifier: a file at `agents/review/security.md` in plugin `my-plugin` registers as `my-plugin:review:security`. **CLI-defined subagents** are passed as JSON when launching Claude Code. They exist only for that session and aren’t saved to disk, making them useful for quick testing or automation scripts. You can define multiple subagents in a single `--agents` call: * macOS, Linux, WSL @@ -180,7 +180,7 @@ } '@ -The `--agents` flag accepts JSON with a `prompt` field plus these frontmatter fields: `description`, `tools`, `disallowedTools`, `model`, `permissionMode`, `mcpServers`, `hooks`, `maxTurns`, `skills`, `initialPrompt`, `memory`, `effort`, `background`, `omitClaudeMd`, and `isolation`. Use `prompt` for the system prompt, equivalent to the markdown body in file-based subagents. `color` and `experimental` aren’t accepted here and are ignored rather than rejected. Each top-level key in the JSON is the agent’s name. Don’t start a name with `-`. For what Claude Code does with a value it can’t load, and the flags and environment variable that skip that check, see [`Invalid --agents configuration`](</docs/en/errors#invalid-agents-configuration>). **Managed subagents** are deployed by organization administrators. Place markdown files in `.claude/agents/` inside the [managed settings directory](</docs/en/managed-settings#delivery-mechanisms>), using the same frontmatter format as project and user subagents. Managed definitions take precedence over project and user subagents with the same name. **Plugin subagents** come from [plugins](</docs/en/plugins>) you’ve installed. They load automatically alongside your custom subagents and appear in the @-mention typeahead under their scoped name. See the [plugin components reference](</docs/en/plugins-reference#agents>) for details on creating plugin subagents. +The `--agents` flag accepts JSON with a `prompt` field plus these frontmatter fields: `description`, `tools`, `disallowedTools`, `model`, `permissionMode`, `mcpServers`, `hooks`, `maxTurns`, `skills`, `initialPrompt`, `memory`, `effort`, `background`, `omitClaudeMd`, and `isolation`. Use `prompt` for the system prompt, equivalent to the markdown body in file-based subagents. `color` and `experimental` aren’t accepted here and are ignored rather than rejected. Each top-level key in the JSON is the agent’s name. Don’t start a name with `-`. For what Claude Code does with a value it can’t load, and the flags and environment variable that skip that check, see [`Invalid --agents configuration`](</docs/en/errors#invalid-agents-configuration>). **Managed subagents** are deployed by organization administrators. Place markdown files in `.claude/agents/` inside the [managed settings directory](</docs/en/managed-settings#delivery-mechanisms>), using the same frontmatter format as project and user subagents. Managed definitions take precedence over project and user subagents with the same name. **Plugin subagents** come from [plugins](</docs/en/plugins/overview>) you’ve installed. They load automatically alongside your custom subagents and appear in the @-mention typeahead under their scoped name. See the [plugin components reference](</docs/en/plugins/components#agents>) for details on creating plugin subagents. For security reasons, plugin subagents don’t support the `hooks`, `mcpServers`, or `permissionMode` frontmatter fields. These fields are ignored when loading agents from a plugin. If you need them, copy the agent file into `.claude/agents/` or `~/.claude/agents/`. You can also add rules to [`permissions.allow`](</docs/en/settings-reference#permissions-allow>) in `settings.json` or `settings.local.json`, but these rules apply to the entire session, not only the plugin subagent. @@ -229,7 +229,7 @@ Field| Required| Description ---|---|--- -`name`| Yes| Unique identifier, such as `code-reviewer` or `reviewer-v2`. [Hooks](</docs/en/hooks#subagentstart>) receive this value as `agent_type`. The filename doesn’t have to match. Names can’t contain `:`, which is reserved for [plugin-scoped identifiers](</docs/en/plugins>) such as `my-plugin:reviewer`. Claude Code doesn’t load a file whose name contains one and logs an error to the debug log. Before v2.1.218, such names were accepted +`name`| Yes| Unique identifier, such as `code-reviewer` or `reviewer-v2`. [Hooks](</docs/en/hooks#subagentstart>) receive this value as `agent_type`. The filename doesn’t have to match. Names can’t contain `:`, which is reserved for [plugin-scoped identifiers](</docs/en/plugins/overview>) such as `my-plugin:reviewer`. Claude Code doesn’t load a file whose name contains one and logs an error to the debug log. Before v2.1.218, such names were accepted `description`| Yes| When Claude should delegate to this subagent `tools`| No| Tools the subagent can use, as a comma-separated string such as `Read, Grep, Bash` or a YAML list. Inherits every tool available to subagents if omitted. If no entry in the list resolves to a tool, the subagent usually [fails to launch](</docs/en/errors#agent-would-be-spawned-with-zero-tools>) with an error naming the entries. To preload Skills into context, use the `skills` field rather than listing `Skill` here `disallowedTools`| No| Tools to deny, removed from inherited or specified list. Same format as `tools`. An entry with a specifier, such as `Bash(git push *)`, still removes the whole tool @@ -271,11 +271,11 @@ * **A`name` but no `description`**: Claude Code skips the file and writes the reason to the debug log. * **YAML that doesn’t parse** : Claude Code reads no fields from the file, skips it, and writes the parse error to the debug log. -To see the debug log, run Claude Code with `--debug`. A [plugin subagent](</docs/en/plugins-reference#agents>) whose frontmatter has no `name` or doesn’t parse still loads, under its filename. +To see the debug log, run Claude Code with `--debug`. A [plugin subagent](</docs/en/plugins/components#agents>) whose frontmatter has no `name` or doesn’t parse still loads, under its filename. ##### Check an `agents` directory before a session -To find files in an `agents` directory whose frontmatter doesn’t parse, run `claude plugin validate` against the directory, for example `.claude/agents` or `~/.claude/agents`. Claude Code checks only [the directory you name](</docs/en/plugin-marketplaces#validate-a-plugin-or-a-directory-without-a-manifest>), and doesn’t flag a file whose frontmatter parses but has no `name`. Requires Claude Code v2.1.233 or later. +To find files in an `agents` directory whose frontmatter doesn’t parse, run `claude plugin validate` against the directory, for example `.claude/agents` or `~/.claude/agents`. Claude Code checks only [the directory you name](</docs/en/plugins/cli-reference#validate-a-directory>), and doesn’t flag a file whose frontmatter parses but has no `name`. Requires Claude Code v2.1.233 or later. ### @@ -451,7 +451,7 @@ * A name that references a server you already configured * An inline server in an agent file from `~/.claude/agents/`, in one you pass with `--agents` or the SDK `agents` option, or in one that managed settings supplies -As of v2.1.153, the MCP restrictions that apply to the main session also cover servers declared in subagent frontmatter: +The MCP restrictions that apply to the main session also cover servers declared in subagent frontmatter: * [`--strict-mcp-config`](</docs/en/cli-reference>) and [`--bare`](</docs/en/cli-reference>) * [Enterprise managed MCP configuration](</docs/en/managed-mcp>) @@ -672,7 +672,7 @@ `SubagentStart`| Agent type name| When a subagent begins execution `SubagentStop`| Agent type name| When a subagent completes -Both events support matchers to target specific agent types by name. The matcher value is the agent’s frontmatter `name` for project-level and user-level subagents, or the plugin-scoped identifier such as `my-plugin:db-agent` for [plugin subagents](</docs/en/plugins>). A scoped name contains a colon, so it is evaluated as an [unanchored regular expression](</docs/en/hooks#matcher-patterns>); anchor it with `^` and `$`, as in `^my-plugin:db-agent$`, to match only that agent. This example runs a setup script only when the `db-agent` subagent starts, and a cleanup script when any subagent stops: +Both events support matchers to target specific agent types by name. The matcher value is the agent’s frontmatter `name` for project-level and user-level subagents, or the plugin-scoped identifier such as `my-plugin:db-agent` for [plugin subagents](</docs/en/plugins/components#agents>). A scoped name contains a colon, so it is evaluated as an [unanchored regular expression](</docs/en/hooks#matcher-patterns>); anchor it with `^` and `$`, as in `^my-plugin:db-agent$`, to match only that agent. This example runs a setup script only when the `db-agent` subagent starts, and a cleanup script when any subagent stops: { "hooks": { @@ -708,7 +708,7 @@ Understand automatic delegation -Claude automatically delegates tasks based on the task description in your request, the `description` field in subagent configurations, and current context. To encourage proactive delegation, include phrases like “use proactively” in your subagent’s description field. Keep descriptions brief: Claude Code shows a startup warning when your subagents’ combined descriptions pass [the 15,000-token limit](</docs/en/errors#agent-descriptions-are-over-the-15000-token-limit>), and still loads every subagent. +Claude automatically delegates tasks based on the task description in your request, the `description` field in subagent configurations, and current context. To encourage proactive delegation, include phrases like “use proactively” in your subagent’s description field. Keep descriptions brief: Claude Code shows a startup warning when your subagents’ combined descriptions pass [the 15,000-token limit](</docs/en/errors#agent-descriptions-are-over-the-15000-token-limit>), and still loads every subagent. If the subagent ships in a [plugin](</docs/en/plugins/overview>), you can measure how reliably Claude delegates to it across realistic prompts instead of checking one at a time: [`claude plugin eval`](</docs/en/plugin-evals>) runs each prompt with and without the plugin and scores the results. ### @@ -731,7 +731,7 @@ @"code-reviewer (agent)" look at the auth changes -Your full message still goes to Claude, which writes the subagent’s task prompt based on what you asked. The @-mention controls which subagent Claude invokes, not what prompt it receives. Subagents provided by an enabled [plugin](</docs/en/plugins>) appear in the typeahead under their scoped name, such as `my-plugin:code-reviewer` or `my-plugin:review:security` when the plugin organizes agents into subfolders. Named background subagents currently running in the session also appear in the typeahead, showing their status next to the name. You can also type the mention manually without using the picker: `@agent-<name>` for local subagents, or `@agent-` followed by the scoped name for plugin subagents, for example `@agent-my-plugin:code-reviewer`. While you type this form the typeahead shows file matches rather than agents. The agent mention still resolves when you submit. **Run the whole session as a subagent.** Pass [`--agent <name>`](</docs/en/cli-reference>) to start a session where the main thread itself takes on that subagent’s system prompt, tool restrictions, and model: +Your full message still goes to Claude, which writes the subagent’s task prompt based on what you asked. The @-mention controls which subagent Claude invokes, not what prompt it receives. Subagents provided by an enabled [plugin](</docs/en/plugins/overview>) appear in the typeahead under their scoped name, such as `my-plugin:code-reviewer` or `my-plugin:review:security` when the plugin organizes agents into subfolders. Named background subagents currently running in the session also appear in the typeahead, showing their status next to the name. You can also type the mention manually without using the picker: `@agent-<name>` for local subagents, or `@agent-` followed by the scoped name for plugin subagents, for example `@agent-my-plugin:code-reviewer`. While you type this form the typeahead shows file matches rather than agents. The agent mention still resolves when you submit. **Run the whole session as a subagent.** Pass [`--agent <name>`](</docs/en/cli-reference>) to start a session where the main thread itself takes on that subagent’s system prompt, tool restrictions, and model: claude --agent code-reviewer @@ -760,7 +760,7 @@ Subagents can run in the foreground or the background: * **Foreground subagents** block the main conversation until complete. Permission prompts are passed through to you as they come up. - * **Background subagents** run concurrently while you continue working. When a background subagent reaches a tool call that needs permission, Claude Code surfaces the prompt in your main session and names the subagent that is asking. Approve to let the subagent continue, or press Esc to deny that one tool call without stopping the subagent. Before v2.1.186, background subagents auto-denied any tool call that would have prompted. + * **Background subagents** run concurrently while you continue working. When a background subagent reaches a tool call that needs permission, Claude Code surfaces the prompt in your main session and names the subagent that is asking. Approve to let the subagent continue, or press Esc to deny that one tool call without stopping the subagent. For each subagent Claude spawns with the Agent tool, Claude Code picks foreground or background from the first of these cases that applies: @@ -961,7 +961,7 @@ Continue that code review and now analyze the authorization logic [Claude resumes the subagent with full context from previous conversation] -When Claude sends a completed subagent a message with the `SendMessage` tool, the subagent resumes in the background without a new `Agent` invocation. The same applies to a subagent that Claude stopped with the `TaskStop` tool, once its stopped run has exited. The resumed run keeps the tool set from where the subagent first ran and can keep reading the [prompt cache the original run warmed](</docs/en/prompt-caching#subagents-and-the-cache>). A subagent that has the `SendMessage` tool can send that message too. In an interactive session, the resumed agent then reports back to the subagent that resumed it, not to your main conversation. That subagent waits for the result before finishing its own work. When a subagent messages an agent it reports to, such as its own launcher, Claude Code resumes that agent without redirecting its results. A subagent you stopped yourself, with `x` in `/tasks` or an SDK `stop_task` request, doesn’t auto-resume. If Claude sends it a message, the message is refused and Claude is told the agent was cancelled. While that subagent’s row is still in the subagent panel, type into its transcript to resume it yourself. After that, a message from Claude can auto-resume it again. Requires Claude Code v2.1.191 or later. Resuming starts a new run of the agent under the same ID, so a subagent that had already failed or completed shows as running again in the task list and in the Agent SDK’s task events. Before v2.1.205, it kept showing its earlier failed or completed status while the resumed run was working. As of v2.1.199, `SendMessage` checks that a name still refers to the same agent it reached earlier in the conversation. If a newer agent has taken the name, such as a re-spawned background agent that reused it, Claude Code refuses the send rather than delivering it to the wrong agent, and the error reports which agent the name now reaches so Claude can retarget. To reach the earlier agent while it’s still running, Claude addresses it by the agent ID it received when it spawned that agent. The check is scoped to the current conversation and resets on `/clear`. As of v2.1.198, a subagent treats messages from the agent that launched it as normal task direction, including mid-task course corrections, and acts on them within its own permission settings. Two limits still hold regardless of who sent the message: no message from any agent counts as your approval for a pending permission prompt, and no agent message can change a subagent’s permission settings, `CLAUDE.md`, or configuration. Only the permission system or your own messages can grant approval. You can also ask Claude for the agent ID if you want to reference it explicitly, or find IDs in the transcript files at `~/.claude/projects/{project}/{sessionId}/subagents/`. Each transcript is stored as `agent-{agentId}.jsonl`. Subagent transcripts persist independently of the main conversation: +When Claude sends a completed subagent a message with the `SendMessage` tool, the subagent resumes in the background without a new `Agent` invocation. The same applies to a subagent that Claude stopped with the `TaskStop` tool, once its stopped run has exited. The resumed run keeps the tool set from where the subagent first ran and can keep reading the [prompt cache the original run warmed](</docs/en/prompt-caching#subagents-and-the-cache>). A subagent that has the `SendMessage` tool can send that message too. In an interactive session, the resumed agent then reports back to the subagent that resumed it, not to your main conversation. That subagent waits for the result before finishing its own work. When a subagent messages an agent it reports to, such as its own launcher, Claude Code resumes that agent without redirecting its results. A subagent you stopped yourself, with `x` in `/tasks` or an SDK `stop_task` request, doesn’t auto-resume. If Claude sends it a message, the message is refused and Claude is told the agent was cancelled. While that subagent’s row is still in the subagent panel, type into its transcript to resume it yourself. After that, a message from Claude can auto-resume it again. Resuming starts a new run of the agent under the same ID, so a subagent that had already failed or completed shows as running again in the task list and in the Agent SDK’s task events. Before v2.1.205, it kept showing its earlier failed or completed status while the resumed run was working. As of v2.1.199, `SendMessage` checks that a name still refers to the same agent it reached earlier in the conversation. If a newer agent has taken the name, such as a re-spawned background agent that reused it, Claude Code refuses the send rather than delivering it to the wrong agent, and the error reports which agent the name now reaches so Claude can retarget. To reach the earlier agent while it’s still running, Claude addresses it by the agent ID it received when it spawned that agent. The check is scoped to the current conversation and resets on `/clear`. As of v2.1.198, a subagent treats messages from the agent that launched it as normal task direction, including mid-task course corrections, and acts on them within its own permission settings. Two limits still hold regardless of who sent the message: no message from any agent counts as your approval for a pending permission prompt, and no agent message can change a subagent’s permission settings, `CLAUDE.md`, or configuration. Only the permission system or your own messages can grant approval. You can also ask Claude for the agent ID if you want to reference it explicitly, or find IDs in the transcript files at `~/.claude/projects/{project}/{sessionId}/subagents/`. Each transcript is stored as `agent-{agentId}.jsonl`. Subagent transcripts persist independently of the main conversation: * **Main conversation compaction** : when the main conversation compacts, subagent transcripts are unaffected. They’re stored in separate files. * **Session persistence** : subagent transcripts persist within their session. You can resume a subagent after restarting Claude Code by resuming the same session. @@ -1251,6 +1251,6 @@ Now that you understand subagents, explore these related features: - * [Distribute subagents with plugins](</docs/en/plugins>) to share subagents across teams or projects + * [Distribute subagents with plugins](</docs/en/plugins/components#agents>) to share subagents across teams or projects * [Run Claude Code programmatically](</docs/en/headless>) with the Agent SDK for CI/CD and automation * [Use MCP servers](</docs/en/mcp>) to give subagents access to external tools and data
modified Configure your terminal for Claude Code View current →
--- a/terminal-config.md +++ b/terminal-config.md @@ -142,7 +142,7 @@ Create a custom theme -In addition to the built-in presets, `/theme` lists any custom themes you have defined and any themes contributed by installed [plugins](</docs/en/plugins-reference#themes>). Select **New custom theme…** at the end of the list to create one interactively: you name the theme, then pick individual color tokens to override. Press `Ctrl+E` while a custom theme is highlighted to edit it. Each custom theme is a JSON file in `~/.claude/themes/`. The filename without the `.json` extension is the theme’s slug, and selecting the theme stores `custom:<slug>` as your theme preference. The file has three optional fields: +In addition to the built-in presets, `/theme` lists any custom themes you have defined and any themes contributed by installed [plugins](</docs/en/plugins/components#themes-and-output-styles>). Select **New custom theme…** at the end of the list to create one interactively: you name the theme, then pick individual color tokens to override. Press `Ctrl+E` while a custom theme is highlighted to edit it. Each custom theme is a JSON file in `~/.claude/themes/`. The filename without the `.json` extension is the theme’s slug, and selecting the theme stores `custom:<slug>` as your theme preference. The file has three optional fields: Field| Type| Description ---|---|---
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -195,7 +195,7 @@ * `mcp`: local [MCP servers](</docs/en/mcp>) * `lsp`: language servers * `hooks`: [hook](</docs/en/hooks>) commands - * `plugin`: commands that [plugins](</docs/en/plugins>) run + * `plugin`: commands that [plugins](</docs/en/plugins/overview>) run * `helper`: Claude Code’s own helper commands, such as `git` * `agent`: child Claude Code processes, such as [agent teammates](</docs/en/agent-teams>) @@ -294,7 +294,7 @@ * Find implementations of an interface * Trace call hierarchies -Claude Code keeps the tool inactive until you install a [code intelligence plugin](</docs/en/discover-plugins#code-intelligence>) for your language. In [cloud sessions](</docs/en/claude-code-on-the-web>), Claude Code doesn’t start plugin language servers, so the LSP tool stays inactive there. Claude Code takes the language server’s configuration from the plugin, and you install the server binary yourself. Claude Code returns an error result for each LSP call on a file whose language server it can’t start. +Claude Code keeps the tool inactive until you install a [code intelligence plugin](</docs/en/plugins/code-intelligence>) for your language. In [cloud sessions](</docs/en/claude-code-on-the-web>), Claude Code doesn’t start plugin language servers, so the LSP tool stays inactive there. Claude Code takes the language server’s configuration from the plugin, and you install the server binary yourself. Claude Code returns an error result for each LSP call on a file whose language server it can’t start. ## @@ -310,7 +310,7 @@ * Track output from any long-running script you point it at * Connect to a WebSocket feed and report each message as it arrives -For most watches, Claude writes a small script, runs it in the background, and receives each output line as it arrives. For a server that already pushes events, Claude can open a WebSocket instead of running a script. You keep working in the same session and Claude interjects when an event arrives. Every watch Claude starts has a deadline: 5 minutes by default, at most 30 minutes, and at most 10 minutes in a [non-interactive](</docs/en/headless>) run given a single prompt with `-p`. At the deadline the watch ends. Claude gets one notice, so it can start the watch again if it’s still needed. Stop a monitor by asking Claude to cancel it or by ending the session. When you stop a [subagent](</docs/en/sub-agents>) that started monitors, for example from `/tasks`, those monitors stop with it. When Monitor runs a command, it uses the same [permission rules as Bash](</docs/en/permissions#tool-specific-permission-rules>), so `allow` and `deny` patterns you have set for Bash apply here too. While [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is active, Claude Code sets aside allow rules that name `Monitor` itself, along with the other [broad allow rules it drops](</docs/en/permission-modes#how-the-classifier-evaluates-actions>), so the classifier reviews Monitor commands the same way it reviews Bash commands. The WebSocket source has its own approval prompt, which the classifier also decides in auto mode. The tool is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. It is also not available when `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. Plugins can declare monitors that start automatically when the plugin is active, instead of asking Claude to start them. See [plugin monitors](</docs/en/plugins-reference#monitors>). +For most watches, Claude writes a small script, runs it in the background, and receives each output line as it arrives. For a server that already pushes events, Claude can open a WebSocket instead of running a script. You keep working in the same session and Claude interjects when an event arrives. Every watch Claude starts has a deadline: 5 minutes by default, at most 30 minutes, and at most 10 minutes in a [non-interactive](</docs/en/headless>) run given a single prompt with `-p`. At the deadline the watch ends. Claude gets one notice, so it can start the watch again if it’s still needed. Stop a monitor by asking Claude to cancel it or by ending the session. When you stop a [subagent](</docs/en/sub-agents>) that started monitors, for example from `/tasks`, those monitors stop with it. When Monitor runs a command, it uses the same [permission rules as Bash](</docs/en/permissions#tool-specific-permission-rules>), so `allow` and `deny` patterns you have set for Bash apply here too. While [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is active, Claude Code sets aside allow rules that name `Monitor` itself, along with the other [broad allow rules it drops](</docs/en/permission-modes#how-the-classifier-evaluates-actions>), so the classifier reviews Monitor commands the same way it reviews Bash commands. The WebSocket source has its own approval prompt, which the classifier also decides in auto mode. The tool is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. It is also not available when `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. Plugins can declare monitors that start automatically when the plugin is active, instead of asking Claude to start them. See [plugin monitors](</docs/en/plugins/components#monitors>). ###
modified Troubleshoot the Agent SDK View current →
--- a/troubleshooting.md +++ b/troubleshooting.md @@ -1,4 +1,16 @@ -Entries on this page are keyed to the error you see. Each names the cause and what to do. +This page covers Agent SDK errors in CLI startup, CLI process exit, and structured outputs. Entries on this page are keyed to the error you see. Each entry names the cause and what to do. Symptoms tied to a feature, such as a hook not firing or a skill not being used, have a troubleshooting section on that feature’s page. The table names the section or page that covers each symptom: + +Symptom| Go to +---|--- +Skills not found, a skill not being used, `Invalid skill name` error| [Skills troubleshooting](</docs/en/agent-sdk/skills#troubleshooting>) +MCP server shows `failed` status, tools not being called, connection timeouts, tool output that exceeds the maximum allowed tokens| [MCP troubleshooting](</docs/en/agent-sdk/mcp#troubleshooting>) +Plugin not loading, plugin skills not appearing| [Plugins troubleshooting](</docs/en/agent-sdk/plugins#troubleshooting>) +Claude not delegating to subagents, filesystem-based agents not loading| [Subagents troubleshooting](</docs/en/agent-sdk/subagents#troubleshooting>) +Checkpointing options not recognized, user messages without UUIDs, `No file checkpoint found`, `File rewinding is not enabled`, `ProcessTransport is not ready for writing`| [File checkpointing troubleshooting](</docs/en/agent-sdk/file-checkpointing#troubleshooting>) +Hook not firing, matcher not filtering as expected, hook timeout, tool blocked unexpectedly, modified input not applied, session hooks not available in Python, subagent permission prompts multiplying, recursive hook loops with subagents, `systemMessage` not appearing in output| [Fix common issues](</docs/en/agent-sdk/hooks#fix-common-issues>) on the hooks page +An agent that works on your machine fails in a deployed service or container| [Troubleshoot deployment failures](</docs/en/agent-sdk/hosting#troubleshoot-deployment-failures>) +`Not logged in`, `Invalid API key`, `API Error`, `429`, `There's an issue with the selected model`| [Error reference](</docs/en/errors#find-your-error>) +`CLINotFoundError`, `CLIConnectionError`, `ProcessError`, `Claude Code process exited with code N`, `Claude Code returned an error result`, `structured_output` is `None`| CLI startup, CLI process exit, and Structured outputs on this page ##
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -275,7 +275,7 @@ Manage plugins -The VS Code extension includes a graphical interface for installing and managing [plugins](</docs/en/plugins>). Type `/plugins` in the prompt box to open the **Manage plugins** interface. +The VS Code extension includes a graphical interface for installing and managing [plugins](</docs/en/plugins/overview>). Type `/plugins` in the prompt box to open the **Manage plugins** interface. ### @@ -336,7 +336,7 @@ Plugin management in VS Code uses the same CLI commands under the hood. Plugins and marketplaces you configure in the extension are also available in the CLI, and vice versa. -For more about the plugin system, see [Plugins](</docs/en/plugins>) and [Plugin marketplaces](</docs/en/plugin-marketplaces>). +For more about the plugin system, see [Plugins](</docs/en/plugins/overview>) and [Plugin marketplaces](</docs/en/plugins/overview>). ##
modified Orchestrate subagents at scale with dynamic workflows View current →
--- a/workflows.md +++ b/workflows.md @@ -213,7 +213,7 @@ Distribute a workflow in a plugin -To share a workflow across teams or repositories, include it in a [plugin](</docs/en/plugins>). Place the script in a `workflows/` directory at the plugin root, or point to a different location with the [`workflows` manifest field](</docs/en/plugins-reference#component-path-fields>). Plugin workflows are namespaced by the plugin name. A plugin called `acme-tools` containing a script whose `meta.name` is `release-audit` runs as `/acme-tools:release-audit`. +To share a workflow across teams or repositories, include it in a [plugin](</docs/en/plugins/overview>). Place the script in a `workflows/` directory at the plugin root, or point to a different location with the [`workflows` manifest field](</docs/en/plugins/manifest-reference#fields>). Plugin workflows are namespaced by the plugin name. A plugin called `acme-tools` containing a script whose `meta.name` is `release-audit` runs as `/acme-tools:release-audit`. ###
modified Run parallel sessions with worktrees View current →
--- a/worktrees.md +++ b/worktrees.md @@ -218,7 +218,7 @@ A worktree gets its own files and branch, but it shares the following with the main checkout: * **The repository’s`.git` directory**: git commands in a worktree write to the main repository’s shared `.git` directory, and [sandboxing](</docs/en/sandboxing#filesystem-isolation>) allows those writes, so commands such as `git commit` work from inside a worktree with the sandbox enabled. - * **Plugins** : plugins installed at [project scope](</docs/en/plugins-reference#plugin-installation-scopes>) from the main checkout also load in worktrees of the same repository, so you don’t need to reinstall them per worktree. Requires Claude Code v2.1.200 or later. + * **Plugins** : plugins installed at [project scope](</docs/en/plugins/loading#find-where-a-plugin-is-enabled>) from the main checkout also load in worktrees of the same repository, so you don’t need to reinstall them per worktree. Requires Claude Code v2.1.200 or later. * **Permission approvals** : choosing “Yes, and don’t ask again” for a Bash command in a worktree session saves the rule to the main checkout’s `.claude/settings.local.json`, so it applies in the main checkout and in every other worktree of the repository, and it survives the worktree’s removal. On Windows and in the other cases where Claude Code [doesn’t use the repository root](</docs/en/settings#where-claude-code-looks-for-each-file>), the rule stays with that worktree. Before v2.1.211, an approval granted in a worktree was saved inside that worktree, didn’t apply elsewhere, and was lost when the worktree was removed. See [where approvals are saved](</docs/en/permissions#permission-system>). * **Untracked skills, agents, and commands** : when the worktree checkout has no `.claude/skills` directory at its root, for example because your `.claude/skills` is gitignored, Claude Code loads the main checkout’s [project skills](</docs/en/skills#where-skills-live>) in the worktree session. In a worktree with its own `.claude/skills` directory, only that copy loads. The same read-through covers `.claude/agents` and `.claude/commands`. For skills, the read-through requires Claude Code v2.1.277 or later. @@ -276,7 +276,7 @@ } } -Pair it with a `WorktreeRemove` hook to clean up when the session ends. See the [hooks reference](</docs/en/hooks#worktreecreate>) for the input schema and a removal example. +Pair it with a `WorktreeRemove` hook to clean up when the session ends. See the [hooks reference](</docs/en/hooks#worktreecreate>) for the input schema and a removal example. A `WorktreeCreate` hook also lets you run [`/batch`](</docs/en/commands#all-commands>) outside a git repository. Each `/batch` subagent then publishes its change with your project’s version-control commands and, when it can’t open a pull request, reports what it published instead. Running `/batch` outside a git repository requires Claude Code v2.1.281 or later. ##
modified Zero data retention View current →
--- a/zero-data-retention.md +++ b/zero-data-retention.md @@ -64,7 +64,7 @@ Feature| Reason ---|--- [Cloud sessions](</docs/en/claude-code-on-the-web>), including those started from the [Desktop app](</docs/en/desktop#cloud-sessions>)| Requires server-side storage of session data, including conversation history with prompts and completions. -[Claude Tag](</docs/en/claude-tag>)| Retains channel memory and session transcripts. +[Claude Tag](<https://claude.com/docs/claude-tag>)| Retains channel memory and session transcripts. [Artifacts](</docs/en/artifacts>)| Requires storing published page content on Anthropic-operated infrastructure. Feedback submission (`/feedback`, `/bug`, `/share`)| Submitting feedback sends conversation data to Anthropic. [Remote Control](</docs/en/remote-control>)| Stores the session transcript on Anthropic servers to sync the conversation across devices.
removed claude-tag View current →
--- a/claude-tag.md +++ b/claude-tag.md @@ -1 +0,0 @@ -[Claude Tag](<https://claude.com/product/tag>) is a Slack integration that runs `@Claude` in your team’s channels as your organization’s shared identity with admin-configured access. Anyone in a channel can tag `@Claude` into a thread and assign it a task. Read the [Claude Tag documentation](<https://claude.com/docs/claude-tag/overview>) on claude.com to set it up and start using it. Claude Tag is available on Team and Enterprise plans, and is distinct from the earlier [Claude Code in Slack](</docs/en/slack>), which runs each session under an individual user’s account. On Pro and Max plans, where Claude Tag isn’t available, Claude Code in Slack remains the setup path.
removed discover-plugins View current →
Show diff (552 lines)
--- a/discover-plugins.md +++ b/discover-plugins.md @@ -1,549 +0,0 @@ -Plugins extend Claude Code with skills, agents, hooks, and MCP servers. Plugin marketplaces are catalogs that help you discover and install these extensions without building them yourself. You can also enable plugins on claude.ai, for yourself or through your organization. Claude Code syncs those into your sessions without a marketplace install, as [Plugins synced from claude.ai](</docs/en/plugins-reference#synced-plugins>) describes. Looking to create and distribute your own marketplace? See [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>). - -## - -​ - -How marketplaces work - -A marketplace is a catalog of plugins that someone else has created and shared. Using a marketplace is a two-step process: - -1 - -Add the marketplace - -This registers the catalog with Claude Code so you can browse what’s available. No plugins are installed yet. - -2 - -Install individual plugins - -Browse the catalog and install the plugins you want. - -## - -​ - -Official Anthropic marketplace - -Claude Code adds the official Anthropic marketplace (`claude-plugins-official`) automatically the first time you start it interactively. If Claude Code can’t add it, for example because your network blocks the download or a [marketplace policy](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) blocked an earlier attempt, add it yourself with `/plugin marketplace add anthropics/claude-plugins-official`. To browse what’s available, run `/plugin` and go to the **Discover** tab, or view the catalog at [claude.com/plugins](<https://claude.com/plugins>). To install a plugin from the official marketplace, use `/plugin install <name>@claude-plugins-official`. For example, to install the GitHub integration: - - /plugin install github@claude-plugins-official - -`/plugin` opens an interactive panel in the terminal CLI. If Claude replies that `/plugin` isn’t available in this environment, install the plugin another way: - - * **Claude desktop app** : use the [plugin browser](</docs/en/desktop#install-plugins>). - * **VS Code extension** : install from the [**Manage plugins** dialog](</docs/en/vs-code#manage-plugins>). - * **Cloud sessions** : enable the plugin for your claude.ai account so Claude Code loads it as a [synced plugin](</docs/en/plugins-reference#synced-plugins>). - -If the install fails, match the message Claude Code reports: - - * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install. - * The plugin is not found in the marketplace: check the plugin name. - -The official marketplace is curated by Anthropic, and inclusion is at Anthropic’s discretion. The in-app submission forms add plugins to the community marketplace, not the official one. To distribute plugins independently, [create your own marketplace](</docs/en/plugin-marketplaces>) and share it with users. - -The official marketplace includes several categories of plugins: - -### - -​ - -Code intelligence - -Code intelligence plugins enable Claude Code’s built-in LSP tool, giving Claude the ability to jump to definitions, find references, and see type errors immediately after edits. These plugins configure [Language Server Protocol](<https://microsoft.github.io/language-server-protocol/>) connections, the same technology that powers VS Code’s code intelligence. In [cloud sessions](</docs/en/claude-code-on-the-web>), Claude Code doesn’t start plugin language servers, so Claude doesn’t get the LSP tool there. Install the language server binary from the table below before using these plugins; the plugin doesn’t install it for you. If you already have a language server installed, Claude may prompt you to install the corresponding plugin when you open a project. - -Language| Plugin| Binary required ----|---|--- -C/C++| `clangd-lsp`| `clangd` -C#| `csharp-lsp`| `csharp-ls` -Go| `gopls-lsp`| `gopls` -Java| `jdtls-lsp`| `jdtls` -Kotlin| `kotlin-lsp`| `kotlin-language-server` -Lua| `lua-lsp`| `lua-language-server` -PHP| `php-lsp`| `intelephense` -Python| `pyright-lsp`| `pyright-langserver` -Rust| `rust-analyzer-lsp`| `rust-analyzer` -Swift| `swift-lsp`| `sourcekit-lsp` -TypeScript| `typescript-lsp`| `typescript-language-server` - -You can also [create your own LSP plugin](</docs/en/plugins-reference#lsp-servers>) for other languages. - -If you see `Executable not found in $PATH` in the `/plugin` Errors tab after installing a plugin, install the binary the code intelligence table lists for that plugin. - -#### - -​ - -What Claude gains from code intelligence plugins - -Once a code intelligence plugin is installed and its language server binary is available, Claude gains two capabilities: - - * **Automatic diagnostics** : after every file edit Claude makes, the language server reports errors and warnings back, so Claude sees type errors, missing imports, and syntax issues without running a compiler or linter. If Claude introduces an error, it notices and fixes it in the same turn. - * **Code navigation** : Claude can use the language server to jump to definitions, find references, get type info on hover, list symbols, find implementations, and trace call hierarchies. These operations give Claude more precise navigation than grep-based search, though availability may vary by language and environment. - -You don’t need to configure diagnostics beyond installing the plugin. To read them yourself, press **Ctrl+O** when Claude Code shows an indicator such as **Found 3 new diagnostic issues in 2 files**. If you run into issues, see Code intelligence troubleshooting. - -### - -​ - -External integrations - -These plugins bundle pre-configured [MCP servers](</docs/en/mcp>) so you can connect Claude to external services without manual setup: - - * **Source control** : `github`, `gitlab` - * **Project management** : `atlassian` (Jira/Confluence), `asana`, `linear`, `notion` - * **Design** : `figma` - * **Infrastructure** : `vercel`, `firebase`, `supabase` - * **Communication** : `slack` - * **Monitoring** : `sentry` - -### - -​ - -Automatic security review - -The `security-guidance` plugin reviews each change Claude makes for common vulnerabilities and instructs Claude to fix what it finds in the same session. See [Catch security issues as Claude writes code](</docs/en/security-guidance>) for what it checks and how to add project-specific rules. - -### - -​ - -Development workflows - -Plugins that add skills and agents for common development tasks: - - * **commit-commands** : Git commit workflows including commit, push, and PR creation - * **pr-review-toolkit** : specialized agents for reviewing pull requests - * **agent-sdk-dev** : tools for building with the Claude Agent SDK - * **plugin-dev** : toolkit for creating your own plugins - -### - -​ - -Output styles - -Customize how Claude responds: - - * **explanatory-output-style** : educational insights about implementation choices - * **learning-output-style** : interactive learning mode for skill building - -## - -​ - -Community marketplace - -The community marketplace at [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>) hosts third-party plugins that have passed Anthropic’s automated validation and safety screening. Each plugin is pinned to a specific commit SHA in the catalog. Unlike the official marketplace, you add it manually: - - /plugin marketplace add anthropics/claude-plugins-community - -Then install plugins from it using the `claude-community` marketplace name: - - /plugin install <plugin-name>@claude-community - -To submit your own plugin to the community marketplace, see [Submit your plugin to the community marketplace](</docs/en/plugins#submit-your-plugin-to-the-community-marketplace>) in the create-plugins guide. - -## - -​ - -Try it: add the demo marketplace - -Anthropic also maintains a [demo plugins marketplace](<https://github.com/anthropics/claude-code/tree/main/plugins>) (`claude-code-plugins`) with example plugins that show what’s possible with the plugin system. Unlike the official marketplace, you need to add this one manually. - -1 - -Add the marketplace - -From within Claude Code, run the `plugin marketplace add` command for the `anthropics/claude-code` marketplace: - - /plugin marketplace add anthropics/claude-code - -This downloads the marketplace catalog and makes its plugins available to you. - -2 - -Browse available plugins - -Run `/plugin` to open the plugin manager. This opens a tabbed interface you can cycle through using **Tab** , or **Shift+Tab** to go backward: - - * **Discover** : browse available plugins from all your marketplaces - * **Installed** : view and manage your installed plugins - * **Marketplaces** : add, remove, or update your added marketplaces - * **Errors** : view any plugin loading errors - * **Stats** : see [what each of your skills costs in context and how often it gets used](</docs/en/skills#find-unused-skills>), in sessions where `/skill-doctor` is available - -Go to the **Discover** tab to see plugins from the marketplace you just added. When your administrator has allowlisted the marketplace via the [`pluginSuggestionMarketplaces`](</docs/en/settings-reference#pluginsuggestionmarketplaces>) managed setting, plugins marked as relevant to your current working directory are pinned at the top with a **suggested for this directory** label. - -3 - -Install a plugin - -Select a plugin to view its details. The details pane shows what the plugin contains and what it costs: - - * A **Context cost** estimate so you can see how many tokens the plugin will add to your [context window](</docs/en/features-overview#understand-context-costs>) every turn - * The plugin’s **Last updated** date - * A **Will install** section listing the plugin’s commands, agents, skills, hooks, and MCP and LSP servers, so you can review exactly what it adds before installing - -Not every plugin provides the data behind these fields. For plugins from local or custom marketplaces, you may not see the **Context cost** and **Last updated** rows, and the **Will install** section may show **Components will be discovered at installation** instead.Choose an installation scope: - - * **User scope** : install for yourself across all projects - * **Project scope** : install for all collaborators on this repository - * **Local scope** : install for yourself in this repository only - -For example, select **commit-commands** , a plugin that adds git workflow skills, and install it to your user scope.You can also start the install from the command line: - - /plugin install commit-commands@claude-code-plugins - -See [Settings files](</docs/en/settings#where-settings-live>) to learn more about scopes. - -4 - -Use your new plugin - -If the install summary reports `Run /reload-plugins to activate.`, Claude Code then runs that reload for you. If the reload warns that your next message would re-read the conversation, run `/reload-plugins --force` to activate the plugin.Plugin skills are namespaced by the plugin name, so **commit-commands** provides skills like `/commit-commands:commit`.Try it out by making a change to a file and running: - - /commit-commands:commit - -This stages your changes, generates a commit message, and creates the commit.Each plugin works differently. Check the plugin’s details in the **Discover** tab to see the commands and skills it provides, or visit its homepage for usage guidance. - -## - -​ - -Add marketplaces - -Use the `/plugin marketplace add` command to add marketplaces from different sources. - -**Shortcuts** : You can use `/plugin market` instead of `/plugin marketplace`, and `rm` instead of `remove`. - - * **GitHub repositories** : `owner/repo` format, for example `anthropics/claude-code` - * **Git URLs** : any git repository URL, including GitLab, Bitbucket, and self-hosted servers - * **Local paths** : directories or direct paths to `marketplace.json` files - * **Remote URLs** : direct URLs to hosted `marketplace.json` files - * **claude.ai** : marketplaces hosted on claude.ai for your account, such as your organization’s plugin library, which you add by name from the **Marketplaces** tab or your shell rather than by source - -### - -​ - -Add from GitHub - -Add a GitHub repository that contains a `.claude-plugin/marketplace.json` file using the `owner/repo` format, where `owner` is the GitHub username or organization and `repo` is the repository name. For example, `anthropics/claude-code` refers to the `claude-code` repository owned by `anthropics`: - - /plugin marketplace add anthropics/claude-code - -### - -​ - -Add from other Git hosts - -Add a git marketplace repository by providing its full URL. For an `https://` URL, whether to include the `.git` suffix depends on the host: - - * **`github.com` and `gitlab.com`**: Claude Code recognizes a repository URL with or without the `.git` suffix and clones it. Adding a `gitlab.com` URL without the suffix requires Claude Code v2.1.232 or later. Before v2.1.232, Claude Code treated it as a direct link to a hosted `marketplace.json` file. - * **Azure DevOps** : omit the suffix. Claude Code clones any URL whose path contains `/_git/`. If you append `.git` to a `/_git/` path, the clone fails. - * **Every other host, including self-managed GitLab servers** : include the `.git` suffix so Claude Code clones the repository rather than treating the URL as a direct link to a hosted `marketplace.json` file. For a host whose clone URLs don’t carry the suffix, such as AWS CodeCommit, add the marketplace as a git entry in [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) instead. Claude Code clones a git entry whether or not its URL ends in `.git`. - -Claude Code also clones a `gitlab.com` URL with nested subgroups, such as `https://gitlab.com/group/subgroup/project`. Include the `https://` prefix. Claude Code v2.1.196 and later reject a host typed without it, such as `gitlab.com/company/plugins.git`, as an invalid GitHub `owner/repo` shorthand, and the error tells you to add the prefix. Earlier versions misread it as a GitHub repository path and fail at clone time. Using HTTPS: - - /plugin marketplace add https://gitlab.com/company/plugins.git - -Using SSH: - - /plugin marketplace add git@gitlab.com:company/plugins.git - -Claude Code clones an SSH address whether or not it ends in `.git`. To add a specific branch or tag, append `#` followed by the ref: - - /plugin marketplace add https://gitlab.com/company/plugins.git#v1.0.0 - -### - -​ - -Add from local paths - -Add a local directory that contains a `.claude-plugin/marketplace.json` file: - - /plugin marketplace add ./my-marketplace - -You can also add a direct path to a `marketplace.json` file: - - /plugin marketplace add ./path/to/marketplace.json - -### - -​ - -Add from remote URLs - -Add a remote `marketplace.json` file via URL: - - /plugin marketplace add https://example.com/marketplace.json - -URL-based marketplaces have some limitations compared to Git-based marketplaces. If plugin installs from a URL-based marketplace fail, see [Troubleshooting](</docs/en/plugin-marketplaces#plugins-with-relative-paths-fail-in-url-based-marketplaces>). - -### - -​ - -Add from claude.ai - -In terminal sessions where [plugins sync from your claude.ai account](</docs/en/plugins-reference#synced-plugins>), claude.ai can also list marketplaces for you, such as your organization’s plugin library and your own claude.ai uploads. `claude plugin marketplace list` prints them in a `From claude.ai:` section, and the `/plugin` **Marketplaces** tab lists them. Select one there to add it. Adding a marketplace from claude.ai requires Claude Code v2.1.273 or later. To add a marketplace from that list in your shell instead, run `claude plugin marketplace add` with the `--claudeai` flag and the name the list shows: - - claude plugin marketplace add --claudeai claudeai-organization-library - -Claude Code registers the marketplace under a local name that starts with `claudeai-`, derived from the name that claude.ai lists it under: a marketplace listed as “Organization library” registers as `claudeai-organization-library`. Install its plugins by that name, for example with `claude plugin install <plugin>@claudeai-organization-library`. If you sign out or sign in with a different account, the marketplace stays configured but shows no plugins, and the plugins you already installed from it keep loading. The `From claude.ai:` section can also list git-based marketplaces shared through claude.ai. You add those with the ordinary `marketplace add` command, using the source that the list prints. - -## - -​ - -Install plugins - -Once you’ve added marketplaces, you can install a plugin by name. For a marketplace you haven’t added yet, you can instead add it and install in one command. To install by name: - - /plugin install plugin-name@marketplace-name - -The command opens that plugin’s details, where you choose an [installation scope](</docs/en/settings#where-settings-live>). You see the same choices when you run `/plugin`, go to the **Discover** tab, and press **Enter** on a plugin: - - * **User scope** : install for yourself across all projects - * **Project scope** : install for all collaborators on this repository, which adds the plugin to `.claude/settings.json` - * **Local scope** : install for yourself in this repository only, not shared with collaborators - -To install without an interactive step, use the [`claude plugin install`](</docs/en/plugins-reference#plugin-install>) shell command, which installs to user scope unless you pass `--scope`. For a plugin with a [`command` source](</docs/en/plugin-marketplaces#how-users-accept-the-command>), pass `--yes` to accept the command it displays. You may also see plugins with **managed** scope. These are installed by administrators via [managed settings](</docs/en/managed-settings>) and can’t be modified. Claude Code looks the plugin up in its local copy of the marketplace catalog. How you name the plugin controls whether Claude Code refreshes that copy first: - - * **With a marketplace name** : when you install `plugin-name@marketplace-name`, in a session or with `claude plugin install`, Claude Code refreshes that marketplace before the lookup. Claude Code runs the refresh even if you turned off auto-update for the marketplace or set `DISABLE_AUTOUPDATER`. Before v2.1.232, Claude Code didn’t refresh the marketplace before the lookup. Claude Code skips this refresh when: - * The marketplace wasn’t added from GitHub, another Git host, a remote URL, or claude.ai. - * A [seed directory](</docs/en/plugin-marketplaces#pre-populate-plugins-for-containers>) supplies the marketplace. - * Claude Code refreshed the marketplace within the last 30 seconds. - * You set [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>). - * [Managed settings](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) block the marketplace, in which case Claude Code also refuses the install. - * **Plugin name only** : when you run `/plugin install plugin-name` in a session, Claude Code refreshes only the marketplaces it also updates in the background, and only after the lookup misses. When you run `claude plugin install plugin-name`, Claude Code reads the cached catalogs without refreshing. To install a plugin that was published after your last refresh, run `/plugin marketplace update <marketplace-name>` in a session or [`claude plugin marketplace update <marketplace-name>`](</docs/en/plugin-marketplaces#plugin-marketplace-update>) in your shell, then retry the install. - -If the refresh before a named install fails, for example because you’re offline, Claude Code looks the plugin up in the cached catalog anyway. `claude plugin install` reports `marketplace not refreshed` in its success message, and `/plugin install` shows the failure above the plugin’s details or in its not-found message. When you install from the `/plugin` interface, the install summary tells you whether the plugin is active in your current session: - - * `Plugin is now active.`: Claude Code activated the plugin as part of the install. - * `Run /reload-plugins to activate.`: the plugin isn’t active yet, because activating it would [invalidate the prompt cache](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>) or because the activation attempt failed. Claude Code then runs `/reload-plugins` for you. If that reload warns about the prompt cache, run `/reload-plugins --force` to activate the plugin anyway. - * If the plugin fails to load, the summary reports the failure and the `/plugin` **Errors** tab shows the detail. - -Before v2.1.221, no install took effect in the current session until you ran `/reload-plugins` or restarted. The `claude plugin install` shell command doesn’t run in a session, so Claude Code loads the plugins it installs the next time you start Claude Code, or when you run `/reload-plugins` in a session that’s already open. - -Make sure you trust a plugin before installing it. Anthropic doesn’t control what MCP servers, files, or other software are included in plugins and can’t verify that they work as intended. Check each plugin’s homepage for more information. - -### - -​ - -Add a marketplace and install in one command - -To install a plugin from a marketplace you haven’t added yet, name the marketplace source with `--marketplace`. Requires Claude Code v2.1.275 or later. - - /plugin install quality-review-plugin --marketplace your-org/plugins - -The source takes the same forms as `/plugin marketplace add`, such as GitHub `owner/repo`, a git URL, or a local path, except that it can’t contain spaces. Give the plugin name bare, without an `@marketplace` suffix. Claude Code shows the source it resolved and asks you to confirm before adding the marketplace. Declining cancels the install and adds nothing. Once the marketplace is added, the plugin’s details open and you choose an [installation scope](</docs/en/settings#where-settings-live>). If the source matches a marketplace you’ve already added, Claude Code skips the confirmation and opens the plugin’s details in that marketplace. - -## - -​ - -Manage installed plugins - -Run `/plugin` and go to the **Installed** tab to view, enable, disable, or uninstall your plugins. The list is grouped by scope and sorted so you see problems first: plugins with load errors or unresolved dependencies appear at the top, followed by your favorites, with disabled plugins folded behind a collapsed header at the bottom. From the list you can: - - * press `f` to favorite or unfavorite the selected plugin - * type to filter by plugin name or description - * press Enter to open a plugin’s detail view and enable, disable, or uninstall it - -Claude Code also lists the [plugins synced from your claude.ai account](</docs/en/plugins-reference#synced-plugins>) in the **Installed** tab, with `synced` as their source. You can enable or disable one there unless your organization marked it as required. To remove one, turn it off on claude.ai. Synced plugins appear in terminal sessions on Claude Code v2.1.273 or later. When you uninstall a plugin that a project’s `.claude/settings.json` enables, Claude Code asks which scope you mean: disable it for you alone, which writes an override to your `.claude/settings.local.json` and leaves the plugin installed for the project, or uninstall it for everyone, which removes it from the shared `.claude/settings.json`. The detail view shows the components the plugin contributes: commands, skills, agents, hooks, MCP servers, and LSP servers. The same inventory is available from the command line with `claude plugin details`. Claude Code also lists marketplace plugins you installed yourself but haven’t used in at least two weeks, over a span of at least 10 sessions, under a **Not used recently** header in the **Installed** tab. The detail view shows a **Last used** line for each plugin. Use these to find plugins that still add startup and context cost even though you no longer use them, then disable or uninstall them. Two kinds of plugins are never listed as unused: - - * plugins that your organization manages or that you load with `--plugin-dir` - * plugins that contribute a theme, output style, monitor, or workflow, since those deliver value without an invocation to track - -The **Not used recently** header and the **Last used** line are both hidden when your organization restricts marketplaces with [`strictKnownMarketplaces`](</docs/en/settings-reference#strictknownmarketplaces>). A plugin’s [language server](</docs/en/plugins#add-lsp-servers-to-your-plugin>) counts as used when it delivers diagnostics or answers a code navigation request, so an LSP plugin whose server is active in your sessions isn’t listed as unused. Before v2.1.203, language server activity couldn’t be counted as use, so plugins that contribute an LSP server were exempt from the group entirely, the same way theme and output style plugins still are. The first session on a version that counts language server activity also resets the usage record of each LSP plugin that hadn’t recorded any use yet, so Claude Code doesn’t judge a plugin you installed earlier as unused based on data recorded before its server activity was tracked. When you install a plugin that declares dependencies, the install output lists which dependencies were auto-installed alongside it. You can also manage plugins with direct commands: - - * When you run `/plugin disable`, `/plugin enable`, or `/plugin uninstall`, Claude Code opens the plugin panel to make the change and leaves it open. Press **Esc** to close the panel before typing another command. Apply plugin changes without restarting describes when the change takes effect in your session. - * For scripting, use the `claude plugin` shell commands instead, which don’t open the panel. - -List installed plugins without opening the menu: - - /plugin list - -Pass `--enabled` or `--disabled` to show only plugins in that state. Disable a plugin without uninstalling: - - /plugin disable plugin-name@marketplace-name - -Re-enable a disabled plugin: - - /plugin enable plugin-name@marketplace-name - -In these identifiers, `plugin-name` is the plugin’s `name` in the [marketplace entry](</docs/en/plugin-marketplaces#plugin-entries>), which can differ from the `name` in the plugin’s own `plugin.json`. As of Claude Code v2.1.195, **Enable** and **Disable** in the `/plugin` interface work for plugins whose two names differ, and `/plugin enable` and `/plugin disable` accept either name. When you disable such a plugin in an earlier version, Claude Code reports `already disabled` and leaves it enabled. Completely remove a plugin: - - /plugin uninstall plugin-name@marketplace-name - -The `--scope` option lets you target a specific scope with CLI commands: - - claude plugin install formatter@your-org --scope project - claude plugin uninstall formatter@your-org --scope project - -### - -​ - -Apply plugin changes without restarting - -When you close the `/plugin` menu, Claude Code runs `/reload-plugins` for you to apply the changes you made in it, such as installing, enabling, disabling, and uninstalling plugins. If the reload would [invalidate the prompt cache](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>), it warns and leaves the changes pending instead; run `/reload-plugins --force` to apply them anyway. If Claude is still responding when you close the menu, the reload runs after the response finishes. For plugin changes that happen outside the menu, run `/reload-plugins` yourself. These changes include: - - * A `claude plugin` command you ran in another terminal - * Edits to a plugin you loaded with [`--plugin-dir`](</docs/en/plugins#test-your-plugins-locally>) while you develop it - * A plugin auto-update whose notification asks you to reload - * A [sync from your claude.ai account](</docs/en/plugins-reference#synced-plugins>) that added, updated, or removed a plugin and showed a notification asking you to reload - * A change in a [`--plugin-dir` folder](</docs/en/plugins#test-your-plugins-locally>) that Claude Code held because applying it would invalidate the prompt cache - -Before v2.1.268, plugins you enabled, disabled, or uninstalled in the menu, and installs that didn’t activate during the install, stayed pending until you ran `/reload-plugins`. `/reload-plugins` also runs in sessions without an interactive terminal, such as the desktop app, the Agent SDK, and [non-interactive mode](</docs/en/headless>) with `-p`. Requires Claude Code v2.1.260 or later. Two limits apply in those sessions: - - * The command runs only when you type it directly into the session, such as in the `-p` prompt or the desktop app’s prompt box. When you send it over a remote connection instead, such as [Remote Control](</docs/en/remote-control>) or a relayed chat message, the command declines without reloading anything. - * The reload doesn’t connect or disconnect plugin MCP servers. Those changes take effect in your next session. - -Claude Code reloads all active plugins and shows counts for plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers, omitting the plugin MCP server count in a session without an interactive terminal. In the skills count, Claude Code includes every skill a plugin provides: both its `commands/` entries and its `SKILL.md` skills. Before v2.1.246, Claude Code counted only `commands/` entries, so it could reload a plugin’s `SKILL.md` skills and still report `0 skills` in the summary. Reloading has a token cost on the next request: newly loaded components announce themselves in content appended to the conversation, while the existing history still reads from the prompt cache. A plugin that provides MCP servers costs more when its tools aren’t deferred by [tool search](</docs/en/mcp#scale-with-mcp-tool-search>): the change invalidates the cache and the next request re-reads the entire conversation. See [enabling or disabling a plugin](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>) for details. - -## - -​ - -Manage marketplaces - -You can manage marketplaces through the interactive `/plugin` interface or with CLI commands. - -### - -​ - -Use the interactive interface - -Run `/plugin` and go to the **Marketplaces** tab to: - - * View all your added marketplaces with their sources and status - * Add new marketplaces - * Update marketplace listings to fetch the latest plugins - * Remove marketplaces you no longer need - -### - -​ - -Use CLI commands - -You can also manage marketplaces with direct commands. List all configured marketplaces: - - /plugin marketplace list - -Refresh plugin listings from a marketplace: - - /plugin marketplace update marketplace-name - -Remove a marketplace: - - /plugin marketplace remove marketplace-name - -Removing a marketplace will uninstall any plugins you installed from it. - -### - -​ - -Configure auto-updates - -Claude Code can automatically update marketplaces and their installed plugins in the background after startup. When auto-update is enabled for a marketplace, Claude Code refreshes the marketplace data and updates installed plugins to their latest versions on disk. Claude Code checks for marketplace and plugin updates after your session starts, with a random delay of up to ten minutes, so the running session keeps using the versions it loaded at launch. If any plugins were updated, you’ll see a notification prompting you to run `/reload-plugins`, or the new versions load on your next launch. Auto-update also leaves out a plugin whose marketplace entry declares a `headersHelper`: Claude Code [neither runs the command nor downloads the archive](</docs/en/plugin-marketplaces#installs-and-updates-that-refuse-the-command-instead-of-asking>) on that path; that section says when Claude Code lists the plugin in the `/plugin` Errors tab so you can update it from its own view. Claude Code updates plugins that have a [`command` source](</docs/en/plugin-marketplaces#command-sources>) on a separate cadence from the marketplace auto-update setting and from `DISABLE_AUTOUPDATER`. Instead, it [re-runs the command once per session](</docs/en/plugin-marketplaces#when-claude-code-re-runs-the-command>) and installs the output as a new plugin version when its [hash](</docs/en/plugins-reference#version-management>) has changed. Toggle auto-update for individual marketplaces through the UI: - - 1. Run `/plugin` to open the plugin manager - 2. Select **Marketplaces** - 3. Choose a marketplace from the list - 4. Select **Enable auto-update** or **Disable auto-update** - -`claude-plugins-official`, most other official Anthropic marketplaces, and marketplaces added from claude.ai have auto-update enabled by default. Other third-party marketplaces and local development marketplaces have auto-update disabled by default. Administrators can also set `"autoUpdate": true` on each [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) entry in managed settings to enable auto-update for an organization marketplace without requiring each user to toggle it. To disable automatic updates for Claude Code and for plugins fetched from marketplaces, set the `DISABLE_AUTOUPDATER` environment variable. Plugins with a [`command` source](</docs/en/plugin-marketplaces#command-sources>) follow their own once-per-session re-resolve. See [Auto updates](</docs/en/setup#auto-updates>) for details. To keep plugin auto-updates enabled while disabling Claude Code auto-updates, set `FORCE_AUTOUPDATE_PLUGINS=1` along with `DISABLE_AUTOUPDATER`: - - export DISABLE_AUTOUPDATER=1 - export FORCE_AUTOUPDATE_PLUGINS=1 - -## - -​ - -Configure team marketplaces - -Team admins can set up automatic marketplace installation for projects by adding marketplace configuration to `.claude/settings.json`. Once a team member [trusts the repository folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>), Claude Code adds these marketplaces without a further prompt. As of Claude Code v2.1.195, adding the marketplace doesn’t install plugins that come from an external source, on any path that loads plugins. A plugin that only the project’s `.claude/settings.json` enables, and that comes from an external source such as a GitHub repository or npm package, doesn’t load until the team member installs it. Until then, Claude Code reports the plugin as not installed and shows the `claude plugin install` command to run. Add `extraKnownMarketplaces` to your project’s `.claude/settings.json`: - - { - "extraKnownMarketplaces": { - "my-team-tools": { - "source": { - "source": "github", - "repo": "your-org/claude-plugins" - } - } - } - } - -For full configuration options including `extraKnownMarketplaces` and `enabledPlugins`, see [Plugin settings](</docs/en/settings-reference#plugin-settings>). - -## - -​ - -Security - -Plugins and marketplaces are highly trusted components that can execute arbitrary code on your machine with your user privileges. Only install plugins and add marketplaces from sources you trust. Organizations can restrict which marketplaces users are allowed to add using [managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>). - -## - -​ - -Troubleshooting - -### - -​ - -/plugin command not recognized - -If you see “unknown command” or the `/plugin` command doesn’t appear: - - 1. **Check your version** : run `claude --version` to see what’s installed. - 2. **Update Claude Code** : - * **Homebrew** : `brew upgrade claude-code`, or `brew upgrade claude-code@latest` if you installed that cask - * **npm** : `npm install -g @anthropic-ai/claude-code@latest` - * **Native installer** : re-run the install command from [Setup](</docs/en/setup>) - 3. **Restart Claude Code** : after updating, restart your terminal and run `claude` again. - -### - -​ - -Common issues - -If plugin skills don’t appear, clear the cache with `rm -rf ~/.claude/plugins/cache`, restart Claude Code, and reinstall the plugin. For detailed troubleshooting with solutions, see [Troubleshooting](</docs/en/plugin-marketplaces#troubleshooting>) in the marketplace guide. For debugging tools, see [Debugging and development tools](</docs/en/plugins-reference#debugging-and-development-tools>). - -### - -​ - -Code intelligence issues - - * **Language server not starting** : verify the binary is installed and available in your `$PATH`. Check the `/plugin` Errors tab for details. - * **High memory usage** : language servers like `rust-analyzer` and `pyright` can consume significant memory on large projects. If you experience memory issues, disable the plugin with `/plugin disable <plugin-name>` and rely on Claude’s built-in search tools instead. - * **False positive diagnostics in monorepos** : language servers may report unresolved import errors for internal packages if the workspace isn’t configured correctly. These don’t affect Claude’s ability to edit code. - -## - -​ - -Next steps - - * **Build your own plugins** : see [Plugins](</docs/en/plugins>) to create skills, agents, and hooks - * **Create a marketplace** : see [Create a plugin marketplace](</docs/en/plugin-marketplaces>) to distribute plugins to your team or community - * **Technical reference** : see [Plugins reference](</docs/en/plugins-reference>) for complete specifications
removed plugin-dependencies View current →
Show diff (224 lines)
--- a/plugin-dependencies.md +++ b/plugin-dependencies.md @@ -1,221 +0,0 @@ -A plugin can depend on other plugins by listing them in `plugin.json` or in its marketplace entry. By default, a dependency tracks the latest available version, so an upstream release can change the dependency under your plugin without warning. Version constraints let you hold a dependency at a tested version range until you choose to move. When you install a plugin that declares dependencies, Claude Code resolves and installs them automatically, apart from a dependency whose marketplace entry has a [`command` source](</docs/en/plugin-marketplaces#how-users-accept-the-command>) or a [`headersHelper`](</docs/en/plugin-marketplaces#how-users-accept-a-headershelper-command>), which you install yourself first. Later, `/reload-plugins`, auto-update of the dependent plugin’s marketplace, re-running `claude plugin install` on the dependent plugin, and `claude plugin marketplace add` each install any declared dependency that isn’t installed yet, under the same rules; if one stays unresolved, see Resolve dependency errors. This guide is for plugin authors who declare dependencies in `plugin.json` and for marketplace maintainers who tag releases. Dependencies here are other plugins; for the npm and Bun packages a plugin itself uses, see [Node.js package dependencies](</docs/en/plugins-reference#node-js-package-dependencies>). To install plugins that have dependencies, see [Discover and install plugins](</docs/en/discover-plugins>). For the full manifest schema, see the [Plugins reference](</docs/en/plugins-reference>). - -## - -​ - -Why constrain dependency versions - -Consider an internal marketplace where two teams publish plugins. The platform team maintains `secrets-vault`, an MCP server that wraps a secrets backend. The deploy team maintains `deploy-kit`, which calls `secrets-vault` to fetch credentials during deploys. `deploy-kit` is tested against `secrets-vault` v2.1.0. Without a version constraint, the next time the platform team tags a release that renames an MCP tool, auto-update moves every engineer’s `secrets-vault` to the new version and `deploy-kit` breaks. With a version constraint, `deploy-kit` declares that it needs `secrets-vault` in the `~2.1.0` range. Engineers with `deploy-kit` installed stay on the highest matching `2.1.x` patch. The deploy team upgrades on their own schedule by publishing a new `deploy-kit` version with a wider constraint. - -## - -​ - -Declare a dependency with a version constraint - -List dependencies in the `dependencies` array of your plugin’s `.claude-plugin/plugin.json`. The following manifest declares one unversioned dependency and one constrained dependency: - -.claude-plugin/plugin.json - - { - "name": "deploy-kit", - "version": "3.1.0", - "dependencies": [ - "audit-logger", - { "name": "secrets-vault", "version": "~2.1.0" } - ] - } - -An entry can be a bare string with only the plugin name, like `"audit-logger"` in the `deploy-kit` manifest, which depends on whatever version that plugin’s marketplace provides. For more control, use an object with these fields: - -Field| Type| Description ----|---|--- -`name`| string| Plugin name. Resolves within the same marketplace as the declaring plugin. Required. -`version`| string| A [semver range](<https://github.com/npm/node-semver#ranges>) such as `~2.1.0`, `^2.0`, `>=1.4`, or `=2.1.0`. The dependency is fetched at the highest tagged version that satisfies this range. -`marketplace`| string| A different marketplace to resolve `name` in. Cross-marketplace dependencies are blocked unless the target marketplace is listed in `allowCrossMarketplaceDependenciesOn` in the root marketplace’s `marketplace.json`. - -Pre-release versions such as `2.0.0-beta.1` are excluded unless your range opts in with a pre-release suffix like `^2.0.0-0`. - -## - -​ - -Bundle plugins for a team - -Besides the required `name`, a plugin manifest can consist of only a `dependencies` array. Installing it pulls in every dependency, which makes it a way to package a curated plugin set behind one install. For example, a platform team can publish role-specific bundles in an internal marketplace so engineers run one `claude plugin install` instead of installing each tool separately: - -.claude-plugin/plugin.json - - { - "name": "backend-standard", - "version": "1.0.0", - "description": "Standard plugin set for backend engineers", - "dependencies": [ - "secrets-vault", - "deploy-kit", - { "name": "db-migrate", "version": "^3.0" }, - "oncall-runbook" - ] - } - -Installing `backend-standard` resolves and installs all four dependencies. To add a tool to the standard set later, publish a new `backend-standard` version with the extra dependency. Unless the marketplace [auto-updates](</docs/en/discover-plugins#configure-auto-updates>), engineers pick up the new version in one of two ways: - - * Enable auto-update for the marketplace in `/plugin`. The next auto-update moves the bundle to the new version and installs any dependencies it adds. - * Run `claude plugin update backend-standard`, then `/reload-plugins` to install the newly added dependencies. - -To roll bundles out across an organization, add the bundle plugin to `enabledPlugins` in [managed settings](</docs/en/settings-reference#enabledplugins>). - -## - -​ - -Depend on a plugin from another marketplace - -By default, Claude Code refuses to auto-install a dependency that lives in a different marketplace than the plugin declaring it. This prevents one marketplace from silently pulling in plugins from a source you have not reviewed. To allow it, the maintainer of the root marketplace adds the target marketplace name to `allowCrossMarketplaceDependenciesOn` in `marketplace.json`. The root marketplace is the one that hosts the plugin the user is installing; only its allowlist is consulted, so trust does not chain through intermediate marketplaces. The following `marketplace.json` allows `deploy-kit` to depend on a plugin from `acme-shared`: - -.claude-plugin/marketplace.json - - { - "name": "acme-tools", - "owner": { "name": "Acme" }, - "allowCrossMarketplaceDependenciesOn": ["acme-shared"], - "plugins": [ - { - "name": "deploy-kit", - "source": "./deploy-kit", - "dependencies": [ - { "name": "audit-logger", "marketplace": "acme-shared" } - ] - } - ] - } - -If the field is missing or does not include the target marketplace, install fails with a `cross-marketplace` error naming the field to set. Users can still install the dependency manually first, which satisfies the constraint without changing the allowlist. - -## - -​ - -Test a plugin and its dependency locally - -If you’re developing a plugin and the plugin it depends on at the same time, load both with `--plugin-dir`: - - claude --plugin-dir ./my-dependency --plugin-dir ./my-plugin - -The local copy of the dependency satisfies your plugin’s dependency entry, even when the entry names a marketplace, so you don’t need to install the dependency from its marketplace. Claude Code doesn’t check a version constraint against a local copy, so the local `plugin.json` doesn’t need a `version`. Before v2.1.242, a dependency entry that named a marketplace never matched the local copy, and Claude Code disabled your plugin at load. When both plugins sit in one parent folder, you can pass that folder to `--plugin-dir` once. If the folder isn’t itself a plugin, Claude Code loads each child folder that has a `.claude-plugin/plugin.json`. Requires Claude Code v2.1.265 or later. If you haven’t installed the dependency from its marketplace, your plugin stops loading when the local copy goes away: - - * **You disabled the local copy** : Claude Code disables your plugin at the next plugin load. For a dependency entry that names a marketplace, Claude Code reports `Dependency "<name>@inline" is disabled — enable it or remove the dependency`; for a bare-name entry, it reports the dependency by its bare name. `<name>@inline` is how Claude Code identifies every `--plugin-dir` and `--plugin-url` plugin. - * **You started a session without the dependency’s`--plugin-dir` flag**: Claude Code reports the dependency as not installed. Pass the flag again, or install the dependency from its marketplace. - -## - -​ - -Tag plugin releases for version resolution - -Claude Code resolves version constraints against git tags on the repository that hosts the dependency: the plugin’s own repository for `github`, `url`, and `git-subdir` [plugin sources](</docs/en/plugin-marketplaces#plugin-sources>), or the marketplace repository for a plugin the marketplace references by a relative path. For Claude Code to find a dependency’s available versions, the upstream plugin’s releases must be tagged using a specific naming convention. Tag each release as `{plugin-name}--v{version}`, where `{version}` matches the `version` field in that commit’s `plugin.json`. From the plugin directory, run: - - claude plugin tag --push - -The `claude plugin tag` command derives the tag name from the plugin’s manifest and the enclosing marketplace entry. Before creating the tag, it validates the plugin contents, checks that `plugin.json` and the marketplace entry agree on the version, requires a clean working tree under the plugin directory, and refuses if the tag already exists. - - * `--push` pushes the tag to the `origin` remote, so the repository needs a configured `origin` remote. Pass `--remote` to push to a different one. - * If the push fails, the tag is still created locally and the command exits with an error. - * With `--push`, a successful run ends with `Created tag secrets-vault--v2.1.0` and `Pushed to origin`, where the last line names the remote it pushed to. Without `--push`, the command prints the `git push` command to run instead. - * `--dry-run` prints what would be tagged without creating it. - -Running `git tag secrets-vault--v2.1.0` directly is equivalent if you keep `plugin.json` and the marketplace entry in sync yourself. The plugin name prefix lets one marketplace repository host multiple plugins with independent version lines. The `--v` separator is parsed as a prefix match on the full plugin name, so plugin names that contain hyphens are handled correctly. When you install a plugin that declares `{ "name": "secrets-vault", "version": "~2.1.0" }`, Claude Code lists the tags on the repository that hosts `secrets-vault`, filters to those starting with `secrets-vault--v`, and fetches the highest version satisfying `~2.1.0`. If no tag on the plugin’s own repository satisfies the range, the install fails with `Dependency "secrets-vault@acme-tools" has no git tag satisfying ~2.1.0`, which names the dependency together with its marketplace. For a relative-path plugin with no matching tag, Claude Code installs the marketplace’s current copy instead and checks the constraint when the plugin loads. For a plugin the marketplace references by a relative path, a marketplace added as a local folder path resolves tags the same way when the folder is a git repository. This requires Claude Code v2.1.196 or later. In two cases Claude Code installs the dependency from the folder’s current contents instead: - - * Earlier versions don’t read tags from a local-folder marketplace, so a constrained dependency loads only if that copy satisfies the range. - * A local folder that isn’t a git repository has no tags, regardless of version. - -The resolved tag’s semver is recorded separately from `plugin.json`’s `version`, so constraint checks use the tag that was actually fetched even if `plugin.json` at that commit has a stale value. The cache directory name for a tag-resolved install includes a 12-character commit-SHA suffix, so if a maintainer force-moves a tag to a different commit, the next install gets a fresh cache directory instead of reusing stale content. - -For dependencies with an `npm`, `archive`, or `command` [plugin source](</docs/en/plugin-marketplaces#plugin-sources>), the constraint does not control which version is fetched, since tag-based resolution applies only to git-backed sources. The constraint is still checked at load time, and the dependent plugin is disabled with `dependency-version-unsatisfied` if the installed version does not satisfy it. For a `command` source, Claude Code checks the version in the dependency’s `plugin.json` and ignores the content-hash suffix; a dependency whose `plugin.json` sets no version satisfies no constraint, so set one before you constrain it.Claude Code never installs a dependency with a `command` source itself, so users [install it first](</docs/en/plugin-marketplaces#how-users-accept-the-command>). Claude Code never runs the `headersHelper` on a dependency’s marketplace entry either, so users [install that plugin first](</docs/en/plugin-marketplaces#how-users-accept-a-headershelper-command>). - -## - -​ - -How constraints interact - -When several installed plugins constrain the same dependency, Claude Code intersects their ranges and resolves the dependency to the highest version that satisfies all of them. The table below shows how common combinations resolve. - -Plugin A requires| Plugin B requires| Result ----|---|--- -`^2.0`| `>=2.1`| One install at the highest `2.x` tag at or above `2.1.0`. Both plugins load. -`~2.1`| `~3.0`| Install of plugin B fails with `range-conflict`. Plugin A and the dependency stay as they were. -`=2.1.0`| none| The dependency stays at `2.1.0`. Auto-update skips newer versions while plugin A is installed. - -Auto-update fetches a constrained dependency at the highest git tag that satisfies every installed plugin’s range, rather than at the marketplace’s latest version, so the dependency continues to receive updates within its allowed range. If no tag satisfies all ranges, auto-update skips that dependency and lists the skip in the `/plugin` Errors tab, naming the constraining plugin. When you uninstall the last plugin that constrains a dependency, the dependency is no longer held and resumes tracking its marketplace entry on the next update. - -## - -​ - -Enable or disable a plugin with dependencies - -This section covers plugins installed from a marketplace. For a copy you loaded with `--plugin-dir`, see Test a plugin and its dependency locally. Enabling a plugin also enables the plugins it depends on, and disabling a plugin is blocked if another enabled plugin still needs it. When you enable a plugin, Claude Code also enables its dependencies at the same scope. If a dependency has its own dependencies, Claude Code enables those too. The success message lists what else was enabled along with the plugin you named. If a dependency can’t be enabled, the command refuses and tells you what’s blocking and how to fix it: - -Condition| Result ----|--- -A dependency is not installed| Enable fails and prints the `claude plugin install` command for each missing dependency. -A dependency is blocked by your organization’s plugin policy| Enable fails and names the blocked dependency. -A dependency is set to `false` at a scope with higher precedence than the target scope| Enable fails. Enable the dependency at that scope, or pass `--scope` to write there. -All dependencies are installed and allowed| Enable succeeds and writes `true` for the plugin and each dependency that was not already enabled at the target scope. - -This holds even when a dependency sets [`defaultEnabled: false`](</docs/en/plugins-reference#default-enablement>) in its manifest, because Claude Code writes an explicit `true` for it. The same applies at install: a dependency pulled in to satisfy an active plugin installs with `true` regardless of its own default. When you disable a plugin, Claude Code refuses if another enabled plugin still depends on it. The error names the plugins that depend on it and gives you a chained command that disables them in the right order, ending with the one you asked for. For example, if `deploy-kit` depends on `secrets-vault`, disabling `secrets-vault` alone fails with output similar to the following: - - secrets-vault is still required by deploy-kit. Disable that plugin first, or - disable everything together: claude plugin disable deploy-kit@acme-tools && claude plugin disable secrets-vault@acme-tools - -Copy the chained command from the error to disable the full set in one step. - -## - -​ - -Remove orphaned auto-installed dependencies - -Auto-installed dependencies stay on disk after the plugins that installed them are uninstalled, in case you reinstall a dependent plugin or want to keep using the dependency directly. To clean them up, run `claude plugin prune` to list the auto-installed dependencies that no longer have any installed plugin requiring them and remove them after a confirmation prompt. - - claude plugin prune - -If nothing qualifies for removal, the command prints `Nothing to prune` with the reason and exits. This is the expected output on a fresh install, not an error. By default, prune operates at user scope and asks for confirmation before removing anything: - - * `--scope project` or `--scope local` targets a different scope. - * `--dry-run` lists what would be removed without changing anything. - * `-y` skips the confirmation prompt. When stdin or stdout isn’t a terminal, prune lists the orphans and exits without removing them unless you pass `-y`. - -To prune as part of an uninstall, pass `--prune` to `claude plugin uninstall`. After removing the named plugin, Claude Code scans for and removes any auto-installed dependencies that are now orphaned. Plugins you installed yourself are never pruned, only those installed automatically through another plugin’s `dependencies` array. The same confirmation behavior applies. When stdin or stdout isn’t a terminal, the uninstall still completes, but the prune step lists the orphans and removes nothing unless you pass `-y`. For example, to uninstall `deploy-kit` and clean up the dependencies it leaves behind: - - claude plugin uninstall deploy-kit --prune - -## - -​ - -Resolve dependency errors - -Dependency problems appear in `claude plugin list` and in the `/plugin` interface, as descriptive error messages rather than the literal codes in this table. Claude Code disables the affected plugin until you resolve the error. The table below lists the most common errors and how to resolve them. - -Error| Meaning| How to resolve ----|---|--- -`dependency-unsatisfied`| A declared dependency is not installed, or it is installed but disabled.| Run the `claude plugin install` command shown in the error message. If the dependency’s marketplace is not yet configured, add it with `claude plugin marketplace add` and Claude Code resolves the dependency automatically. If the dependency is disabled, enable it. -`range-conflict`| The version requirements for a dependency cannot be combined. The error message names the cause: no version satisfies all of the ranges, a range is not valid semver syntax, or the combined ranges are too complex to intersect.| Uninstall or update one of the conflicting plugins, fix any invalid `version` string, simplify long `||` chains, or ask the upstream author to widen its constraint. -`dependency-version-unsatisfied`| The installed dependency’s version is outside this plugin’s declared range.| Run `claude plugin install <dependency>@<marketplace>` to re-resolve the dependency against all current constraints. -`no-matching-tag`| The dependency’s repository has no `{name}--v*` tag satisfying the range.| Check that the upstream has tagged releases using the convention above, or relax your range. - -To check for these errors programmatically, run `claude plugin list --json`. Plugins with problems include an `errors` field listing them. Plugins that loaded cleanly omit the field. - -## - -​ - -See also - - * [Create plugins](</docs/en/plugins>): build plugins with skills, agents, and hooks - * [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>): host plugins for your team - * [Plugins reference](</docs/en/plugins-reference#plugin-manifest-schema>): the full `plugin.json` schema - * [Version management](</docs/en/plugins-reference#version-management>): how a plugin’s own version is resolved and used as the cache key
removed plugin-hints View current →
Show diff (165 lines)
--- a/plugin-hints.md +++ b/plugin-hints.md @@ -1,162 +0,0 @@ -If you maintain a CLI or SDK and have a plugin in the official Anthropic marketplace, your tool can prompt Claude Code users to install that plugin. Your CLI writes a one-line marker to stderr when it detects it is running inside Claude Code. Claude Code reads the marker, strips it from the output, and shows the user a one-time install prompt. The protocol requires no extra commands and does not change what your CLI prints for users outside Claude Code. This page is for CLI and SDK maintainers. If you are looking to install plugins, see [Discover and install plugins](</docs/en/discover-plugins>). - -## - -​ - -How it works - -Claude Code sets the [`CLAUDECODE`](</docs/en/env-vars>) environment variable to `1` for every command it runs through the Bash and PowerShell tools, and for [hook](</docs/en/hooks>) commands. From v2.1.172 it also sets [`CLAUDE_CODE_CHILD_SESSION`](</docs/en/env-vars>) to `1` in those same subprocesses. When your CLI sees one of these variables, it writes a self-closing `<claude-code-hint />` tag to stderr. In hook commands the hint tag is stripped and ignored. Only Bash and PowerShell tool output triggers the install prompt. When Claude Code receives the command output, it: - - 1. Scans for hint lines and removes them before the output reaches the model - 2. Checks that the hint targets a plugin in an official Anthropic marketplace - 3. Checks that the plugin is not already installed and has not been prompted before - 4. Shows the user an install prompt that names the command that emitted the hint - -Claude Code never installs a plugin automatically. The user always confirms. - -## - -​ - -Emit the hint - -Hint prompts only fire for plugins listed in the official Anthropic marketplace. See Get your plugin into the official marketplace before you ship the integration. Gate emission on an environment variable so the marker is unlikely to appear when a human runs your CLI directly, then write the tag to stderr on its own line. Choose which variable to check: - - * `CLAUDECODE`: set on every Claude Code version, so it reaches the most sessions. It is also set in tmux sessions and stdio MCP server subprocesses that Claude Code starts. IDE extensions also set it in their integrated terminals, where a human may be running your CLI directly. - * `CLAUDE_CODE_CHILD_SESSION`: set only in subprocesses Claude Code itself spawns, such as tool calls, hook commands, and [status line](</docs/en/statusline>) commands, so the tag does not normally reach a human terminal. A long-lived process that was started inside a session, such as a tmux server, captures the variable, so shells later launched from that process still show the raw tag. - -The following examples gate on `CLAUDECODE` for maximum reach and emit a hint for a plugin named `example-cli` in the official marketplace: - -Node.js - -Python - -Go - -Shell - - if (process.env.CLAUDECODE) { - process.stderr.write( - '<claude-code-hint v="1" type="plugin" value="example-cli@claude-plugins-official" />\n', - ) - } - - import os, sys - - if os.environ.get("CLAUDECODE"): - print( - '<claude-code-hint v="1" type="plugin" value="example-cli@claude-plugins-official" />', - file=sys.stderr, - ) - - if os.Getenv("CLAUDECODE") != "" { - fmt.Fprintln(os.Stderr, - `<claude-code-hint v="1" type="plugin" value="example-cli@claude-plugins-official" />`) - } - - if [ -n "$CLAUDECODE" ]; then - printf '%s\n' '<claude-code-hint v="1" type="plugin" value="example-cli@claude-plugins-official" />' >&2 - fi - -Replace `example-cli` with your plugin’s name in the official marketplace. - -## - -​ - -Choose where to emit - -You control which code paths emit the hint. Claude Code deduplicates by plugin, so emitting on every invocation has no downside. Touchpoints that work well include: - -Placement| Why it works ----|--- -`--help` output| Claude often runs help when exploring an unfamiliar CLI -Unknown-subcommand errors| Reaches the moment Claude is confused about your interface -Login or auth success| The user is already in a setup mindset -First-run welcome message| A natural onboarding moment - -## - -​ - -What the user sees - -When the hint passes all checks, Claude Code shows a prompt like the following: - - ───────────────────────────────────────────────────────────── - Plugin recommendation - - The example-cli command suggests installing a plugin. - - Plugin: example-cli - Marketplace: claude-plugins-official - Official integration for example-cli deployments - - Would you like to install it? - ❯ 1. Yes, install example-cli - 2. No - 3. No, and don't show plugin installation hints again - - ───────────────────────────────────────────────────────────── - -The prompt names the command that produced the hint so users can spot a mismatch between the tool and the plugin it recommends. If the user doesn’t respond within 30 seconds, Claude Code dismisses the prompt as **No**. Prompt frequency is bounded, and some sessions never prompt: - - * **Once per plugin** : after the prompt is shown, Claude Code records the plugin and never prompts for it again, regardless of the user’s answer. - * **Once per session** : across all CLIs on the machine, at most one hint prompt appears per Claude Code session. - * **Main interactive session only** : Claude Code shows the prompt only in the terminal session the user is typing into. Claude Code never prompts for a command that a [subagent](</docs/en/sub-agents>) runs, and never prompts when the user runs Claude Code in [non-interactive mode](</docs/en/headless>) with the `-p` flag or through the [Agent SDK](</docs/en/agent-sdk/overview>). Claude Code still strips the hint line from the command output in all of these cases. - * **Telemetry opt-outs** : sessions where analytics are disabled never show hint prompts. This includes sessions with `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` set, and sessions on third-party providers such as Amazon Bedrock or Google Cloud’s Agent Platform where the [automatic telemetry opt-out](</docs/en/data-usage#default-behaviors-by-api-provider>) applies. - -Selecting **Yes** installs the plugin to user scope. Selecting **No, and don’t show plugin installation hints again** disables all future hint prompts for the user. - -## - -​ - -Hint format - -The hint is a self-closing tag with three required attributes. - - <claude-code-hint v="1" type="plugin" value="example-cli@claude-plugins-official" /> - -Attribute| Required| Description ----|---|--- -`v`| Yes| Protocol version. `1` is the only supported value -`type`| Yes| Hint kind. `plugin` is the only supported value -`value`| Yes| Plugin identifier in `name@marketplace` form - -Attribute values may be quoted with double quotes or left unquoted. Unquoted values cannot contain whitespace. Escape sequences are not supported. - -## - -​ - -Requirements - -Claude Code enforces two conditions before acting on a hint. Hints that fail either check are dropped: - - * **Own line** : the tag must occupy its own line. A tag embedded mid-line, for example inside a log statement, is ignored. Leading and trailing whitespace on the line is allowed. - * **Official marketplace** : the `value` must reference a plugin in an Anthropic-controlled marketplace such as `claude-plugins-official`. Hints that point to other marketplaces are silently dropped. - -The hint line is always removed from the output before it reaches the model, even when the version or type is unrecognized, so the marker is never counted toward token usage. The remaining guidance is recommended but not enforced. Claude Code cannot observe whether your CLI follows it: - - * **Write to stderr** : stderr keeps the tag out of shell pipelines such as `example-cli deploy | jq`. Claude Code scans both streams, so stdout also works. - * **Gate on an environment variable** : only emit when `CLAUDECODE` or `CLAUDE_CODE_CHILD_SESSION` is set. See Emit the hint for how the two variables differ. - -## - -​ - -Get your plugin into the official marketplace - -The hint protocol only takes effect for plugins listed in the official Anthropic marketplace, `claude-plugins-official`. Anthropic curates that marketplace at its discretion, and the in-app submission forms add plugins to the [community marketplace](</docs/en/plugins#submit-your-plugin-to-the-community-marketplace>) instead, which the hint protocol does not check. If you are working with an Anthropic partner contact, reach out to them to coordinate an official-marketplace listing. - -## - -​ - -See also - - * [Create plugins](</docs/en/plugins>): build the plugin your CLI recommends - * [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>): host plugins outside the official marketplace - * [Environment variables](</docs/en/env-vars>): full reference for `CLAUDECODE` and related variables
removed plugin-marketplaces View current →
Show diff (1504 lines)
--- a/plugin-marketplaces.md +++ b/plugin-marketplaces.md @@ -1,1501 +0,0 @@ -A **plugin marketplace** is a catalog that lets you distribute plugins to others. Marketplaces provide centralized discovery, version tracking, automatic updates, and support for multiple source types, including git repositories and local paths. This guide shows you how to create your own marketplace to share plugins with your team or community. Looking to install plugins from an existing marketplace? See [Discover and install prebuilt plugins](</docs/en/discover-plugins>). - -## - -​ - -Overview - -Creating and distributing a marketplace involves: - - 1. **Create plugins** : build one or more plugins with skills, agents, hooks, MCP servers, or LSP servers. This guide assumes you already have plugins to distribute; see [Create plugins](</docs/en/plugins>) for details on how to create them. - 2. **Create the marketplace file** : define a `marketplace.json` that lists your plugins and where to find them. See Create the marketplace file. - 3. **Host the marketplace** : push to GitHub, GitLab, or another git host. See Host and distribute marketplaces. - 4. **Share with users** : users add your marketplace with `/plugin marketplace add` and install individual plugins. See [Discover and install plugins](</docs/en/discover-plugins>). - -Once your marketplace is live, you can update it by pushing changes to your repository. Users refresh their local copy with `/plugin marketplace update`. - -## - -​ - -Walkthrough: create a local marketplace - -This example creates a marketplace with one plugin: a `quality-review` skill for code reviews. You’ll create the directory structure, add a skill, create the plugin manifest and marketplace catalog, then install and test it. - -1 - -Create the directory structure - - mkdir -p my-marketplace/.claude-plugin - mkdir -p my-marketplace/plugins/quality-review-plugin/.claude-plugin - mkdir -p my-marketplace/plugins/quality-review-plugin/skills/quality-review - -2 - -Create the skill - -Create a `SKILL.md` file that defines what the `quality-review` skill does. - -my-marketplace/plugins/quality-review-plugin/skills/quality-review/SKILL.md - - --- - description: Review code for bugs, security, and performance - --- - - Review the code I've selected or the recent changes for: - - Potential bugs or edge cases - - Security concerns - - Performance issues - - Readability improvements - - Be concise and actionable. - -3 - -Create the plugin manifest - -Create a `plugin.json` file that describes the plugin. The manifest goes in the `.claude-plugin/` directory. - -my-marketplace/plugins/quality-review-plugin/.claude-plugin/plugin.json - - { - "name": "quality-review-plugin", - "description": "Adds a quality-review skill for quick code reviews", - "version": "1.0.0", - "author": { - "name": "Your Name" - } - } - -Setting `version` means users only receive updates when you change this field, so bump it on every release. A plugin with a `command` source isn’t pinned by this field. Neither is a plugin [loaded in place](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) from a marketplace added as a local directory. If you omit `version`, the version comes from the next source in [version management](</docs/en/plugins-reference#version-management>). - -4 - -Create the marketplace file - -Create the marketplace catalog that lists your plugin. - -my-marketplace/.claude-plugin/marketplace.json - - { - "name": "my-plugins", - "owner": { - "name": "Your Name" - }, - "plugins": [ - { - "name": "quality-review-plugin", - "source": "./plugins/quality-review-plugin", - "description": "Adds a quality-review skill for quick code reviews" - } - ] - } - -5 - -Add and install - -From the directory that contains `my-marketplace`, start Claude Code and run the following commands. The install command opens a plugin details view where you select an installation scope to confirm the install. Check the install summary: if it reports `Run /reload-plugins to activate.`, see [Apply plugin changes without restarting](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>). - - /plugin marketplace add ./my-marketplace - /plugin install quality-review-plugin@my-plugins - -6 - -Try it out - -Select some code in your editor and run your new skill. Plugin skills are namespaced with the plugin name. - - /quality-review-plugin:quality-review - -To learn more about what plugins can do, including hooks, agents, MCP servers, and LSP servers, see [Plugins](</docs/en/plugins>). - -**How plugins are installed** : when users install a plugin, Claude Code copies the plugin directory to a cache location, unless the plugin loads in place. A `command` source in link mode loads in place, and so does a relative path source in a marketplace added from a local directory. Copied plugins can’t reference files outside their directory using paths like `../shared-utils`, because those files won’t be copied.If you need to share files across plugins, use symlinks. See [Plugin caching and file resolution](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for details. - -## - -​ - -Create the marketplace file - -Create `.claude-plugin/marketplace.json` in your repository root. This file defines your marketplace’s name, owner information, and a list of plugins with their sources. Each plugin entry needs at minimum a `name` and a `source` that tells Claude Code where to fetch it from. See the full schema below for all available fields. - - { - "name": "company-tools", - "owner": { - "name": "DevTools Team", - "email": "devtools@example.com" - }, - "plugins": [ - { - "name": "code-formatter", - "source": "./plugins/formatter", - "description": "Automatic code formatting on save", - "version": "2.1.0", - "author": { - "name": "DevTools Team" - } - }, - { - "name": "deployment-tools", - "source": { - "source": "github", - "repo": "company/deploy-plugin" - }, - "description": "Deployment automation tools" - } - ] - } - -## - -​ - -Marketplace schema - -### - -​ - -Required fields - -Field| Type| Description| Example ----|---|---|--- -`name`| string| Marketplace identifier in kebab-case, with no spaces, control characters, or bidirectional-formatting characters. This is public-facing: users see it when installing plugins (for example, `/plugin install my-tool@your-marketplace`). Each user can register only one marketplace per name: when they add a second marketplace with the same name, Claude Code replaces the first. To publish multiple plugins under one marketplace name, list them all in a single `marketplace.json`.| `"acme-tools"` -`owner`| object| Marketplace maintainer information. See Owner fields| -`plugins`| array| List of available plugins| See Plugin entries - -**Reserved names** : the following marketplace names are reserved for official Anthropic use and can’t be used by third-party marketplaces: `claude-code-marketplace`, `claude-code-plugins`, `claude-plugins-official`, `claude-plugins-community`, `claude-community`, `anthropic-marketplace`, `anthropic-plugins`, `agent-skills`, `anthropic-agent-skills`, `knowledge-work-plugins`, `life-sciences`, `claude-for-legal`, `claude-for-financial-services`, `financial-services-plugins`, `first-party-plugins`, `claude-tag-plugins`, `healthcare`. Names that impersonate official marketplaces, such as `official-claude-plugins` or `anthropic-plugins-v2`, are also blocked. Reserving these names prevents a third-party marketplace from presenting itself as an Anthropic-published source.Claude Code re-checks reserved names every time it loads a marketplace, not only when you add one. A marketplace that was registered under one of these names before the name became reserved stops loading and reports that it is [registered from an untrusted source](</docs/en/errors#marketplace-is-registered-from-an-untrusted-source>). Remove that marketplace and re-add it from the official Anthropic source. A third-party marketplace affected by a newly reserved name loads again as soon as you re-add it under a different name. Before v2.1.205, `first-party-plugins` and `healthcare` weren’t reserved, and a marketplace already registered under a reserved name kept loading. Before v2.1.265, `claude-tag-plugins` wasn’t reserved.You also can’t name a marketplace `npm`, `pip`, `uv`, `cargo`, `github`, or `gh`, in any casing. This check requires Claude Code v2.1.275 or later. - -### - -​ - -Owner fields - -Field| Type| Required| Description ----|---|---|--- -`name`| string| Yes| Name of the maintainer or team -`email`| string| No| Contact email for the maintainer -`url`| string| No| Website, GitHub profile, or organization URL - -### - -​ - -Optional fields - -Field| Type| Description ----|---|--- -`$schema`| string| JSON Schema URL for editor autocomplete and validation. Claude Code ignores this field at load time. -`description`| string| Brief marketplace description -`version`| string| Marketplace manifest version -`metadata.pluginRoot`| string| Directory that Claude Code resolves bare plugin source names under. See Relative paths. Requires Claude Code v2.1.239 or later. -`allowCrossMarketplaceDependenciesOn`| array| Other marketplaces that plugins in this marketplace may depend on. Dependencies from a marketplace not listed here are blocked at install. See [Depend on a plugin from another marketplace](</docs/en/plugin-dependencies#depend-on-a-plugin-from-another-marketplace>). -`renames`| object| Map from a former plugin `name` to its current name, or to `null` if the plugin was removed. Lets existing users migrate automatically when you rename or remove an entry in `plugins`. See Rename or remove a plugin. Requires Claude Code v2.1.193 or later. - -`description` and `version` are also accepted under `metadata` for backward compatibility. - -## - -​ - -Plugin entries - -Each plugin entry in the `plugins` array describes a plugin and where to find it. You can include any field from the [plugin manifest schema](</docs/en/plugins-reference#plugin-manifest-schema>), such as `description`, `version`, `author`, `commands`, and `hooks`, plus these marketplace-specific fields: `source`, `category`, `tags`, `strict`, `relevance`, `headers`, and `headersHelper`. - -### - -​ - -Required fields - -Field| Type| Description ----|---|--- -`name`| string| Plugin identifier in kebab-case, with no spaces, control characters, or bidirectional-formatting characters. This is public-facing: users see it when installing (for example, `/plugin install my-plugin@marketplace`). -`source`| string|object| Where to fetch the plugin from (see Plugin sources below) - -### - -​ - -Optional plugin fields - -**Standard metadata fields:** - -Field| Type| Description ----|---|--- -`displayName`| string| Human-readable name shown in UI surfaces. When neither the entry nor the plugin’s `plugin.json` sets one, users see the plugin’s `name`. May contain spaces and any casing. Not used for namespacing or lookup. -`description`| string| Brief plugin description -`version`| string| Plugin version. If set (here or in `plugin.json`), the plugin is pinned to this string and users only receive updates when it changes. A plugin with a `command` source isn’t pinned by either field. Neither is a plugin [loaded in place](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) from a marketplace added as a local directory. If set in neither place, the version comes from the next source in [version management](</docs/en/plugins-reference#version-management>). -`author`| object| Plugin author information (`name` required; `email` and `url` optional) -`homepage`| string| Plugin homepage or documentation URL -`repository`| string| Source code repository URL -`license`| string| SPDX license identifier (for example, MIT, Apache-2.0) -`keywords`| array| Tags for plugin discovery and categorization -`metadata`| object| Free-form object for your own fields, such as entitlement or catalog data. Claude Code doesn’t read it. Before v2.1.222, `claude plugin validate` reported the key as an unrecognized field. -`category`| string| Plugin category for organization -`tags`| array| Tags for searchability -`strict`| boolean| Controls whether `plugin.json` is the authority for component definitions (default: true). See Strict mode below. -`relevance`| object| Signals that tell Claude Code when to suggest this plugin to users. Takes effect only for marketplaces an administrator allowlists in managed settings. See [Recommend plugins for your org](</docs/en/plugin-relevance>). -`defaultEnabled`| boolean| Whether the plugin is enabled after install (default: true). Set to `false` to install the plugin disabled until the user opts in. Takes precedence over the same field in the plugin’s `plugin.json`. See [Default enablement](</docs/en/plugins-reference#default-enablement>). - -Both the entry and the plugin’s own `plugin.json` can set the display fields `displayName`, `description`, `author`, `homepage`, `repository`, `license`, and `keywords`. In plugin listings and details, before and after install: - - * For a field you set on the entry, users see the entry’s value, even when `plugin.json` sets a different one. - * For a field the entry leaves unset, users see the `plugin.json` value. - -Before install, Claude Code can read `plugin.json` only for entries with a relative-path source, whose plugin files live inside the marketplace itself. For an entry with any other source type, users see only the entry’s own fields until they install the plugin. **Component configuration fields:** - -Field| Type| Description ----|---|--- -`skills`| string|array| Custom paths to skill directories containing `<name>/SKILL.md` -`commands`| string|array| Custom paths to flat `.md` skill files or directories -`agents`| string|array| Custom paths to agent files -`hooks`| string|object| Custom hooks configuration or path to hooks file -`mcpServers`| string|object| MCP server configurations or path to MCP config -`lspServers`| string|object| LSP server configurations or path to LSP config - -**Archive authentication fields:** Set these when the entry has an `archive` source on a server that requires credentials. - -Field| Type| Description ----|---|--- -`headers`| object| HTTP headers Claude Code sends when it downloads this entry’s archive. Overrides the marketplace’s headers of the same name. Requires Claude Code v2.1.238 or later. -`headersHelper`| string| Command that prints the HTTP headers for this entry’s archive download as one JSON object, for a credential that expires. See Authenticate archive downloads. The entry must also set `"strict": false`. Requires Claude Code v2.1.238 or later. - -## - -​ - -Plugin sources - -Plugin sources tell Claude Code where to get each individual plugin listed in your marketplace. These are set in the `source` field of each plugin entry in `marketplace.json`. Claude Code copies each installed plugin into the local versioned plugin cache at `~/.claude/plugins/cache`, unless the plugin loads in place. A `command` source in link mode loads in place, and so does a relative path source in a marketplace added from a local directory. Claude Code also [installs the plugin’s eligible Node.js package dependencies](</docs/en/plugins-reference#node-js-package-dependencies>) into the cached copy. See [Plugin caching and file resolution](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how a plugin loaded in place from a local-directory marketplace picks up your edits. - -Source| Type| Fields| Notes ----|---|---|--- -Relative path| `string` (for example, `"./my-plugin"`)| none| Local directory within the marketplace repo. Must start with `./`, unless you write a bare name under `metadata.pluginRoot`. Claude Code resolves the path relative to the marketplace root, not the `.claude-plugin/` directory -`github`| object| `repo`, `ref?`, `sha?`| -`url`| object| `url`, `ref?`, `sha?`| Git URL source -`git-subdir`| object| `url`, `path`, `ref?`, `sha?`| Subdirectory within a git repo. Clones sparsely to minimize bandwidth for monorepos -`npm`| object| `package`, `version?`, `registry?`| npm package, fetched with your npm client and unpacked without running install scripts -`archive`| object| `url`, `sha256?`| Zip archive downloaded over HTTPS. Works without git or npm on the user’s machine. Requires Claude Code v2.1.224 or later -`command`| object| `command`, `timeout?`, `mode?`| Plugin directory produced by running a local command, re-run once per session to pick up changes. Requires Claude Code v2.1.229 or later - -**Marketplace sources vs plugin sources** : These are different concepts that control different things. - - * **Marketplace source** : where to fetch the `marketplace.json` catalog itself. Set when users run `/plugin marketplace add` or in `extraKnownMarketplaces` settings. Git-based marketplace sources support `ref` (branch/tag) but not `sha`. - * **Plugin source** : where to fetch an individual plugin listed in the marketplace. Set in the `source` field of each plugin entry inside `marketplace.json`. Git-based plugin sources support both `ref` (branch/tag) and `sha` (exact commit). - -For example, a marketplace hosted at `acme-corp/plugin-catalog` (marketplace source) can list a plugin fetched from `acme-corp/code-formatter` (plugin source). The marketplace source and plugin source point to different repositories and are pinned independently. - -The git-based source types below are `github`, `url`, and `git-subdir`. When both `ref` and `sha` are set on any of them, the `sha` is the effective pin. Claude Code fetches and checks out the pinned commit directly. On most git hosts, including GitHub, GitLab, and Bitbucket, this means installation succeeds even if the branch or tag named by `ref` has since been deleted upstream, as long as the commit is still reachable from the repository. Some servers, such as AWS CodeCommit, don’t support fetching commits by SHA. On those servers the `ref` must still exist and the pinned commit must be reachable from it. If you distribute plugins through **Organization settings > Plugins**, only some source types are allowed. See Distribute through organization settings. - -### - -​ - -Relative paths - -For plugins in the same repository, use a path starting with `./`: - - { - "name": "my-plugin", - "source": "./plugins/my-plugin" - } - -Paths resolve relative to the marketplace root, which is the directory containing `.claude-plugin/`. The source `./plugins/my-plugin` therefore points to `<repo>/plugins/my-plugin`, even though `marketplace.json` lives at `<repo>/.claude-plugin/marketplace.json`. Don’t use `../` to reference paths outside the marketplace root. On macOS and Linux, Claude Code refuses an entry path with a backslash anywhere past the leading `./`, so write the separators as `/` on every platform. A bare name is a single directory name with no `/`, such as `"formatter"`. To write bare names instead of `./` paths, set `metadata.pluginRoot` to the directory they resolve under. With `"pluginRoot": "./plugins"`, Claude Code resolves `"source": "formatter"` to `./plugins/formatter`. Requires Claude Code v2.1.239 or later. `metadata.pluginRoot` must itself be a relative path inside the marketplace. Claude Code ignores it for a source that already starts with `./`. A source that contains a `/`, such as `team-a/formatter`, isn’t a bare name and still needs the `./` prefix, even when `metadata.pluginRoot` is set. - -Claude Code resolves relative paths against a local copy of the marketplace, so they work when users add your marketplace from a git source or a local directory. If users add your marketplace via a direct URL to the `marketplace.json` file, relative paths won’t resolve, because Claude Code downloads only that file. For URL-based distribution, use any other plugin source instead. See Troubleshooting for details. - -### - -​ - -GitHub repositories - - { - "name": "github-plugin", - "source": { - "source": "github", - "repo": "owner/plugin-repo" - } - } - -You can pin to a specific branch, tag, or commit: - - { - "name": "github-plugin", - "source": { - "source": "github", - "repo": "owner/plugin-repo", - "ref": "v2.0.0", - "sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0" - } - } - -Field| Type| Description ----|---|--- -`repo`| string| Required. GitHub repository in `owner/repo` format -`ref`| string| Optional. Git branch or tag (defaults to repository default branch) -`sha`| string| Optional. Full 40-character git commit SHA to pin to an exact version - -### - -​ - -Git repositories - - { - "name": "git-plugin", - "source": { - "source": "url", - "url": "https://gitlab.com/team/plugin.git" - } - } - -You can pin to a specific branch, tag, or commit: - - { - "name": "git-plugin", - "source": { - "source": "url", - "url": "https://gitlab.com/team/plugin.git", - "ref": "main", - "sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0" - } - } - -Field| Type| Description ----|---|--- -`url`| string| Required. Full git repository URL (`https://` or `git@`). The `.git` suffix is optional, so Azure DevOps and AWS CodeCommit URLs without the suffix work -`ref`| string| Optional. Git branch or tag (defaults to repository default branch) -`sha`| string| Optional. Full 40-character git commit SHA to pin to an exact version - -### - -​ - -Git subdirectories - -Use `git-subdir` to point to a plugin that lives inside a subdirectory of a git repository. Claude Code uses a sparse, partial clone to fetch only the subdirectory, minimizing bandwidth for large monorepos. - - { - "name": "my-plugin", - "source": { - "source": "git-subdir", - "url": "https://github.com/acme-corp/monorepo.git", - "path": "tools/claude-plugin" - } - } - -You can pin to a specific branch, tag, or commit: - - { - "name": "my-plugin", - "source": { - "source": "git-subdir", - "url": "https://github.com/acme-corp/monorepo.git", - "path": "tools/claude-plugin", - "ref": "v2.0.0", - "sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0" - } - } - -The `url` field also accepts a GitHub shorthand (`owner/repo`) or SSH URLs (`git@github.com:owner/repo.git`). - -Field| Type| Description ----|---|--- -`url`| string| Required. Git repository URL, GitHub `owner/repo` shorthand, or SSH URL -`path`| string| Required. Subdirectory path within the repo containing the plugin (for example, `"tools/claude-plugin"`) -`ref`| string| Optional. Git branch or tag (defaults to repository default branch) -`sha`| string| Optional. Full 40-character git commit SHA to pin to an exact version - -### - -​ - -npm packages - -An npm source can name any package on the public npm registry or on a private registry your team hosts. Claude Code resolves the package with your npm client, downloads the tarball, and unpacks it into the plugin cache. The package’s install scripts, such as `preinstall` or `postinstall`, never run, and its dependencies aren’t installed during the fetch. If the package ships a supported lockfile beside its `package.json`, Claude Code installs those [Node.js package dependencies](</docs/en/plugins-reference#node-js-package-dependencies>) in a separate step, also with scripts disabled. Otherwise, publish the plugin with everything it needs already built. An MCP server that needs other packages can launch through `npx`, which installs them at first run. - - { - "name": "my-npm-plugin", - "source": { - "source": "npm", - "package": "@acme/claude-plugin" - } - } - -To pin to a specific version, add the `version` field: - - { - "name": "my-npm-plugin", - "source": { - "source": "npm", - "package": "@acme/claude-plugin", - "version": "2.1.0" - } - } - -To install from a private or internal registry, add the `registry` field: - - { - "name": "my-npm-plugin", - "source": { - "source": "npm", - "package": "@acme/claude-plugin", - "version": "^2.0.0", - "registry": "https://npm.example.com" - } - } - -Field| Type| Description ----|---|--- -`package`| string| Required. Package name or scoped package (for example, `@org/plugin`) -`version`| string| Optional. Version or version range (for example, `2.1.0`, `^2.0.0`, `~1.5.0`) -`registry`| string| Optional. Custom npm registry URL. Defaults to the system npm registry (typically npmjs.org) - -### - -​ - -Zip archives - -Use `archive` to distribute a plugin as a zip file that Claude Code downloads over HTTPS, so installs work without git or npm on the user’s machine. Host the file on any static file server or artifact repository, such as an S3 bucket, an Artifactory generic repository, or nginx. Requires Claude Code v2.1.224 or later. On versions v2.1.120 through v2.1.223, installing the plugin fails with `This plugin uses a source type your Claude Code version does not support. Update Claude Code and try again.`; on older versions, a marketplace containing an `archive` entry fails to load entirely. This entry installs the plugin from a zip file on an artifact server: - - { - "name": "my-plugin", - "source": { - "source": "archive", - "url": "https://artifacts.example.com/claude-plugins/my-plugin-2.1.0.zip" - } - } - -When you build the zip, you can zip the plugin’s contents directly or zip the plugin folder itself. Claude Code looks for `.claude-plugin/` at the top of the archive, then inside a single top-level folder, so both layouts install: - - my-plugin.zip my-plugin.zip - ├── .claude-plugin/ └── my-plugin/ - │ └── plugin.json ├── .claude-plugin/ - └── commands/ │ └── plugin.json - └── commands/ - -Claude Code doesn’t look deeper than one folder, so a plugin nested further down fails to install. Claude Code refuses archives larger than 256 MiB. To pin the exact file, add a `sha256` field with the archive’s digest: - - { - "name": "my-plugin", - "source": { - "source": "archive", - "url": "https://artifacts.example.com/claude-plugins/my-plugin-2.1.0.zip", - "sha256": "6bfa50e3d2e00c052b46abe51fff89346ac803e45771f76dcf6df1ab74cca5e1" - } - } - -If the downloaded file doesn’t match the pin, Claude Code refuses the install and reports [`Plugin archive integrity check failed`](</docs/en/errors#plugin-archive-integrity-check-failed>). Archive sources accept these fields: - -Field| Type| Description ----|---|--- -`url`| string| Required. HTTPS URL of the zip archive. Claude Code rejects `http://` URLs, along with loopback, link-local, and cloud-metadata hosts. Every redirect hop must satisfy the same rules, or Claude Code refuses the download -`sha256`| string| Optional. SHA-256 digest of the archive as 64 hex characters, uppercase or lowercase. Claude Code verifies every download against it and refuses the install on a mismatch - -The `sha256` digest also serves as the plugin’s version when neither `plugin.json` nor the marketplace entry declares one. See [Version management](</docs/en/plugins-reference#version-management>). If you declare a `version`, that version string is the update signal, so after changing the zip and its digest, bump the version too, or users keep the cached copy. - -#### - -​ - -Authenticate archive downloads - -To authenticate an archive download, such as a download from a private registry, set the HTTP headers Claude Code sends with it. Set `headers` on the `url` source you registered the marketplace from, such as an [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) entry. On Claude Code v2.1.238 or later, you can set it on the plugin’s entry instead, beside `source`. If the value you would put in `headers` is short-lived, such as a token your registry mints on request, set a `headersHelper` command in the same place instead. Claude Code runs the command and sends the JSON object it prints as that place’s headers. Requires Claude Code v2.1.238 or later. The place you choose decides which downloads get the headers and when Claude Code runs the command: - -Place| Downloads that get the headers| When Claude Code runs a `headersHelper` set there ----|---|--- -Marketplace `url` source| Archive downloads on the marketplace URL’s origin, meaning the same scheme, host, and port| Before each fetch of the marketplace’s `marketplace.json` and before each archive download on that origin. Claude Code reuses one run’s output for up to 60 seconds -Plugin entry| That entry’s download only| Only when a user installs or updates that one plugin by itself and accepts the command - -Where both places set a header of the same name, Claude Code sends the entry’s value. Within one place, a header the command prints overrides a header of the same name listed in `headers`. - -##### Add a headersHelper to a plugin entry - -This entry sets `headersHelper` beside `source`. It also sets `"strict": false`, which Claude Code requires of a `marketplace.json` entry that sets `headersHelper`. With `"strict": false`, the marketplace entry is the plugin’s entire definition, so a user can review what the plugin contains before accepting the command: - - { - "name": "my-plugin", - "description": "Formatting commands for internal services", - "strict": false, - "commands": "./commands", - "source": { - "source": "archive", - "url": "https://registry.example.com/plugins/my-plugin-2.1.0.zip" - }, - "headersHelper": "/opt/bin/mint-registry-token.sh" - } - -To check the entry, run `claude plugin install my-plugin@your-marketplace`. Claude Code shows you the command and the archive URL, and downloads the zip after you accept. Before v2.1.238, Claude Code downloaded an entry’s archive without its `headers` or `headersHelper`, so an install that relied on them failed with `HTTP 401 while downloading plugin archive from`, followed by the URL, with the registry’s status code in place of 401. - -#### - -​ - -Write the headersHelper command - -Whether you set `headersHelper` on a marketplace’s `url` source or on a plugin entry, write the command to meet these requirements: - - * **Command text** : at most 500 characters of printable ASCII, with no run of four or more spaces. - * **Output** : print one JSON object of header names and string values on stdout, then exit 0 within 10 seconds. - * **Shell and working directory** : Claude Code runs the command through `sh`, or `cmd.exe` on Windows, from the configuration directory, `~/.claude` or [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars#variables>). Give an absolute path or a command on `PATH`, because a relative path resolves against that directory, not the user’s project. - * **Variables Claude Code removes** : from the environment of a command set in a `marketplace.json` entry or in a project’s `.claude/settings.json` or `.claude/settings.local.json`, Claude Code removes every variable whose name contains a word such as `TOKEN`, `SECRET`, `KEY`, or `AUTH`, including `ANTHROPIC_API_KEY`. Claude Code doesn’t apply this removal to a command set in user settings, a `--settings` file, or managed settings. - * **Variables Claude Code sets** : `CLAUDE_CODE_MARKETPLACE_URL` and `CLAUDE_CODE_MARKETPLACE_NAME` for a `url` source’s command, and `CLAUDE_CODE_PLUGIN_NAME` and `CLAUDE_CODE_PLUGIN_ARCHIVE_URL` for an entry’s command. `CLAUDE_CODE_MARKETPLACE_NAME` is unset on the first fetch after a user adds a marketplace by URL, because that fetch is what supplies the name. - -A command that mints a bearer token prints an object like this one: - - {"Authorization": "Bearer eyJhbGciOiJSUzI1NiJ9"} - -#### - -​ - -When Claude Code skips a headersHelper command or drops its output - -Claude Code doesn’t run a `headersHelper` command, or drops headers that came from `headers` or from the command’s output, in these situations: - - * **Command fails** : if the command exits non-zero, runs past 10 seconds, or prints anything other than a JSON object of string values, Claude Code doesn’t make the fetch or download it ran the command for. - * **Marketplace URL doesn’t start with`https://`**: Claude Code doesn’t run that `url` source’s command and sends only the headers listed in its `headers` field. - * **Redirect leaves the origin** : when a download is redirected off the archive URL’s origin, Claude Code drops the `headers` values and command output of both the marketplace `url` source and the plugin entry. - * **Entry sets a routing or identity header** : Claude Code drops request-routing and client-identity names such as `Host`, `Cookie`, and `X-Forwarded-*` from an entry’s `headers` and command output, and keeps authentication names such as `Authorization`. Claude Code filters every `marketplace.json` entry this way, and an [inline settings entry](</docs/en/settings-reference#extraknownmarketplaces>) depending on which file declares it. - * **Command set in an`--add-dir` directory’s settings**: Claude Code ignores it, on a `url` source and on an [inline plugin entry](</docs/en/settings-reference#extraknownmarketplaces>) alike, and sends only that file’s `headers`. - * **Managed settings block the command** : setting [`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>) to `true` blocks `headersHelper` commands, and [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) blocks them too unless `disableCommandPluginSources` is explicitly `false`. Under either block, Claude Code still runs the command for a marketplace that managed settings themselves declare. - -#### - -​ - -How users accept a headersHelper command - -A user accepts a plugin entry’s command each time they install or update that one plugin by itself, from the plugin’s own view in `/plugin` or with `claude plugin install` or `claude plugin update`. Claude Code shows the command and the archive URL, and runs the command only after the user accepts. In a non-interactive shell, pass [`--yes`](</docs/en/plugins-reference#plugin-install>) to accept the command. To accept only the command that a previous `--json` run displayed, pass [`--accept-command`](</docs/en/plugins-reference#plugin-install>) with the `sha256` the run reported. Claude Code runs only the command it showed, for the archive URL it showed. If the entry’s command or archive URL changed in between, Claude Code refuses the install or update. A change in the query string alone doesn’t count. - -##### Installs and updates that refuse the command instead of asking - -On any operation other than a single-plugin install or update, Claude Code neither runs an entry’s command nor downloads its archive, so the plugin stays at its installed version or stays uninstalled. What the user sees depends on the operation: - - * **Installing several plugins at once, from a plugin suggestion, or as another plugin’s dependency** : Claude Code refuses the plugin that has the command and points the user at that plugin’s own view in `/plugin`. The other plugins in a bulk install still install. A plugin that depends on the refused plugin fails to install until the user installs the refused plugin by itself. - * **Background auto-update, or session start for a plugin whose archive was never downloaded** : Claude Code lists the plugin in the `/plugin` Errors tab so the user knows to install or update it by hand. An auto-update that finds the entry still advertises the installed version lists nothing. - -##### When a marketplace `url` source’s command runs - -A marketplace `url` source’s `headersHelper` is declared in a settings file, such as an [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) entry, rather than in the catalog the marketplace publishes, so Claude Code doesn’t ask the user to accept it on each install or update. The settings file that declares it decides when Claude Code runs it: - -Settings file| When Claude Code runs the command ----|--- -User settings, a `--settings` file, or a managed settings file on the machine| Without asking, including during a background marketplace refresh -A project’s `.claude/settings.json` or `.claude/settings.local.json`| Only after the user accepts the [workspace trust dialog](</docs/en/permissions#what-runs-before-you-trust-a-folder>) for that folder itself. A `-p` or SDK session doesn’t count as accepting it, and neither does trust granted to a parent folder -Server-managed settings| Only after the user approves the delivered settings in the [security approval dialog](</docs/en/server-managed-settings#security-approval-dialogs>) - -In a `-p` or SDK session, Claude Code can’t show the security approval dialog. It applies the other delivered settings, but the marketplace fetch, and any archive download that needs the command, fails until a user has approved in an interactive session. For an [inline plugin entry](</docs/en/settings-reference#extraknownmarketplaces>) in one of these files, Claude Code requires the same folder trust or settings approval as for a marketplace-level command in that file, and the user also accepts the entry’s command on each install or update. - -### - -​ - -Command sources - -Use `command` when a locally installed tool produces the plugin directory, such as an IDE that renders its plugin for the currently selected toolchain. Claude Code runs the command when the user installs the plugin and re-runs it in the background once per session, so your users pick up the tool’s changed output without reinstalling. Requires Claude Code v2.1.229 or later. On v2.1.120 through v2.1.228, installing the plugin fails with `This plugin uses a source type your Claude Code version does not support. Update Claude Code and try again.`, and on older versions the whole marketplace fails to load. This entry installs the plugin from whatever directory the tool prints: - - { - "name": "my-plugin", - "source": { - "source": "command", - "command": "my-tool claude-plugin-path" - } - } - -Claude Code runs the command through the platform shell, `sh` on macOS and Linux or `cmd.exe` on Windows, from the user’s home directory. The command must print exactly one line on stdout and exit with code 0. That line is the absolute path of a directory that contains the complete plugin by the time the command exits, and the path may change between runs. Claude Code stops a command that runs longer than `timeout` seconds, and the install or update fails. Claude Code also refuses the printed path in these cases, and the install or update fails the same way: - - * The directory has no plugin content at its top level, such as a `.claude-plugin/` directory or a `skills/`, `commands/`, `agents/`, or `hooks/` directory - * The directory is the one Claude Code was started in, or one of its parents - * On Windows, the path is a UNC path - -Command sources accept these fields: - -Field| Type| Description ----|---|--- -`command`| string| Required. Shell command that prints the plugin directory’s absolute path as a single line on stdout and exits 0. Must be printable ASCII, at most 500 characters, with no runs of four or more spaces, so users can review the whole command they’re asked to accept -`timeout`| number| Optional. Whole number of seconds to wait for the command before giving up (default: 60, maximum: 600) -`mode`| string| Optional. `"copy"` (default) copies the printed directory into the plugin cache. `"link"` uses the printed directory in place. See Copy mode and link mode - -#### - -​ - -Copy mode and link mode - -With the default `"mode": "copy"`, Claude Code copies the printed directory into the versioned plugin cache and derives the [plugin version](</docs/en/plugins-reference#version-management>) from a hash of the directory’s contents. Your tool can delete or rewrite the directory after the command exits, and a re-run that produces identical content counts as up to date. Claude Code refuses to install a directory larger than 256 MiB or containing more than 20,000 entries. Set `"mode": "link"` for large plugin directories that shouldn’t be copied, such as a rendered SDK export. Claude Code fills the plugin’s cache entry with a link to each top-level entry of the printed directory and uses the files in place, so nothing is copied, file contents aren’t hashed, and the size limits don’t apply. The install fails if a top-level entry is a symlink that points outside the printed directory. Claude Code also skips the [Node.js package dependency install](</docs/en/plugins-reference#node-js-package-dependencies>) for a link-mode plugin, so print a directory that already contains any `node_modules` the plugin needs. Keep the printed directory in place for as long as the plugin stays installed, because Claude Code loads the plugin through those links at every startup. Claude Code derives the [plugin version](</docs/en/plugins-reference#version-management>) from the printed directory’s real path and its top-level entries, not the files inside, so print a different path to signal new content. In a session started in the printed directory or anywhere below it, Claude Code doesn’t load the plugin at all. Claude Code doesn’t support link mode on Windows and refuses to install a link-mode plugin there. Declare `"mode": "copy"` instead. - -#### - -​ - -How users accept the command - -Claude Code runs your command on the user’s machine, so it binds every run to the user’s explicit acceptance: - - * When users install the plugin from its details screen in `/plugin`, or install or update it with `claude plugin install` or `claude plugin update` in an interactive terminal, Claude Code shows them the exact command string first and records the accepted command for that installation. A `claude plugin update` that can proceed on the recorded acceptance of the same command shows nothing. - * In a non-interactive shell, such as a provisioning script, pass `--yes` to `claude plugin install` or `claude plugin update` to accept the command it prints. To accept only the command that a previous `--json` run displayed, pass [`--accept-command`](</docs/en/plugins-reference#plugin-install>) with the `sha256` the run reported. - * Every other path runs only the command the user already accepted. This includes updates started from `/plugin` and the background runs described in When Claude Code re-runs the command. When none was accepted, Claude Code refuses to run the command and tells the user how to review it. Claude Code never installs a command-sourced plugin as a dependency of another plugin, so users install it themselves first. - * If you change the entry’s `command`, or switch its `mode`, users keep the version they already have and Claude Code stops re-running the command. In interactive sessions, the `/plugin` Errors tab shows the new command until the user reviews and accepts it by running `claude plugin update <plugin>@<marketplace>`. - -Administrators can block command sources across an organization with the managed setting [`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>). If an organization sets [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>), Claude Code blocks command sources by default. - -#### - -​ - -When Claude Code re-runs the command - -The printed directory reflects the tool’s state at the time the command ran, so Claude Code runs the command again at these times: - - * Every time the user installs or updates the plugin - * Once per session for each enabled command-sourced plugin, in the background, shortly after the session starts. This run doesn’t go through marketplace auto-update, so it doesn’t depend on the marketplace’s [auto-update setting](</docs/en/discover-plugins#configure-auto-updates>) - * At startup or on `/reload-plugins`, when an enabled plugin’s installed version is missing from the plugin cache - -Claude Code skips the two background runs when the user sets [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>). Explicit installs and updates still run the command with that variable set. When the command’s hashed output has changed, Claude Code installs the result as a new version and reloads it in the running interactive session, switching [the same components that `/reload-plugins` switches](</docs/en/plugins-reference#environment-variables>). The user sees a notification that the plugin was reloaded. If reloading in place would invalidate the session’s prompt cache, Claude Code instead prompts the user to run `/reload-plugins`, which [warns about the cache cost and applies when rerun with `--force`](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>). - -### - -​ - -Advanced plugin entries - -This example shows a plugin entry using many of the optional fields, including custom paths for commands, agents, hooks, and MCP servers: - - { - "name": "enterprise-tools", - "source": { - "source": "github", - "repo": "company/enterprise-plugin" - }, - "description": "Enterprise workflow automation tools", - "version": "2.1.0", - "author": { - "name": "Enterprise Team", - "email": "enterprise@example.com" - }, - "homepage": "https://docs.example.com/plugins/enterprise-tools", - "repository": "https://github.com/company/enterprise-plugin", - "license": "MIT", - "keywords": ["enterprise", "workflow", "automation"], - "category": "productivity", - "commands": [ - "./commands/core/", - "./commands/enterprise/", - "./commands/experimental/preview.md" - ], - "agents": ["./agents/security-reviewer.md", "./agents/compliance-checker.md"], - "hooks": { - "PostToolUse": [ - { - "matcher": "Write|Edit", - "hooks": [ - { - "type": "command", - "command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh" - } - ] - } - ] - }, - "mcpServers": { - "enterprise-db": { - "command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server", - "args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"] - } - }, - "strict": false - } - -Key things to notice: - - * **`commands` and `agents`**: you can specify multiple directories or individual files. Paths are relative to the plugin root and must stay inside it. - * Claude Code rejects a path that resolves outside the plugin directory, such as `./../shared.md`, with a [`path escapes plugin directory`](</docs/en/errors#path-escapes-plugin-directory>) error, and still loads the plugin without that component - * **`${CLAUDE_PLUGIN_ROOT}`** : use this variable in hook commands and MCP server configs to reference files within the plugin’s installation directory. - * See the [substitution table](</docs/en/plugins-reference#environment-variables>) for which config fields substitute it per server type - * For dependencies or state that should survive plugin updates, use [`${CLAUDE_PLUGIN_DATA}`](</docs/en/plugins-reference#persistent-data-directory>) instead - * **`strict: false`** : since this is set to false, the plugin doesn’t need its own `plugin.json`. The marketplace entry defines everything. See Strict mode below. - -By default, a plugin’s skills load from the `skills/` directory under its `source`. Paths listed in the `skills` field add to that scan: - - "skills": ["./skills/", "./extra-skills/"] - -When several plugin entries share one `skills/` folder at the marketplace root (`source: "./"`), list specific subdirectories instead so each entry loads only its own skills: - - "source": "./", - "skills": ["./skills/code-review", "./skills/docs"] - -With a marketplace-root `source`, the listed paths are the complete set for that entry, and other directories in the shared `skills/` folder don’t load. Listing `./skills/` itself, or the plugin root, keeps the full scan. If none of the listed paths exist, the default scan runs instead. - -### - -​ - -Strict mode - -The `strict` field controls whether `plugin.json` is the authority for component definitions (skills, agents, hooks, MCP servers, output styles). - -Value| Behavior ----|--- -`true` (default)| `plugin.json` is the authority. The marketplace entry can supplement it with additional components, and both sources are merged. -`false`| The marketplace entry is the entire definition. If the plugin also has a `plugin.json` that declares components, that’s a conflict and the plugin fails to load. - -**When to use each mode:** - - * **`strict: true`** : the plugin has its own `plugin.json` and manages its own components. The marketplace entry can add extra skills or hooks on top. This is the default and works for most plugins. - * **`strict: false`** : the marketplace operator wants full control. The plugin repo provides raw files, and the marketplace entry defines which of those files are exposed as skills, agents, hooks, etc. Useful when the marketplace restructures or curates a plugin’s components differently than the plugin author intended. - -## - -​ - -Host and distribute marketplaces - -When users add a marketplace hosted in a git repository, or install a git-based plugin it lists, Claude Code clones that marketplace or plugin repository onto their machine. The clone never downloads [Git LFS](<https://git-lfs.com>) content, so LFS-tracked files arrive as pointer files. Keep the files your plugins need out of LFS. - -### - -​ - -Host on GitHub (recommended) - -GitHub is the recommended way to host and distribute a marketplace: - - 1. **Create a repository** : set up a new repository for your marketplace - 2. **Add marketplace file** : create `.claude-plugin/marketplace.json` with your plugin definitions - 3. **Share with teams** : users add your marketplace with `/plugin marketplace add owner/repo` - -**Benefits** : built-in version control, issue tracking, and team collaboration features. - -### - -​ - -Host on other git services - -Any git hosting service works, such as GitLab, Bitbucket, and self-hosted servers. Users add with the full repository URL: - - /plugin marketplace add https://gitlab.com/company/plugins.git - -### - -​ - -Private repositories - -Claude Code supports installing plugins from private repositories. If you distribute your marketplace through [**Organization settings > Plugins**](<https://claude.ai/admin-settings/plugins>) instead, your git credentials aren’t involved: organization sync reads the marketplace repository through your organization’s GitHub or GitLab connection on claude.ai. See Distribute through organization settings for which plugin sources can be private. - -#### - -​ - -Commands you run - -When you run `/plugin marketplace add`, `/plugin install`, `/plugin update`, or `/plugin marketplace update`, Claude Code uses your existing git credential helpers, so HTTPS access via `gh auth login`, macOS Keychain, or `git-credential-store` works the same as in your terminal. SSH access works as long as the host is already in your `known_hosts` file and the key is loaded in `ssh-agent`, since Claude Code suppresses interactive SSH prompts for the host fingerprint and key passphrase. GitHub `owner/repo` shorthand sources clone over SSH by default; set [`CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`](</docs/en/env-vars#variables>) to clone them over HTTPS instead. - -#### - -​ - -Background auto-updates - -The background refresh checks the marketplace’s remote for new commits with your configured git credential helpers, the same as the commands you run. For SSH remotes, a key loaded in `ssh-agent` authenticates the check. Claude Code runs the check non-interactively: it turns off git’s terminal prompts and askpass programs, and tells credential helpers not to prompt. Whether the check can authenticate to a private repository over HTTPS depends on your helper: - - * A helper that can supply a stored credential without prompting authenticates the check. Git Credential Manager, the macOS Keychain helper, and `git-credential-store` work this way once they hold a credential for the host. - * A helper that needs to prompt you can’t answer in the background. The update fails quietly and the existing checkout stays in place, so your plugins keep working from the last synced state. Run `/plugin marketplace update <name>` to refresh the marketplace with your credentials. - -When the check finds the checkout up to date, Claude Code leaves it as it is. When the check finds new commits, or fails because it can’t reach or authenticate to the remote, Claude Code clones the marketplace again and swaps the new clone in. If that clone fails, the existing checkout stays in place. The re-clone can time out on large repositories. Two settings make private marketplaces behave predictably: - - * Set `CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1` to keep the existing checkout without attempting the re-clone when the background check can’t reach or authenticate to the remote. Your plugins keep working from the last synced state, and manual updates with `/plugin marketplace update` still authenticate with your credentials. - * Configure a git credential helper, for example with `gh auth setup-git` for GitHub, so the background check and the re-clone can authenticate without prompting. - -Setting a provider token such as `GITHUB_TOKEN` in your environment doesn’t by itself enable background authentication. Tokens take effect only through a configured credential helper, for example the `gh` CLI’s helper, which reads `GH_TOKEN` and `GITHUB_TOKEN`. - -In CI/CD environments, configure a git credential helper before installing plugins from private repositories. On GitHub Actions, export a token with read access to the marketplace repository as `GH_TOKEN`, then run `gh auth setup-git`. The default workflow token can only access the workflow’s own repository, so a private marketplace in another repository needs a personal access token or app token. - -### - -​ - -Distribute through organization settings - -If you distribute plugins through [**Organization settings > Plugins**](<https://claude.ai/admin-settings/plugins>) on a Team or Enterprise plan, these source rules apply: - - * On github.com and gitlab.com, the marketplace repository must be private or internal. Organization sync reads the repository through the connection that matches its host: - * **github.com** : the Claude GitHub App - * **Your GitHub Enterprise Server host** : your organization’s [GitHub Enterprise App](</docs/en/github-enterprise-server#admin-setup>) - * **gitlab.com or your self-managed GitLab instance** : the access token in your organization’s GitLab configuration for that host - * Each plugin source must be of type `github`, `url`, or `git-subdir`, or a relative path that starts with `./`. If you list a plugin by bare name under `metadata.pluginRoot`, organization sync rejects it as an unsupported source, so write the path out, such as `./plugins/deploy-tools`. - * A plugin source can be private in three cases: - * A github.com source that shares the marketplace repository’s owner - * A source on your organization’s GitHub Enterprise host with the GHE App installed on the repository - * A `url` or `git-subdir` source on the same GitLab host as the marketplace repository. On gitlab.com, the source must also be under the same top-level group or user namespace as the marketplace repository. - * Any other plugin source must be a public repository on github.com, gitlab.com, or bitbucket.org, which organization sync fetches without credentials. Organization sync rejects plugin sources on hosts these rules don’t cover. - -See [Manage plugins for your organization](<https://support.claude.com/en/articles/13837433>) for the admin workflow. To include private plugins, place the plugin folders inside the marketplace repository and reference them with a relative path. Organization sync packages each plugin during distribution, so users never need access to a separate source repository. For example, this `marketplace.json` plugin entry references a plugin you committed at `plugins/deploy-tools` in the marketplace repository: - - { - "name": "deploy-tools", - "source": "./plugins/deploy-tools" - } - -#### - -​ - -Sync a GitLab-hosted marketplace - -To sync a marketplace from gitlab.com or a self-managed GitLab instance, an [Owner](</docs/en/server-managed-settings#access-control>) first adds a GitLab configuration for that host at [**Organization settings > Claude Code**](<https://claude.ai/admin-settings/claude-code>). GitLab configurations are in public beta and apply only to plugin marketplace sync. Adding one doesn’t make GitLab repositories available to [cloud sessions](</docs/en/claude-code-on-the-web#limitations>). See [Manage plugins for your organization](<https://support.claude.com/en/articles/13837433>) for the setup steps. When you add the marketplace, enter the project’s HTTPS URL, such as `https://gitlab.example.com/platform/claude-plugins`. Projects in nested subgroups work. Organization sync reads the project’s default branch. If you turn on **Sync automatically** , only pushes to the default branch start a sync. - -#### - -​ - -Keep executables out of the top-level bin directory - -Don’t include a top-level `bin/` directory in any plugin you distribute through organization settings. claude.ai rejects a plugin that has one, whether the plugin arrives by marketplace sync or by direct upload: - - * **Marketplace sync** : organization sync rejects that plugin and syncs the rest of the marketplace. The error message starts with `Plugin contains a top-level bin/ directory`. - * **Direct upload** : if you upload the plugin in [**Organization settings > Plugins**](<https://claude.ai/admin-settings/plugins>) instead, claude.ai rejects the upload with the same message. - -Keep executables in another directory, such as `scripts/`, and reference them as `${CLAUDE_PLUGIN_ROOT}/scripts/<name>` from your [skills, hooks, or MCP server configs](</docs/en/plugins-reference#environment-variables>). - -### - -​ - -Require marketplaces for your team - -You can configure your repository so Claude Code adds your marketplace for team members once they [trust the project folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>), with no separate prompt. Add your marketplace to `.claude/settings.json`: - - { - "extraKnownMarketplaces": { - "company-tools": { - "source": { - "source": "github", - "repo": "your-org/claude-plugins" - } - } - } - } - -You can also specify which plugins should be enabled by default: - - { - "enabledPlugins": { - "code-formatter@company-tools": true, - "deployment-tools@company-tools": true - } - } - -For full configuration options, see [Plugin settings](</docs/en/settings-reference#plugin-settings>). - -If you use a local `directory` or `file` source with a relative path, the path resolves against your repository’s main checkout. When you run Claude Code from a git worktree, the path still points at the main checkout, so all worktrees share the same marketplace location. Marketplace state is stored once per user in `~/.claude/plugins/known_marketplaces.json`, not per project. - -### - -​ - -Pre-populate plugins for containers - -For 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. To layer multiple seed directories, separate paths with `:` on Unix or `;` on Windows. Claude Code searches each directory in order and uses the first seed that contains a given marketplace or plugin cache. The seed directory mirrors the structure of `~/.claude/plugins`: - - $CLAUDE_CODE_PLUGIN_SEED_DIR/ - known_marketplaces.json - marketplaces/<name>/... - cache/<marketplace>/<plugin>/<version>/... - -To build a seed directory, 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. To skip the copy step, set `CLAUDE_CODE_PLUGIN_CACHE_DIR` to your target seed path during the build so plugins install directly there: - - CLAUDE_CODE_PLUGIN_CACHE_DIR=/opt/claude-seed claude plugin marketplace add your-org/plugins - CLAUDE_CODE_PLUGIN_CACHE_DIR=/opt/claude-seed claude plugin install my-tool@your-plugins - -Then set `CLAUDE_CODE_PLUGIN_SEED_DIR=/opt/claude-seed` in your container’s runtime environment so Claude Code reads from the seed on startup. At 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. Behavior details: - - * **Read-only** : Claude Code never writes to the seed directory. - * **Auto-updates disabled** : seed marketplaces don’t auto-update. - * **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. - * **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. - * **Mutation is blocked** : running `/plugin marketplace remove` or `/plugin marketplace update` against a seed-managed marketplace fails with guidance to ask your administrator to update the seed image. - * **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. - -### - -​ - -Managed marketplace restrictions - -For organizations requiring strict control over plugin sources, administrators can restrict which plugin marketplaces users are allowed to add using the [`strictKnownMarketplaces`](</docs/en/settings-reference#strictknownmarketplaces>) setting in managed settings. To also reject the CLI flags that sideload plugins, agents, and MCP servers for a single run, pair it with [`disableSideloadFlags`](</docs/en/settings-reference#disablesideloadflags>). To allowlist which marketplaces’ plugins can appear as contextual install suggestions, set [`pluginSuggestionMarketplaces`](</docs/en/settings-reference#pluginsuggestionmarketplaces>). `strictKnownMarketplaces` matches the marketplace a plugin comes from, not the entries inside it, so users can still install a plugin with a `command` source from an allowed marketplace. To block command sources as well, set [`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>). When `strictKnownMarketplaces` is configured in managed settings, the restriction behavior depends on the value: - -Value| Behavior ----|--- -Undefined (default)| No restrictions. Users can add any marketplace -Empty array `[]`| Complete lockdown. Blocks every marketplace source, including the official Anthropic marketplace -List of sources| Allowlist enforced. Users can add only marketplaces that match an entry - -#### - -​ - -Common configurations - -Disable all marketplace additions, including the official Anthropic marketplace: - - { - "strictKnownMarketplaces": [] - } - -Claude Code downloads the plugins [synced from claude.ai](</docs/en/plugins-reference#synced-plugins>) from your account rather than from a marketplace, so this lockdown doesn’t cover them. To stop those as well, set [`syncClaudeAiPlugins`](</docs/en/settings-reference#syncclaudeaiplugins>) to `false` in managed settings, or turn off Skills for your organization on claude.ai. Allow only the official Anthropic marketplace. Matching for a single-repository entry is exact, so this entry doesn’t cover `ref` or `path` variants of the same repository: - - { - "strictKnownMarketplaces": [ - { - "source": "github", - "repo": "anthropics/claude-plugins-official" - } - ] - } - -With this entry, Claude Code keeps an already-registered official marketplace available and, on a fresh machine, registers the marketplace automatically the first time you start Claude Code interactively. Automatic registration doesn’t cover every machine. It most commonly misses: - - * Non-interactive environments that run before the machine’s first interactive launch. - * Machines where Claude Code already ran interactively under a policy that blocked the marketplace, such as the empty-array lockdown. Claude Code records the blocked attempt and doesn’t retry after the policy changes. - -On these machines, add the marketplace to [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) in the same `managed-settings.json` so Claude Code registers it automatically, or run `claude plugin marketplace add anthropics/claude-plugins-official`. Allow specific marketplaces only: - - { - "strictKnownMarketplaces": [ - { - "source": "github", - "repo": "acme-corp/approved-plugins" - }, - { - "source": "github", - "repo": "acme-corp/security-tools", - "ref": "v2.0" - }, - { - "source": "url", - "url": "https://plugins.example.com/marketplace.json" - } - ] - } - -Allow every marketplace repository under a GitHub organization with an [owner-wildcard](</docs/en/settings-reference#owner-wildcards>) entry. Owner wildcards require Claude Code v2.1.223 or later. - - { - "strictKnownMarketplaces": [ - { - "source": "github", - "repo": "acme-corp/*" - } - ] - } - -Allow all marketplaces from an internal git server using regex pattern matching on the host. This is the recommended approach for [GitHub Enterprise Server](</docs/en/github-enterprise-server#plugin-marketplaces-on-ghes>) or self-hosted GitLab instances: - - { - "strictKnownMarketplaces": [ - { - "source": "hostPattern", - "hostPattern": "^github\\.example\\.com$" - } - ] - } - -Allow filesystem-based marketplaces from a specific directory using regex pattern matching on the path: - - { - "strictKnownMarketplaces": [ - { - "source": "pathPattern", - "pathPattern": "^/opt/approved/" - } - ] - } - -Use `".*"` as the `pathPattern` to allow any filesystem path while still controlling network sources with `hostPattern`. - -`strictKnownMarketplaces` restricts what users can add, but doesn’t register marketplaces on its own. To register an allowed marketplace for users automatically, add it to [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) in the same `managed-settings.json`.The official Anthropic marketplace is the only one Claude Code registers on its own, and only when the allowlist allows it. Automatic registration also misses some machines, such as non-interactive environments and machines where an earlier policy blocked it. To cover those machines, add the official marketplace to `extraKnownMarketplaces` as well. For the two settings side by side, see the [`strictKnownMarketplaces` reference](</docs/en/settings-reference#strictknownmarketplaces>). - -#### - -​ - -How restrictions work - -Restrictions are checked before any network or filesystem operation. The check runs on marketplace add and on plugin install, update, refresh, and auto-update. If a marketplace was added before the policy was configured and its source no longer matches the allowlist, Claude Code refuses to install or update plugins from it. The same enforcement applies to `blockedMarketplaces`. To block every marketplace repository under a GitHub owner, use the owner-wildcard form in a `blockedMarketplaces` entry: `{ "source": "github", "repo": "untrusted-org/*" }`. Requires Claude Code v2.1.223 or later. For the matching rules, which differ between the blocklist and the allowlist, see [Owner wildcards](</docs/en/settings-reference#owner-wildcards>). When a user adds an `https://` repository URL that Claude Code [clones rather than fetches](</docs/en/discover-plugins#add-from-other-git-hosts>), such as a bare `github.com` or `gitlab.com` repository URL, Claude Code also checks it against the `url` entries in `blockedMarketplaces`. Claude Code blocks the addition if an entry names the same URL. In that comparison, Claude Code ignores the `.git` suffix and any ref the user appends after `#`. Requires Claude Code v2.1.232 or later. Before v2.1.232, Claude Code matched a `url` entry only against a URL it fetched as a hosted `marketplace.json` file. The allowlist uses exact matching for most source types, apart from owner-wildcard `github` entries. For a marketplace to be allowed, all specified fields must match: - - * For GitHub sources: `repo` is required, either naming one repository or using the owner-wildcard form `owner/*` to cover every repository under that owner. For how wildcard entries match, including the case rules, see [Owner wildcards](</docs/en/settings-reference#owner-wildcards>). For single-repository entries, `ref` must match exactly or be absent from both the marketplace source and the allowlist entry, and the same rule applies to `path` - * For URL sources: the full URL must match exactly - * For `hostPattern` sources: the marketplace host is matched against the regex pattern - * For `pathPattern` sources: the marketplace’s filesystem path is matched against the regex pattern - -The allowlist’s exact matching treats URLs that differ only by a trailing slash, a `.git` suffix, or the `ssh://` and `https://` scheme as different values. If your organization’s marketplace can be cloned by more than one URL form, prefer a `hostPattern` entry over a literal URL so the `https://`, `ssh://`, and `user@host:path` forms all match. A [marketplace hosted on claude.ai](</docs/en/discover-plugins#add-from-claude-ai>) is matched by host: a `hostPattern` entry that matches `claude.ai` governs it, in `strictKnownMarketplaces` and in `blockedMarketplaces`. On the allowlist, such an entry doesn’t admit a member’s personal claude.ai uploads. Requires Claude Code v2.1.273 or later. Because `strictKnownMarketplaces` is set in [managed settings](</docs/en/managed-settings>), individual users and project configurations can’t override these restrictions. For complete configuration details including all supported source types and comparison with `extraKnownMarketplaces`, see the [strictKnownMarketplaces reference](</docs/en/settings-reference#strictknownmarketplaces>). - -### - -​ - -Version resolution and release channels - -Plugin versions determine cache paths and update detection: if the resolved version matches what a user already has, `/plugin update` and auto-update skip the plugin. For git-based sources, if you omit `version`, Claude Code uses the source’s resolved commit SHA, so users get an update whenever that commit changes; this is the simplest setup for internal or actively developed plugins. See [Version management](</docs/en/plugins-reference#version-management>) for the full resolution order, including `archive` sources. - -Setting `version` pins the plugin for every source type except `command`, whose version always includes a hash of what the command produced. A plugin [loaded in place](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) from a marketplace added as a local directory isn’t pinned either. If you declare `"version": "1.0.0"` in `plugin.json` and push new commits without changing that string, existing users of those sources keep the cached copy, because Claude Code sees the same version. Bump the field on every release, or omit it to fall back to the resolved version.Avoid setting `version` in both `plugin.json` and the marketplace entry. Claude Code always uses the `plugin.json` value without warning, so a stale manifest version can mask a version you set in `marketplace.json`. - -#### - -​ - -Set up release channels - -To support “stable” and “latest” release channels for your plugins, you can set up two marketplaces that point to different refs or SHAs of the same repo. You can then give each user group its own marketplace through managed settings in one of two ways: - - * Deploy separate [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>), such as a managed settings file or an MDM profile, to each group’s devices. [How Claude Code combines managed sources](</docs/en/managed-settings#precedence-within-the-managed-tier>) says whether the per-group file or profile applies on a device that also has an organization-wide source. - * Define one [Claude apps gateway policy](</docs/en/claude-apps-gateway-config#managed>) per group. The gateway applies the first policy whose match rule fits a user, so order the policies so that each user reaches their group’s policy. A group policy’s `extraKnownMarketplaces` replaces the catch-all policy’s map rather than merging with it, so list every marketplace the group needs in the group’s policy, not only its channel marketplace. - -Server-managed settings from the admin console [apply to every user in your organization](</docs/en/server-managed-settings#current-limitations>), so they can’t carry a per-group assignment. - -Each channel must resolve to a different version. If you use explicit versions, `plugin.json` must declare a different `version` at each pinned ref. If you omit `version`, the distinct commit SHAs already distinguish the channels. If two refs resolve to the same version string, Claude Code treats them as identical and skips the update. - -##### Example - - { - "name": "stable-tools", - "plugins": [ - { - "name": "code-formatter", - "source": { - "source": "github", - "repo": "acme-corp/code-formatter", - "ref": "stable" - } - } - ] - } - - { - "name": "latest-tools", - "plugins": [ - { - "name": "code-formatter", - "source": { - "source": "github", - "repo": "acme-corp/code-formatter", - "ref": "latest" - } - } - ] - } - -##### Assign channels to user groups - -Assign each marketplace to its user group through the per-group endpoint-managed settings or gateway policy described under Set up release channels. For example, the stable group receives: - - { - "extraKnownMarketplaces": { - "stable-tools": { - "source": { - "source": "github", - "repo": "acme-corp/stable-tools" - } - } - } - } - -The early-access group receives `latest-tools` instead: - - { - "extraKnownMarketplaces": { - "latest-tools": { - "source": { - "source": "github", - "repo": "acme-corp/latest-tools" - } - } - } - } - -#### - -​ - -Pin dependency versions - -A plugin can constrain its dependencies to a semver range so that updates to a dependency don’t break the dependent plugin. See [Constrain plugin dependency versions](</docs/en/plugin-dependencies>) for the `{plugin-name}--v{version}` git-tag convention, range syntax, and how multiple constraints on the same dependency are combined. - -### - -​ - -Rename or remove a plugin - -A plugin’s `name` is its stable identifier. Users reference it in `enabledPlugins`, `pluginConfigs`, and `/plugin install` commands, so changing it breaks every existing install. To change the label shown in the UI without breaking installs, set `displayName` and keep `name` unchanged. If you must change a plugin’s `name`, or you remove a plugin from the `plugins` array, add a top-level `renames` entry so existing users migrate instead of seeing a `plugin-not-found` error. Automatic migration requires Claude Code v2.1.193 or later. Map each former name to its current name, or to `null` if the plugin no longer exists. The following example renames `formatter` to `code-formatter` and records that `legacy-linter` was removed: - - { - "name": "acme-tools", - "owner": { "name": "Acme" }, - "plugins": [ - { "name": "code-formatter", "source": "./plugins/code-formatter" } - ], - "renames": { - "formatter": "code-formatter", - "legacy-linter": null - } - } - -When a user starts Claude Code with the old name still in their settings, Claude Code follows the `renames` map: - - * If the entry points to a new name, Claude Code loads the plugin under its new name and shows a one-line notice such as `Renamed to "code-formatter" in the "acme-tools" marketplace`. It then rewrites the old key to the new key in the user, project, and local settings scopes for both `enabledPlugins` and `pluginConfigs`, so the notice appears once. - * For a `null` entry, Claude Code drops the old key and the notice reports that the plugin was removed from the marketplace. - * If the renamed plugin uses a remote source such as `github` or `npm`, Claude Code reports `plugin-cache-miss` after the rename and the user must run `/plugin install` once to fetch it under the new name. - -Treat `renames` as append-only history: keep old entries in place even after you expect every user to have migrated. Claude Code follows chains, so if you later rename `code-formatter` to `formatter-pro`, add a second entry rather than editing the first. A user who still has the original `formatter` enabled then resolves through both entries to `formatter-pro`. Run `claude plugin validate .` after editing the map; it rejects any entry whose chain forms a cycle or doesn’t terminate at `null` or a name listed in `plugins`. - -Managed and policy settings are read-only to Claude Code, so plugins enabled there can’t be rewritten automatically. The renamed plugin still loads each session, but the rename notice recurs until an administrator updates `enabledPlugins` in the managed settings file to use the new name. The same applies to plugins enabled through other read-only sources such as `--add-dir`. - -Earlier versions of Claude Code ignore the `renames` field and report `plugin-not-found` for the old name. - -## - -​ - -Validation and testing - -Test your marketplace before sharing. Validation checks file structure; to test whether a plugin changes what Claude does on realistic prompts, run its eval suite with [`claude plugin eval`](</docs/en/plugin-evals>) before you publish a new version. From your marketplace directory, validate the JSON syntax: - - claude plugin validate . - -Or from within Claude Code: - - /plugin validate . - -Add the marketplace for testing: - - /plugin marketplace add ./path/to/marketplace - -Install a test plugin to verify everything works: - - /plugin install test-plugin@marketplace-name - -For complete plugin testing workflows, see [Test your plugins locally](</docs/en/plugins#test-your-plugins-locally>). For technical troubleshooting, see [Plugins reference](</docs/en/plugins-reference>). - -## - -​ - -Manage marketplaces from the CLI - -Claude Code provides non-interactive `claude plugin marketplace` subcommands for scripting and automation. These are equivalent to the `/plugin marketplace` commands available inside an interactive session. - -### - -​ - -Plugin marketplace add - -Add a marketplace from a GitHub repository, git URL, remote URL, or local path. - - claude plugin marketplace add <source> [options] - -**Arguments:** - - * `<source>`: GitHub `owner/repo` shorthand, git URL, remote URL to a `marketplace.json` file, or local directory path. To pin to a branch or tag, append `@ref` to the GitHub shorthand or `#ref` to a git URL - -A URL must include its scheme. As of Claude Code v2.1.196, a host typed without one, such as `gitlab.example.com/team/plugins`, is rejected as an invalid `owner/repo` shorthand and the error tells you to add `https://` or use `./` for a local path. Earlier versions misread it as a GitHub repository path and fail at clone time with a GitHub not-found error. **Options:** - -Option| Description| Default ----|---|--- -`--scope <scope>`| Where to declare the marketplace: `user`, `project`, or `local`. See [Plugin installation scopes](</docs/en/plugins-reference#plugin-installation-scopes>)| `user` -`--sparse <paths...>`| Limit checkout to specific directories via git sparse-checkout. Useful for monorepos| -`--claudeai`| Read the argument as the name of a [marketplace hosted on claude.ai](</docs/en/discover-plugins#add-from-claude-ai>) instead of a source. Requires Claude Code v2.1.273 or later| - -Add a marketplace from GitHub using `owner/repo` shorthand: - - claude plugin marketplace add acme-corp/claude-plugins - -Pin to a specific branch or tag with `@ref`: - - claude plugin marketplace add acme-corp/claude-plugins@v2.0 - -Add from a git URL on a non-GitHub host: - - claude plugin marketplace add https://gitlab.example.com/team/plugins.git - -Add from a remote URL that serves the `marketplace.json` file directly: - - claude plugin marketplace add https://example.com/marketplace.json - -Add from a local directory for testing: - - claude plugin marketplace add ./my-marketplace - -Declare the marketplace at project scope so it is shared with your team via `.claude/settings.json`: - - claude plugin marketplace add acme-corp/claude-plugins --scope project - -For a monorepo, limit the checkout to the directories that contain plugin content: - - claude plugin marketplace add acme-corp/monorepo --sparse .claude-plugin plugins - -Add a [marketplace hosted on claude.ai](</docs/en/discover-plugins#add-from-claude-ai>) by the name printed in the `From claude.ai:` section of `claude plugin marketplace list`: - - claude plugin marketplace add --claudeai claudeai-organization-library - -With `--claudeai`, the command refuses `--scope` and `--sparse`. The marketplace is hosted for your account, not declared in a settings file, so you can’t share it through a project’s `.claude/settings.json`. - -### - -​ - -Plugin marketplace list - -List all configured marketplaces. - - claude plugin marketplace list [options] - -**Options:** - -Option| Description ----|--- -`--json`| Output as JSON - -With `--json`, each entry includes `name`, `source`, an `installLocation` field with the local cache path where the marketplace is stored, and source-specific fields: `repo` for GitHub sources, `url` for git and URL sources, and `path` for local sources. GitHub and git sources also include a `ref` field when the marketplace was added with a pinned branch or tag. An added [claude.ai marketplace](</docs/en/discover-plugins#add-from-claude-ai>) has no local clone, so its entry carries its claude.ai identifiers, `marketplaceId` and `organizationUuid`, in place of `installLocation`. In terminal sessions where [plugins sync from your claude.ai account](</docs/en/plugins-reference#synced-plugins>), the text listing ends with a `From claude.ai:` section naming what claude.ai lists for your account beyond the marketplaces you’ve added. To add one of them, see [Add from claude.ai](</docs/en/discover-plugins#add-from-claude-ai>). The `--json` output covers configured marketplaces only and leaves that section out. Requires Claude Code v2.1.273 or later. - -### - -​ - -Plugin marketplace remove - -Remove a configured marketplace. The alias `rm` is also accepted. - - claude plugin marketplace remove <name> [options] - -**Arguments:** - - * `<name>`: marketplace name to remove, as shown by `claude plugin marketplace list`. This is the `name` from `marketplace.json`, not the source you passed to `add` - -**Options:** - -Option| Description| Default ----|---|--- -`--scope <scope>`| Restrict removal to a single settings scope: `user`, `project`, or `local`. See [Plugin installation scopes](</docs/en/plugins-reference#plugin-installation-scopes>). When omitted, the declaration is removed from every editable scope. When given, only that scope’s declaration is removed; the shared state, cache, and installed plugin data are preserved when the marketplace is still declared in another scope| (all scopes) - -Removing a marketplace from its last remaining scope also uninstalls any plugins you installed from it. To refresh a marketplace without losing installed plugins, use `claude plugin marketplace update` instead. - -### - -​ - -Plugin marketplace update - -Refresh marketplaces from their sources to retrieve new plugins and version changes. A marketplace added with a branch or tag `ref` updates to the latest commit of that ref, not the repository’s default branch. - - claude plugin marketplace update [name] - -**Arguments:** - - * `[name]`: marketplace name to update, as shown by `claude plugin marketplace list`. Updates all marketplaces if omitted - -Both `remove` and `update` fail when run against a seed-managed marketplace, which is read-only. When updating all marketplaces, seed-managed entries are skipped and other marketplaces still update. To change seed-provided plugins, ask your administrator to update the seed image. See Pre-populate plugins for containers. - -## - -​ - -Troubleshooting - -### - -​ - -Marketplace not loading - -**Symptoms** : Can’t add marketplace or see plugins from it **Solutions** : - - * Verify the marketplace URL is accessible - * Check that `.claude-plugin/marketplace.json` exists at the specified path - * Ensure JSON syntax is valid using `claude plugin validate .` or `/plugin validate .` from the marketplace directory. To check skill, agent, and command frontmatter, see Validate a plugin or a directory without a manifest - * For private repositories, confirm you have access permissions - -### - -​ - -Marketplace validation errors - -Run `claude plugin validate .` or `/plugin validate .` from your marketplace directory to check for issues. When pointed at a marketplace directory, the validator checks `marketplace.json` for schema errors, duplicate plugin names, and source path traversal. For each entry whose `source` is a local path, it also validates that plugin’s own `plugin.json` and warns when the entry’s `version` doesn’t match the one in `plugin.json`. Problems found in a plugin’s `plugin.json` are prefixed with the entry index, in the form `plugins[2] plugin.json →`. As of Claude Code v2.1.196, the per-entry pass also: - - * includes plugins whose `source` is `.` - * runs when `marketplace.json` is outside a `.claude-plugin` directory, resolving sources against the file’s own directory - * reports each entry’s problems even when another part of the file has schema errors - -Earlier versions skip plugins at the marketplace root and only descend from a `.claude-plugin/marketplace.json`. From a marketplace directory, Claude Code doesn’t open the plugins’ skill, agent, command, or hook files. To find errors in those files, see Validate a plugin or a directory without a manifest. The table below lists the most common errors from a marketplace directory, with the cause and fix for each: - -Error| Cause| Solution ----|---|--- -`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`| The directory you named has no `.claude-plugin/marketplace.json` or `plugin.json`, and no skill, agent, or command files to check| Run from the marketplace root, or create `.claude-plugin/marketplace.json` with the required fields -`Invalid JSON syntax: Unexpected token...`| JSON syntax error in marketplace.json| Check for missing commas, extra commas, or unquoted strings -`Duplicate plugin name "x" found in marketplace`| Two plugins share the same name| Give each plugin a unique `name` value -`plugins[0].source: Path contains ".."`| A segment of the source path is `..`| Use paths relative to the marketplace root without `..` segments. See Relative paths -`Marketplace name cannot contain control or bidirectional-formatting characters`| The marketplace `name` contains a Unicode bidirectional-formatting character or a control character, such as an escape or a newline| Remove the character from the name. Before v2.1.247, these characters produced the `Marketplace name impersonates an official Anthropic/Claude marketplace` error -`Plugin name cannot contain control or bidirectional-formatting characters`| A plugin `name` contains a Unicode bidirectional-formatting character or a control character, such as an escape or a newline| Remove the character from the name. Before v2.1.247, Claude Code didn’t run this check - -**Warnings** (non-blocking): - - * `Marketplace has no plugins defined`: add at least one plugin to the `plugins` array - * `No marketplace description provided`: add a top-level `description` to help users understand your marketplace - * `Plugin name "x" is not kebab-case`: 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. - * `Marketplace name "x" is reserved in Claude Desktop`: the marketplace is named `org`, `org-provisioned`, or `unknown`, in any casing. Claude Code accepts these names, but Claude Desktop’s managed marketplace sync rejects the whole marketplace. Rename the marketplace. Before v2.1.221, `claude plugin validate` didn’t run this check. - * `Marketplace name "x" is not accepted by Claude Desktop` or `Plugin name "x" is not accepted by Claude Desktop`: Claude Desktop accepts names of up to 128 characters made of letters, digits, `.`, `_`, and `-`, starting with a letter or digit. Claude Code accepts other forms, but Claude Desktop’s managed marketplace sync rejects a marketplace whose name fails the check and silently drops a plugin entry whose name does. Rename the marketplace or plugin. Before v2.1.221, `claude plugin validate` didn’t run these checks. - -#### - -​ - -Validate a plugin or a directory without a manifest - -To find skill, agent, and command files whose frontmatter doesn’t parse, run `claude plugin validate` and name the directory that holds them. Claude Code doesn’t look outside the directory you name. Every run except one against a plugin that has a `plugin.json` requires Claude Code v2.1.233 or later. - -##### Pick the directory to name - -Claude Code checks different files depending on which directory you name. Find what you want to check in the first column, and run that row’s command: - -To check| Run| Claude Code checks ----|---|--- -A plugin that has a `plugin.json`| `claude plugin validate ./plugins/my-plugin`| `plugin.json`, `hooks/hooks.json`, and the `skills`, `agents`, and `commands` directories at the plugin root -One directory of skills, agents, or commands, such as a plugin that has no `plugin.json` yet| `claude plugin validate .claude/skills`, `~/.claude/agents`, or `./my-plugin/agents`| Every skill, agent, or command file in that directory -A folder whose skill is its root `SKILL.md`| `claude plugin validate ./skills`, naming the `skills` directory that holds the folder| Each folder’s root `SKILL.md`. The holding directory must be named `skills`; a folder under another name, such as `plugins/`, has no run that checks its root `SKILL.md` -A project’s three directories at once| `claude plugin validate .claude`, or the project root when it has no `.claude-plugin/` manifest| `.claude/skills`, `.claude/agents`, and `.claude/commands` -Your user-level directories| `claude plugin validate ~/.claude`| `~/.claude/skills`, `~/.claude/agents`, and `~/.claude/commands` - -##### Check a plugin whose skill is its root `SKILL.md` - -When you run `claude plugin validate` against a plugin directory, Claude Code doesn’t check a `SKILL.md` at the plugin root. When the plugin sits in a directory named `skills`, run the command twice: - - * Name that `skills` directory to check the plugin’s root `SKILL.md`. - * Name the plugin directory to check the rest. - -When the plugin sits under another name, such as `plugins/`, the `skills`-directory run isn’t available, and no run checks its root `SKILL.md`. - -##### Check files behind symlinks - -When you run `claude plugin validate`, Claude Code doesn’t follow symlinks inside the directory you name. What it does depends on where the link is: - - * **A linked`skills`, `agents`, or `commands` directory under the plugin or `.claude` root**: Claude Code warns that nothing in it was read. - * **A linked entry inside a`skills`, `agents`, or `commands` directory**: Claude Code skips it and warns, per directory, how many entries it skipped that a session would load. - * **The`skills`, `agents`, or `commands` directory you name is itself a symlink, or its parent `.claude` directory is**: Claude Code reports an error and checks nothing in it. Name the real directory instead. - -In two skills cases, the run passes with warnings. To check the linked files, run again and name a directory that holds them directly: - - * **A plugin whose`skills` directory [links to a sibling plugin’s skills](</docs/en/plugins-reference#share-files-within-a-marketplace-with-symlinks>)**: name the sibling plugin’s directory. - * **A[symlinked skill entry](</docs/en/skills#where-skills-live>) in `~/.claude/skills` or `.claude/skills`**: Claude Code follows the entry in a session. To check it, name a directory called `skills` that holds the real folder. - -##### Read the validation results - -A clean run ends with `Validation passed`. `No manifest found in directory` means Claude Code found no `plugin.json` or `marketplace.json` there, and no skill, agent, or command file in the directories it probes under it. Name the `skills`, `agents`, or `commands` directory that holds your files instead. Two of the errors Claude Code reports from these runs, with the fix for each: - - * `YAML frontmatter failed to parse: ...`: fix the YAML in the frontmatter block of the skill, agent, or command file. Until you do, a session reads no frontmatter fields from the file - * `Invalid JSON syntax: ...` on `hooks/hooks.json`: fix the JSON syntax. Until you do, a session loads the plugin without the hooks in that file. Claude Code reports this error only in a plugin run - -In a plugin run, Claude Code also warns about a `CLAUDE.md` at the plugin root. For paths you set through the [component path fields](</docs/en/plugins-reference#component-path-fields>) in `plugin.json`, Claude Code checks that each path exists but doesn’t read the files there. - -### - -​ - -Plugin installation failures - -**Symptoms** : Marketplace appears but plugin installation fails **Solutions** : - - * Verify plugin source URLs are accessible - * Check that plugin directories contain required files - * For GitHub sources, ensure repositories are public or you have access - * Test plugin sources manually by cloning/downloading - * If the source pins both `ref` and `sha`, a deleted upstream branch or tag doesn’t block installation on most git hosts, including GitHub, GitLab, and Bitbucket. On servers that don’t support fetching commits by SHA, such as AWS CodeCommit, the `ref` must still exist and the pinned commit must be reachable from it. If the install still fails, confirm the pinned commit still exists in the repository - -### - -​ - -Private repository authentication fails - -**Symptoms** : Authentication errors when installing plugins from private repositories **Solutions** : For manual installation and updates: - - * Verify you’re authenticated with your git provider (for example, run `gh auth status` for GitHub) - * Check that your credential helper is configured: `git config --global credential.helper` - * Run `git ls-remote <marketplace-url>` to test whether git can authenticate on its own. If git asks for a username or password, store the credential first: for GitHub over HTTPS, run `gh auth setup-git`, and for SSH remotes, load your key into `ssh-agent` - -For background auto-updates: - - * The background check uses your configured git credential helpers but never prompts, so your helper must be able to answer with a stored credential. SSH remotes with a key loaded in `ssh-agent` also authenticate - * If your helper needs to prompt you, the background update fails quietly and the existing checkout stays in place. Sign in to your helper first so it holds a credential for the host. For GitHub, run `gh auth login`, then `gh auth setup-git` - * When the check finds new commits, or can’t reach or authenticate to the remote, Claude Code re-clones the marketplace with the same credentials. The re-clone may time out on large repositories - * Set `CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1` to keep the existing checkout without attempting the re-clone when the background check can’t reach or authenticate to the remote - * If the re-clone times out on a large repository, increase the limit with `CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS` - * Or update private marketplaces manually with `/plugin marketplace update <name>`, which uses your credentials - -Before v2.1.280, the background check ran without your credential helpers and couldn’t authenticate to private repositories over HTTPS. - -### - -​ - -Marketplace updates fail in offline environments - -**Symptoms** : In an offline or airgapped environment, the background marketplace refresh can’t reach the remote and Claude Code repeatedly attempts a re-clone that can’t succeed. **Cause** : The background refresh checks the marketplace’s remote for new commits, and when the check can’t reach the remote, Claude Code attempts to clone the marketplace again. Offline, the clone fails the same way and the existing checkout stays in place. Before v2.1.274, the refresh ran `git pull` in the existing checkout, moved the checkout aside to re-clone when the pull failed, and restored it afterward on a best-effort basis. The refresh runs in the background after startup, so it doesn’t delay startup. Each session still repeats the failed attempt, and each git operation can wait out the 120-second timeout. **Solution** : Set `CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1` to skip the re-clone attempt and keep using the existing checkout when the check can’t reach the remote: - - export CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1 - -For fully offline deployments where the repository will never be reachable, use `CLAUDE_CODE_PLUGIN_SEED_DIR` to pre-populate the plugins directory at build time instead. - -### - -​ - -Git operations time out - -**Symptoms** : Plugin installation or marketplace updates fail with a timeout error such as `Git clone timed out after 120s`. **Cause** : Claude Code uses a 120-second timeout for all git operations, including cloning plugin repositories and re-cloning a marketplace to update it. Large repositories or slow network connections may exceed this limit. **Solution** : Increase the timeout using the `CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS` environment variable. The value is in milliseconds: - - export CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=300000 # 5 minutes - -### - -​ - -Plugins with relative paths fail in URL-based marketplaces - -**Symptoms** : Added a marketplace via a URL such as `https://example.com/marketplace.json`, but plugins with relative path sources like `"./plugins/my-plugin"` fail to install with `its marketplace entry path does not stay inside the marketplace directory`. Already-installed plugins fail to load with `Plugin source path refused`. Both messages have an [error reference entry](</docs/en/errors#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory>). **Cause** : adding a URL-based marketplace downloads only the `marketplace.json` file itself, and Claude Code doesn’t fetch plugin files by relative path from that server. Relative paths in the marketplace entry reference files on the remote server that were not downloaded. **Solutions** : - - * **Use external sources** : change plugin entries to any plugin source other than a relative path: - - { "name": "my-plugin", "source": { "source": "github", "repo": "owner/repo" } } - - * **Use a Git-based marketplace** : Host your marketplace in a Git repository and add it with the git URL. Git-based marketplaces clone the entire repository, making relative paths work correctly. - -### - -​ - -Files not found after installation - -**Symptoms** : Plugin installs but references to files fail, especially files outside the plugin directory **Cause** : Claude Code copies installed plugins to a cache directory, unless the plugin loads in place. A `command` source in link mode loads in place, and so does a relative path source in a marketplace added from a local directory. Paths that reference files outside a copied plugin’s directory (such as `../shared-utils`) won’t work because those files aren’t copied. **Solutions** : See [Plugin caching and file resolution](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for workarounds including symlinks and directory restructuring. For additional debugging tools and common issues, see [Debugging and development tools](</docs/en/plugins-reference#debugging-and-development-tools>). - -## - -​ - -See also - - * [Discover and install prebuilt plugins](</docs/en/discover-plugins>) \- Installing plugins from existing marketplaces - * [Plugins](</docs/en/plugins>) \- Creating your own plugins - * [Plugins reference](</docs/en/plugins-reference>) \- Complete technical specifications and schemas - * [Plugin settings](</docs/en/settings-reference#plugin-settings>) \- Plugin configuration options - * [strictKnownMarketplaces reference](</docs/en/settings-reference#strictknownmarketplaces>) \- Managed marketplace restrictions
removed plugin-relevance View current →
Show diff (163 lines)
--- a/plugin-relevance.md +++ b/plugin-relevance.md @@ -1,160 +0,0 @@ -If you operate a plugin marketplace for your organization, you can have Claude Code suggest specific plugins to users based on what they are working on. Add a `relevance` block to a plugin’s entry in `marketplace.json`, then allowlist the marketplace in managed settings. When a user’s session matches one of the declared signals, Claude Code surfaces an install suggestion for that plugin. Marketplace-declared suggestions are opt-in per marketplace through [managed settings](</docs/en/managed-settings>). No marketplace’s `relevance` declarations produce suggestions until an administrator adds it to the allowlist, including the official Anthropic marketplace. Claude Code also includes one built-in suggestion that is independent of this allowlist; that tip and all marketplace-declared tips are disabled when [`spinnerTipsEnabled`](</docs/en/settings-reference#spinnertipsenabled>) is set to `false`. This page is for marketplace operators and enterprise administrators. If you are looking to install plugins, see [Discover and install plugins](</docs/en/discover-plugins>). - -## - -​ - -How it works - -Each plugin entry in `marketplace.json` can carry a `relevance` object. The object names a topic and one or more signals. A signal is a pattern that Claude Code tests against the current session, such as the working directory or files Claude has read. Signal matching happens locally on the user’s machine. The matching adds no network traffic and does not report which signals matched, or their values, to Anthropic or to the marketplace operator. When a signal matches and the plugin is not already installed, Claude Code shows the plugin in three places: - - * **Spinner tip** : a “Working with _topic_? Install the _plugin_ plugin” message with the `/plugin install` command appears below the spinner while Claude is responding. - * **Session-start suggestion** : if the `cwd` signal matches the working directory, a one-line `plugin suggestion: <name>@<marketplace> · /plugin` notification appears before the first turn. - * **`/plugin` Discover tab**: the plugin is pinned to the top of the Discover list with an annotation such as “suggested for this directory” or “suggested for stripe commands”. - -The spinner tip and the session-start notification are part of the spinner-tips system. Claude Code disables both when `spinnerTipsEnabled` resolves to `false` across your settings files, or when `excludeDefault` resolves to `true` across the [`spinnerTipsOverride`](</docs/en/settings-reference#spinnertipsoverride>) keys in user, `--settings`, and managed settings and those keys configure at least one tip or a `tipsFile`. The Discover-tab pin is independent of tip settings. Claude Code never installs a plugin automatically. The user always confirms. - -## - -​ - -Add relevance to a plugin entry - -Add a `relevance` object to the plugin’s entry in your `marketplace.json`. The following example declares that the `terraform-helpers` plugin is relevant when Claude reads a `.tf` file or when Claude runs `terraform`: - - { - "name": "acme-corp-plugins", - "owner": { "name": "Acme Platform Team" }, - "plugins": [ - { - "name": "terraform-helpers", - "source": "./plugins/terraform-helpers", - "description": "Acme conventions and helpers for Terraform", - "relevance": { - "topic": "Terraform", - "signals": { - "cli": ["terraform"], - "filesRead": ["**/*.tf"] - } - } - } - ] - } - -A plugin with a `relevance` block but no matching signal behaves like any other marketplace entry. It appears in the Discover list in its normal position and never surfaces as a spinner tip. - -## - -​ - -Field reference - -### - -​ - -`relevance` - -Field| Type| Description ----|---|--- -`topic`| string| Optional. The phrase that fills “Working with _topic_?” in the spinner tip. Often the product name, for example `Stripe`. Use a domain such as `design` when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen segment capitalized. The session-start notification does not use this value. Maximum 64 characters. -`signals`| object| Matchers that determine when the plugin is relevant. At least one signal is required for the plugin to be suggestible. See the table below. - -### - -​ - -`relevance.signals` - -Field| Type| Description ----|---|--- -`cwd`| array of strings| Glob patterns matched against the session’s working directory. Matched as an absolute path and, when inside a git repository, as a path relative to the repository root. Forward-slash normalized and case-insensitive. Every pattern matches the directory itself and everything under it, so `infra`, `infra/`, and `infra/**` behave identically. This is the only signal that can match at session start, before the first turn. Maximum 10 patterns of 256 characters each. -`cli`| array of strings| Command names from shell commands Claude has run this session, for example `["stripe"]`. Applies on every platform: commands run on Windows through PowerShell or Git Bash are recorded the same way. Claude Code records one command name per shell tool invocation: the first token after any leading environment variable assignments and `sudo`. Compound commands contribute only their leading command, so `cd infra && terraform plan` records `cd`, not `terraform`. Exact match. Maximum 10 entries of 64 characters each. -`hosts`| array of strings| Hostnames seen in `http://` or `https://` URLs in Bash commands this session, for example `["api.stripe.com"]`. Bare lowercase hostname only: no scheme, port, or path. Exact case-insensitive match. Maximum 20 entries of 128 characters each. -`filesRead`| array of strings| Glob patterns matched against the paths of files Claude has read this session, for example `["**/*.tf"]`. Forward-slash normalized and case-insensitive. Maximum 10 patterns of 256 characters each. -`manifestDeps`| array of objects| Dependencies declared in package manifests Claude has read this session. Each entry is `{ "file": "...", "pattern": "..." }`, where `file` is a regular expression matched against the manifest file’s path as recorded in session state, typically an absolute path, and `pattern` is a regular expression matched against that file’s contents. Anchor `file` at the end, for example `[/\\\\]package\\.json$` in JSON-escaped form, because a start-anchored pattern never matches an absolute path. Paths are not separator-normalized for this signal, so Windows paths use backslashes. Manifest files larger than 512 KB are skipped. Both values are JavaScript `RegExp` source strings of at most 256 characters. `file` matches case-insensitively. `pattern` is case-sensitive. Maximum 10 entries. - -The `cli`, `hosts`, `filesRead`, and `manifestDeps` signals need session history, so they can only match on the spinner tip and the Discover tab. The `filesRead` and `manifestDeps` signals test the session’s recorded file state, which also includes files Claude has written or edited and auto-loaded `CLAUDE.md` memory files. For these two signals, Claude Code skips paths under its own [configuration directory](</docs/en/claude-directory>) and its temporary directories. The following example uses `manifestDeps` to suggest a Stripe plugin once Claude has read a `package.json` that depends on `stripe`. The `file` pattern uses `[/\\\\]` so it matches both forward-slash and backslash path separators, and `\\.` so the dot is literal. In JSON, each backslash in the regular expression is written twice. - - { - "name": "stripe-helpers", - "source": "./plugins/stripe-helpers", - "relevance": { - "topic": "Stripe", - "signals": { - "manifestDeps": [ - { - "file": "[/\\\\]package\\.json$", - "pattern": "\"stripe\"\\s*:" - } - ] - } - } - } - -Claude Code ignores unknown fields under `relevance` and `relevance.signals` at load time, so older clients continue to load your marketplace. - -## - -​ - -Enable suggestions in managed settings - -Declaring `relevance` in `marketplace.json` is not enough on its own. An administrator must allowlist the marketplace in [managed settings](</docs/en/managed-settings>) before its suggestions appear to users. Add the marketplace name to `pluginSuggestionMarketplaces`. For any marketplace other than the official Anthropic marketplace, also declare the marketplace source in the same managed settings, either as that name’s entry in `extraKnownMarketplaces` or as an entry in `strictKnownMarketplaces`. The allowlisted name is ignored if the marketplace registered on the machine came from a different source. This prevents an unrelated source from registering under an allowlisted name to have its plugins suggested across your org. The following `managed-settings.json` registers an org marketplace from a GitHub repository and enables its suggestions: - - { - "extraKnownMarketplaces": { - "acme-corp-plugins": { - "source": { - "source": "github", - "repo": "acme-corp/claude-plugins" - } - } - }, - "pluginSuggestionMarketplaces": ["acme-corp-plugins"] - } - -The official marketplace is exempt from the source-declaration requirement because its name can only register from the official Anthropic source. Allowlisting the name alone is sufficient: - - { - "pluginSuggestionMarketplaces": ["claude-plugins-official"] - } - -## - -​ - -What the user sees - -When a signal matches during a session, the spinner tip reads: - - Working with Terraform? Install the terraform-helpers plugin: - /plugin install terraform-helpers@acme-corp-plugins - -At session start, a matching `cwd` signal surfaces the one-line notification: - - plugin suggestion: terraform-helpers@acme-corp-plugins · /plugin - -A given plugin’s suggestion appears at most once every three sessions across the spinner tip and the session-start notification combined, and neither repeats once the plugin is installed. The session-start notification additionally stops appearing after the suggestion has been shown twice. In the `/plugin` Discover tab, the plugin is pinned above the other results with an annotation that names the matching signal, such as `suggested for this directory` or `suggested for terraform commands`. The Discover tab pins a given plugin once; later visits list it in normal order. - -## - -​ - -Validate your marketplace - -Run `claude plugin validate` against your marketplace directory to check the `relevance` block before publishing: - - claude plugin validate ./my-marketplace - -The validator reports unknown keys under `relevance` and `relevance.signals` as warnings, flags a `relevance` value that is not an object, and rejects a `signals.hosts` entry that includes a scheme, port, or path. - -## - -​ - -See also - - * [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>): build the marketplace that hosts your plugins - * [Recommend your plugin from your CLI](</docs/en/plugin-hints>): prompt users from your own CLI instead of from Claude Code’s session signals - * [All settings](</docs/en/settings-reference#pluginsuggestionmarketplaces>): `pluginSuggestionMarketplaces` and `extraKnownMarketplaces`
removed plugins-reference View current →
Show diff (1486 lines)
--- a/plugins-reference.md +++ b/plugins-reference.md @@ -1,1483 +0,0 @@ -Looking to install plugins? See [Discover and install plugins](</docs/en/discover-plugins>). For creating plugins, see [Plugins](</docs/en/plugins>). For distributing plugins, see [Plugin marketplaces](</docs/en/plugin-marketplaces>). - -A **plugin** is a self-contained directory of components that extends Claude Code with custom functionality. Plugin components include skills, agents, hooks, MCP servers, LSP servers, and monitors. - -## - -​ - -Plugin components reference - -### - -​ - -Skills - -Plugins add skills to Claude Code, creating `/name` shortcuts that you or Claude can invoke. **Location** : `skills/` or `commands/` directory in plugin root, or a single `SKILL.md` file at the plugin root **File format** : Skills are directories with `SKILL.md`; commands are simple markdown files **Skill structure** : - - skills/ - ├── pdf-processor/ - │ ├── SKILL.md - │ ├── reference.md (optional) - │ └── scripts/ (optional) - └── code-reviewer/ - └── SKILL.md - -Skills and commands are automatically discovered when the plugin is installed. If a plugin has no `skills/` directory and no `skills` manifest field, a `SKILL.md` at the plugin root is loaded as a single skill. Set the frontmatter `name` field to control the skill’s invocation name. Without it, Claude Code falls back to the install directory name. For a plugin copied into the cache, that name is a version string that changes on every update. For plugins that ship more than one skill, use the `skills/` directory layout shown above. In plugin skills and commands, Boolean frontmatter fields such as `disable-model-invocation` accept `yes`, `no`, `on`, `off`, `1`, and `0` in any letter case, in addition to `true` and `false`. Before v2.1.218, Claude Code recognized only `true` and `false`. For complete details, see [Skills](</docs/en/skills>). - -### - -​ - -Agents - -Plugins can provide specialized subagents for specific tasks that Claude can invoke automatically when appropriate. **Location** : `agents/` directory in plugin root **File format** : Markdown files describing agent capabilities **Agent structure** : - - --- - name: agent-name - description: What this agent specializes in and when Claude should invoke it - model: sonnet - effort: medium - maxTurns: 20 - disallowedTools: Write, Edit - --- - - Detailed system prompt for the agent describing its role, expertise, and behavior. - -#### - -​ - -Plugin agent frontmatter - -A plugin agent file uses the same [frontmatter fields as a subagent file](</docs/en/sub-agents#supported-frontmatter-fields>), except that Claude Code honors only some of them when the agent comes from a plugin: - - * **Supported** : `name`, `description`, `model`, `effort`, `maxTurns`, `tools`, `disallowedTools`, `skills`, `memory`, `background`, `omitClaudeMd`, `isolation`, `color`, and `experimental`. The only valid `isolation` value is `"worktree"`. - * **Not supported, for security reasons** : `hooks`, `mcpServers`, and `permissionMode`. Claude Code ignores these when loading an agent from a plugin. To use them, copy the agent file into `.claude/agents/` or `~/.claude/agents/`. - * **Not supported** : `initialPrompt`. - -You can put plugin agent files in subfolders of `agents/`. Claude Code [loads them recursively](</docs/en/sub-agents#choose-the-subagent-scope>) and joins the plugin name, each subfolder name, and the file name with colons to form the agent’s scoped name. For example, `agents/review/security.md` in a plugin named `my-plugin` loads as `my-plugin:review:security`. Two settings change that name: - - * Frontmatter `name`: it replaces only the file name, so `name: audit` in `agents/review/security.md` loads as `my-plugin:review:audit` - * Manifest `agents` field: a file you list there loads without subfolder names, so `"agents": "./custom/review/security.md"` loads as `my-plugin:security` - -Claude Code loads a plugin agent even when its frontmatter has no `name` or doesn’t parse: - - * No `name`: Claude Code names the agent after the file, so `agents/reviewer.md` in a plugin named `my-plugin` loads as `my-plugin:reviewer` - * Frontmatter that doesn’t parse: Claude Code names the agent after the file, uses `Agent from my-plugin plugin` as its description, and ignores every field in the file - -By contrast, Claude Code skips a project, user, or managed agent file whose frontmatter has no `name` or doesn’t parse. To find files in a plugin’s default `agents/` directory whose frontmatter doesn’t parse, run `claude plugin validate`. The path you pass depends on whether the plugin has a manifest, and both examples use `./my-plugin` as the plugin directory: - - * A plugin with a manifest: `claude plugin validate ./my-plugin` - * A plugin without a manifest: `claude plugin validate ./my-plugin/agents`. Requires Claude Code v2.1.233 or later. - -Agents appear in the [@-mention typeahead](</docs/en/sub-agents#invoke-subagents-explicitly>) under their scoped name, such as `my-plugin:code-reviewer`, once the plugin is enabled. For complete details, see [Subagents](</docs/en/sub-agents>). - -### - -​ - -Hooks - -Plugins can provide event handlers that respond to Claude Code events automatically. **Location** : `hooks/hooks.json` in plugin root, or inline in plugin.json **Format** : JSON configuration with event matchers and actions `hooks/hooks.json` can carry a top-level `$schema` key that names a JSON Schema URL for editor autocomplete and validation. Claude Code ignores the key at load time. **Hook configuration** : - - { - "hooks": { - "PostToolUse": [ - { - "matcher": "Write|Edit", - "hooks": [ - { - "type": "command", - "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/format-code.sh" - } - ] - } - ] - } - } - -Plugin hooks respond to the same lifecycle events as [user-defined hooks](</docs/en/hooks>): - -Event| When it fires ----|--- -`SessionStart`| When a session begins or resumes -`Setup`| When you start Claude Code with `--init-only`, or with `--init` or `--maintenance` in `-p` mode. For one-time preparation in CI or scripts -`UserPromptSubmit`| When you submit a prompt, before Claude processes it -`UserPromptExpansion`| When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion -`PreToolUse`| Before a tool call executes. Can block it -`PermissionRequest`| When a tool call needs a permission decision -`PermissionDenied`| When auto mode denies a tool call, including denials without a classifier verdict. Use JSON `hookSpecificOutput.retry: true` to tell the model it may retry the denied tool call. Claude Code ignores `retry` when the classifier produced no verdict -`PostToolUse`| After a tool call succeeds -`PostToolUseFailure`| After a tool call fails -`PostToolBatch`| After a full batch of parallel tool calls resolves, before the next model call -`Notification`| When Claude Code sends a notification -`MessageDisplay`| While assistant message text is displayed -`SubagentStart`| When a subagent is spawned -`SubagentStop`| When a subagent finishes -`TaskCreated`| When a task is being created via `TaskCreate` -`TaskCompleted`| When a task is being marked as completed -`Stop`| When Claude finishes responding -`StopFailure`| When the turn ends due to an API error -`TeammateIdle`| When an [agent team](</docs/en/agent-teams>) teammate is about to go idle -`InstructionsLoaded`| When a CLAUDE.md or `.claude/rules/*.md` file is loaded into context. Fires at session start and when files are lazily loaded during a session -`ConfigChange`| When a configuration file changes during a session -`CwdChanged`| When the working directory changes, for example when Claude executes a `cd` command. Useful for reactive environment management with tools like direnv -`DirectoryAdded`| When a working directory is added mid-session via `/add-dir` or the SDK `register_repo_root` control request -`FileChanged`| When a watched file changes on disk. The `matcher` field specifies which filenames to watch -`WorktreeCreate`| When a worktree is being created via `--worktree`, `isolation: "worktree"`, or for a background session. Replaces default git behavior -`WorktreeRemove`| When a worktree is being removed at session exit, when a subagent finishes, or when you delete a background session -`PreCompact`| Before context compaction -`PostCompact`| After context compaction completes -`PreModelSwitch`| Before Claude Code applies a model switch that you or a client requested. Can block the switch -`PostModelSwitch`| After the session’s model changes, including changes Claude Code makes on its own, such as restoring the model when you resume a session -`Elicitation`| When an MCP server requests user input during a tool call -`ElicitationResult`| After a user responds to an MCP elicitation, before the response is sent back to the server -`SessionEnd`| When a session terminates - -**Hook types** : - - * `command`: execute shell commands or scripts - * `http`: send the event JSON as a POST request to a URL - * `mcp_tool`: call a tool on a configured [MCP server](</docs/en/mcp>) - * `prompt`: evaluate a prompt with an LLM (uses `$ARGUMENTS` placeholder for context) - * `agent`: run an agentic verifier with tools for complex verification tasks - -Hooks that target the plugin’s own bundled MCP server must use its scoped names. Tool matchers and `if` fields take the scoped tool name `mcp__plugin_<plugin-name>_<server-name>__<tool>`, and an `mcp_tool` hook’s `server` field takes `plugin:<plugin-name>:<server-name>`. A matcher written against the bare server key never fires. See [Match MCP tools](</docs/en/hooks#match-mcp-tools>) and [Plugin-provided MCP servers](</docs/en/mcp#plugin-provided-mcp-servers>). - -### - -​ - -MCP servers - -Plugins can bundle Model Context Protocol (MCP) servers to connect Claude Code with external tools and services. **Location** : `.mcp.json` in plugin root, or inline in plugin.json **Format** : Standard MCP server configuration **MCP server configuration** : - - { - "mcpServers": { - "plugin-database": { - "command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server", - "args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"], - "env": { - "DB_PATH": "${CLAUDE_PLUGIN_ROOT}/data" - } - }, - "plugin-api-client": { - "command": "npx", - "args": ["@company/mcp-server", "--plugin-mode"] - } - } - } - -**Integration behavior** : - - * Plugin MCP servers start automatically when the plugin is enabled - * Servers appear as standard MCP tools in Claude’s toolkit - * Plugin servers can be configured independently of user MCP servers - * If you run [`/reload-plugins`](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) mid-session, Claude Code keeps the live connections of servers whose configuration is unchanged - -### - -​ - -LSP servers - -Looking to use LSP plugins? Install them from the official marketplace: search for “lsp” in the `/plugin` Discover tab. This section documents how to create LSP plugins for languages not covered by the official marketplace. - -Plugins can provide [Language Server Protocol](<https://microsoft.github.io/language-server-protocol/>) (LSP) servers to give Claude [real-time code intelligence](</docs/en/discover-plugins#code-intelligence>) while working on your codebase. **Location** : `.lsp.json` in plugin root, or inline in `plugin.json` **Format** : JSON configuration mapping language server names to their configurations **`.lsp.json` file format**: - - { - "go": { - "command": "gopls", - "args": ["serve"], - "extensionToLanguage": { - ".go": "go" - } - } - } - -**Inline in`plugin.json`**: - - { - "name": "my-plugin", - "lspServers": { - "go": { - "command": "gopls", - "args": ["serve"], - "extensionToLanguage": { - ".go": "go" - } - } - } - } - -**Required fields:** - -Field| Description ----|--- -`command`| The LSP binary to execute (must be in PATH) -`extensionToLanguage`| Maps file extensions to language identifiers - -**Optional fields:** - -Field| Description ----|--- -`args`| Command-line arguments for the LSP server -`transport`| Communication transport: `stdio` (default) or `socket`. Claude Code accepts `socket` but runs every server over stdio, so the stdout protocol rules apply to all servers -`env`| Environment variables to set when starting the server -`initializationOptions`| Options passed to the server during initialization -`settings`| Settings passed via `workspace/didChangeConfiguration` -`workspaceFolder`| Workspace folder path for the server -`startupTimeout`| Max time to wait for server startup (milliseconds) -`shutdownTimeout`| Max time to wait for graceful shutdown (milliseconds). When the timeout elapses, Claude Code terminates the server process. When unset, no timeout applies -`restartOnCrash`| Whether to restart the server after it crashes. Defaults to `true`. Set to `false` to leave a crashed server stopped instead of restarting it -`maxRestarts`| Maximum number of restart attempts before giving up -`diagnostics`| Whether to push diagnostics into Claude’s context after edits (default `true`). Set to `false` to keep code navigation but suppress automatic diagnostic injection. - -`restartOnCrash` and `shutdownTimeout` require Claude Code v2.1.205 or later. Before v2.1.205, the config schema accepted both options but setting either one caused Claude Code to skip that LSP server entirely at startup, with the reason visible only in `claude --debug` output. **Multiple servers for the same extension** : when more than one enabled LSP server declares the same file extension in `extensionToLanguage`, whether the servers come from one plugin or from different plugins, the first server registered handles files with that extension and the others never start. The `/plugin` interface shows a warning naming the plugin whose server is active. **Servers that fail to initialize** : Claude Code skips a server whose configuration is invalid, for example one missing `command` or `extensionToLanguage`, and the other configured servers still start. Run `claude --debug` to see why a server was skipped. A skipped server doesn’t claim its file extensions, so another valid server that declares the same extension, from the same or a different plugin, still handles those files. **Send log output to stderr, not stdout** : Claude Code reads a server’s stdout as protocol messages only, and accepts message headers up to 64 KiB and a message body up to 32 MiB. Claude Code disconnects a server that exceeds either limit or writes non-protocol output to stdout, and counts the disconnect as a crash for `restartOnCrash` and `maxRestarts`. When you run with `--debug`, Claude Code writes an error naming the cause to the debug log. - -**You must install the language server binary separately.** LSP plugins configure how Claude Code connects to a language server, but they don’t include the server itself. If you see `Executable not found in $PATH` in the `/plugin` Errors tab, install the required binary for your language. - -**Available LSP plugins:** - -Plugin| Language server| Install command ----|---|--- -`pyright-lsp`| Pyright (Python)| `pip install pyright` or `npm install -g pyright` -`typescript-lsp`| TypeScript Language Server| `npm install -g typescript-language-server typescript` -`rust-analyzer-lsp`| rust-analyzer| [See rust-analyzer installation](<https://rust-analyzer.github.io/manual.html#installation>) - -Install the language server first, then install the plugin from the marketplace. - -### - -​ - -Monitors - -Plugins can declare background monitors that Claude Code starts automatically when the plugin is active. Each monitor runs a shell command for the lifetime of the session and delivers every stdout line to Claude as a notification, so Claude can react to log entries, status changes, or polled events without being asked to start the watch itself. Plugin monitors use the same mechanism as the [Monitor tool](</docs/en/tools-reference#monitor-tool>) and share its availability constraints. They run only in interactive CLI sessions, run unsandboxed at the same trust level as hooks, and are skipped on hosts where the Monitor tool is unavailable. **Location** : `monitors/monitors.json` in the plugin root, or inline in `plugin.json` **Format** : JSON array of monitor entries The following `monitors/monitors.json` watches a deployment status endpoint and a local error log: - - [ - { - "name": "deploy-status", - "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/poll-deploy.sh", - "description": "Deployment status changes" - }, - { - "name": "error-log", - "command": "tail -F ./logs/error.log", - "description": "Application error log", - "when": "on-skill-invoke:debug" - } - ] - -To declare monitors inline, set `experimental.monitors` in `plugin.json` to the same array. To load from a non-default path, set `experimental.monitors` to a relative path string such as `"./config/monitors.json"`. Monitors are an experimental component. **Required fields:** - -Field| Description ----|--- -`name`| Identifier unique within the plugin. Prevents duplicate processes when the plugin reloads or a skill is invoked again -`command`| Shell command run as a persistent background process in the session working directory -`description`| Short summary of what is being watched. Shown in the task panel and in notification summaries - -**Optional fields:** - -Field| Description ----|--- -`when`| Controls when the monitor starts. `"always"` starts it at session start and on plugin reload, and is the default. `"on-skill-invoke:<skill-name>"` starts it the first time the named skill in this plugin is dispatched - -The `command` value supports the path substitutions `${CLAUDE_PLUGIN_ROOT}`, `${CLAUDE_PLUGIN_DATA}`, and `${CLAUDE_PROJECT_DIR}`, plus any `${ENV_VAR}` from the environment. Prefix the command with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs to run from the plugin’s own directory. A monitor `command` can’t reference `${user_config.*}` values. The command runs through a shell, so Claude Code rejects the monitor with an [error](</docs/en/errors#plugin-command-references-user-config>) instead of substituting the value. Monitor processes don’t receive `CLAUDE_PLUGIN_OPTION_<KEY>` environment variables, so have the monitor script read the value from a config file it owns. If you disable a plugin mid-session, Claude Code doesn’t stop monitors that are already running; they stop when the session ends. - -### - -​ - -Themes - -Plugins can ship color themes that appear in `/theme` alongside the built-in presets and the user’s local themes. A theme is a JSON file in `themes/` with a `base` preset and a sparse `overrides` map of color tokens. Themes are an experimental component. - - { - "name": "Dracula", - "base": "dark", - "overrides": { - "claude": "#bd93f9", - "error": "#ff5555", - "success": "#50fa7b" - } - } - -When a user selects a plugin theme, Claude Code saves `custom:<plugin-name>:<slug>` in their config. Plugin themes are read-only: when a user presses `Ctrl+E` on one in `/theme`, Claude Code copies it into `~/.claude/themes/` so they can edit the copy. - -* * * - -## - -​ - -Plugin installation scopes - -When you install a plugin, you choose a **scope** that determines where the plugin is available and who else can use it: - -Scope| Settings file| Use case ----|---|--- -`user`| `~/.claude/settings.json`| Personal plugins available across all projects (default) -`project`| `.claude/settings.json`| Team plugins shared via version control -`local`| `.claude/settings.local.json`| Project-specific plugins, gitignored when Claude Code saves a setting to it -`managed`| [Managed settings](</docs/en/managed-settings>)| Managed plugins (read-only, update only) - -Plugins use the same scope system as other Claude Code configurations. For installation instructions and scope flags, see [Install plugins](</docs/en/discover-plugins#install-plugins>). For a complete explanation of scopes, see [Configuration scopes](</docs/en/settings#where-settings-live>). - -* * * - -## - -​ - -Skills-directory plugins - -Any folder under a skills directory that contains a `.claude-plugin/plugin.json` manifest is loaded as a plugin named `<name>@skills-dir` on the next session, with no marketplace and no install step. Scaffold one with `plugin init`. Unlike a copied marketplace install, the plugin is discovered in place rather than copied into the plugin cache. A skills directory tree supports three distinct things: - -What you have| What it is ----|--- -`<skills-dir>/foo/SKILL.md` with no manifest| A plain [skill](</docs/en/skills>) named `foo` -`<skills-dir>/foo/.claude-plugin/plugin.json`| A plugin `foo@skills-dir`, which can bundle its own skills, agents, hooks, and more -`<plugin>/skills/bar/SKILL.md`| A skill `bar` packaged inside a plugin - -### - -​ - -Choose where the plugin loads from - -Skills directory| Scope| Loads ----|---|--- -`~/.claude/skills/`| personal| In every project, since the location is yours alone -`<cwd>/.claude/skills/`| project| Only after you accept the workspace [trust dialog](</docs/en/permissions#what-runs-before-you-trust-a-folder>) for that folder - -A project-scope plugin is checked into the repository and reaches every collaborator who clones it. Because that content comes from the repository rather than from you, it loads only after the same trust gate that governs project allow rules in `.claude/settings.json`, so trusting a parent folder or running with `-p` isn’t enough, and components that run code are restricted further: - - * MCP servers it declares go through the [same per-server approval](</docs/en/mcp>) as a project `.mcp.json` - * LSP servers start only after you trust the workspace - * Background monitors do not load - -Personal-scope plugins have none of these restrictions. - -Project-scope `@skills-dir` plugins load only from the `.claude/skills/` of the session’s [primary working directory](</docs/en/permissions#working-directories>). They don’t [walk up to the repository root](</docs/en/skills#discovery-from-parent-and-nested-directories>) the way plain skills and commands do, so launching from a subdirectory misses a plugin that lives at the repo root. Launch from the repository root, or [move the session there with `/cd`](</docs/en/permissions#move-the-session-to-another-directory>) on v2.1.246 or later. - -### - -​ - -Edit, reload, and disable a skills-directory plugin - -Changes you make to a skill’s `SKILL.md` take effect immediately in the current session. Changes to the plugin’s other components, such as `hooks/`, `.mcp.json`, `agents/`, and `output-styles/`, do not. Run `/reload-plugins` or restart Claude Code to pick those up. See [Live change detection](</docs/en/skills#live-change-detection>). To stop loading a skills-directory plugin, delete its folder or disable it by name. There is no `uninstall` step because nothing was installed from a marketplace. - - claude plugin disable my-tool@skills-dir - -* * * - -## - -​ - -Plugins synced from claude.ai - -Claude Code loads the plugins enabled for your claude.ai account, including plugins your organization turns on for its members, alongside the plugins you install from marketplaces. It downloads each one into `~/.claude/plugins/synced/` and loads it as `<name>@synced`, with no marketplace and no install record. A synced plugin runs with the same trust as a marketplace plugin you installed: its skills, agents, hooks, MCP servers, and LSP servers all load. Where Claude Code syncs these plugins depends on the session: - - * In [Cowork](<https://claude.com/product/cowork>) and [cloud sessions](</docs/en/cloud-environments#what-carries-over-from-your-setup>), Claude Code downloads them into the session’s own environment when the session starts. Before v2.1.239, Claude Code loaded these plugins as `<name>@inline`, the identity that `--plugin-dir` plugins use. - * In terminal sessions where you sign in with your claude.ai account, Claude Code checks your account once each time it starts, then downloads new and updated plugins and removes the ones that you or your organization turned off, all in the background. Syncing in terminal sessions requires Claude Code v2.1.273 or later. - -The launch check runs in the background, so it can finish after your session has started. When it adds, updates, or removes a synced plugin in an interactive session, Claude Code shows `Plugins changed. Run /reload-plugins to activate.` Run [`/reload-plugins`](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) to load the change in that session, or leave it for the next time you start Claude Code. If you enable a plugin on claude.ai while a session is running, Claude Code downloads it the next time it starts. Plugin sync in terminal sessions runs under the same sign-in conditions as [skills synced from claude.ai](</docs/en/skills#where-synced-skills-load>). It also needs a sign-in that grants Claude Code access to your account’s plugins. A sign-in from an earlier version of Claude Code picks up plugin access the next time Claude Code renews that sign-in in the background, within a few hours, or right away if you run `/login` again. Plugin sync starts the next time you start Claude Code after that. `claude plugin list` shows synced plugins under a `Synced from claude.ai` heading, and the `/plugin` **Installed** tab lists them with `synced` as their source. Manage a synced plugin by the `<name>@synced` ID that `claude plugin list` prints: - - * **Turn one off** : run `claude plugin disable <name>@synced`, or disable it from the `/plugin` **Installed** tab. Claude Code saves the choice as `"<name>@synced": false` in your user-level [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>). To turn the plugin back on, run `claude plugin enable <name>@synced`. - * **Keep one out everywhere** : [turn the plugin off for your claude.ai account](</docs/en/desktop#extend-claude-code>). To keep it out of one project in every environment, set `"<name>@synced": false` under `enabledPlugins` in that project’s committed `.claude/settings.json`. - * **Manage the plugin itself on claude.ai** : `claude plugin install`, `update`, and `uninstall` don’t apply to a synced plugin. Claude Code downloads a plugin’s updates at the next sync. To remove one, turn the plugin off for your claude.ai account, and Claude Code removes it at the next sync. - * **Stop syncing on a machine** : set [`syncClaudeAiPlugins`](</docs/en/settings-reference#syncclaudeaiplugins>) to `false` in your user settings. Claude Code stops downloading, and the next time it starts it moves the plugins it already synced to `~/.claude/plugins/.trash/` and no longer loads them. Your organization can set the same key in [managed settings](</docs/en/managed-settings>), or turn off Skills on claude.ai, which stops plugins from syncing too. - -You can’t turn off a plugin that your organization marks as required on claude.ai. Claude Code loads it even if you disabled it earlier, and `claude plugin disable` refuses with `Plugin "<name>@synced" is required by your organization and can't be disabled here. Contact your admin to change it.` In `claude plugin list`, these plugins are marked `required by your org`. When an enabled plugin from any other source matches a synced plugin’s name, Claude Code loads that plugin and reports the synced copy as not loaded. Other sources include marketplace installs, skills-directory plugins, `--plugin-dir` plugins, and plugins built into Claude Code. To use the claude.ai copy instead, disable your own copy. Before v2.1.239, Claude Code loaded the synced copy instead of a same-named marketplace install. - -* * * - -## - -​ - -Plugin manifest schema - -The `.claude-plugin/plugin.json` file defines your plugin’s metadata and configuration. The manifest is optional. If omitted, Claude Code auto-discovers components in default locations and derives the plugin name from the directory name. Use a manifest when you need to provide metadata or custom component paths. - -### - -​ - -Complete schema - - { - "name": "plugin-name", - "displayName": "Plugin Name", - "version": "1.2.0", - "description": "Brief plugin description", - "author": { - "name": "Author Name", - "email": "author@example.com", - "url": "https://github.com/author" - }, - "homepage": "https://docs.example.com/plugin", - "repository": "https://github.com/author/plugin", - "license": "MIT", - "keywords": ["keyword1", "keyword2"], - "metadata": { "catalogId": "cat-123", "tier": "pro" }, - "skills": "./custom/skills/", - "commands": ["./custom/commands/special.md"], - "agents": ["./custom/agents/reviewer.md"], - "hooks": "./config/hooks.json", - "mcpServers": "./mcp-config.json", - "outputStyles": "./styles/", - "lspServers": "./.lsp.json", - "experimental": { - "themes": "./themes/", - "monitors": "./monitors.json", - "evals": "quality/evals" - }, - "dependencies": [ - "helper-lib", - { "name": "secrets-vault", "version": "~2.1.0" } - ] - } - -### - -​ - -Required fields - -If you include a manifest, `name` is the only required field. - -Field| Type| Description| Example ----|---|---|--- -`name`| string| Unique identifier in kebab-case, with no spaces, control characters, or bidirectional-formatting characters. When a [marketplace entry](</docs/en/plugin-marketplaces#plugin-entries>) lists the plugin under a different name, the marketplace entry name is what `enabledPlugins` keys and `/plugin` use| `"deployment-tools"` - -This name is used for namespacing components. For example, in the UI, the agent `agent-creator` for the plugin with name `plugin-dev` will appear as `plugin-dev:agent-creator`. - -### - -​ - -Unrecognized fields - -Claude Code ignores top-level fields it does not recognize. You can keep metadata from another ecosystem in `plugin.json` and the plugin still loads. This makes it practical to maintain one manifest that doubles as a VS Code or Cursor extension manifest, an npm `package.json`, or an MCPB/DXT bundle manifest. `claude plugin validate` reports unrecognized fields as warnings, not errors. If a field is one or two characters off from a recognized one, the warning suggests the likely intended name. A plugin with only unrecognized-field warnings still passes validation and loads at runtime. How Claude Code handles a recognized field whose value has the wrong type depends on the field: - - * **Most fields** : the plugin fails to load. For example, a `keywords` value that is a string instead of an array is a load error, and `claude plugin validate` reports it as one. - * **`experimental` and `metadata`**: Claude Code ignores a non-object value, and `claude plugin validate` reports a warning. - -Pass `--strict` to treat warnings as errors. Use it in CI to catch a misspelled field name or a field left over from another tool’s manifest before publishing, even though the plugin would load at runtime. - - claude plugin validate ./my-plugin --strict - -### - -​ - -Metadata fields - -Field| Type| Description| Example ----|---|---|--- -`$schema`| string| JSON Schema URL for editor autocomplete and validation. Claude Code ignores this field at load time.| `"https://json.schemastore.org/claude-code-plugin-manifest.json"` -`displayName`| string| Human-readable name shown in the `/plugin` picker and other UI surfaces. For a marketplace-installed plugin, a `displayName` on the [marketplace entry](</docs/en/plugin-marketplaces#optional-plugin-fields>) takes precedence over this value. When no display name is set in either place, users see `name`. Unlike `name`, may contain spaces and any casing. Not used for namespacing or lookup.| `"Deployment Tools"` -`version`| string| Optional. Semantic version. Setting this pins the plugin to that version string, so users only receive updates when you bump it, except for a [`command` source](</docs/en/plugin-marketplaces#command-sources>) or a plugin loaded in place; see Version management. If also set in the marketplace entry, `plugin.json` wins. If omitted, the version comes from the next source in Version management.| `"2.1.0"` -`description`| string| Brief explanation of plugin purpose| `"Deployment automation tools"` -`author`| object| Author information| `{"name": "Dev Team", "email": "dev@company.com"}` -`homepage`| string| Documentation URL| `"https://docs.example.com"` -`repository`| string| Source code URL| `"https://github.com/user/plugin"` -`license`| string| License identifier| `"MIT"`, `"Apache-2.0"` -`keywords`| array| Discovery tags| `["deployment", "ci-cd"]` -`metadata`| object| Free-form object for your own data, such as entitlement or catalog fields. Claude Code doesn’t read it, so the values never affect plugin behavior. Claude Code ignores a non-object value, and `claude plugin validate` reports it as a warning. Before v2.1.222, Claude Code treated the key as an unrecognized field.| `{"catalogId": "cat-123"}` -`defaultEnabled`| boolean| Whether the plugin starts in an enabled state when the user has not set one. Defaults to `true`. See Default enablement.| `false` - -### - -​ - -Default enablement - -Set `defaultEnabled: false` in `plugin.json` to ship a plugin that installs disabled. The user turns it on with `claude plugin enable <plugin>` or the `/plugin` interface. Use this for plugins that add cost or scope a user should opt into, such as one that connects to an external service. `defaultEnabled` is the fallback when nothing else has decided the plugin’s state. The user’s setting and a dependency requirement take precedence over it: - - * **The user’s setting** : an entry for the plugin in `enabledPlugins` at any settings scope. Once written, it persists across plugin updates and reinstalls, so changing `defaultEnabled` in a later release does not flip an existing user. - * **A dependency requirement** : when a plugin is required by another one that is active, Claude Code writes `true` for it at install or enable time. That gives it an explicit setting, so its own default no longer applies. See [Enable or disable a plugin with dependencies](</docs/en/plugin-dependencies#enable-or-disable-a-plugin-with-dependencies>). - -The same field can appear in a plugin’s marketplace entry, where it takes precedence over the value in `plugin.json`. See [Optional plugin fields](</docs/en/plugin-marketplaces#optional-plugin-fields>). - -### - -​ - -Component path fields - -Field| Type| Description| Example ----|---|---|--- -`skills`| string|array| Custom skill directories containing `<name>/SKILL.md`. Adds to the default `skills/` scan. See Path behavior rules for the marketplace-root exception| `"./custom/skills/"` -`commands`| string|array| Custom flat `.md` skill files or directories (replaces default `commands/`)| `"./custom/cmd.md"` or `["./cmd1.md"]` -`agents`| string|array| Custom agent files (replaces default `agents/`)| `"./custom/agents/reviewer.md"` -`workflows`| string|array| Custom [workflow](</docs/en/workflows>) script files or directories (replaces default `workflows/`)| `"./custom/workflows/"` -`hooks`| string|array|object| Hook config paths or inline config| `"./my-extra-hooks.json"` -`mcpServers`| string|array|object| MCP config paths or inline config| `"./my-extra-mcp-config.json"` -`outputStyles`| string|array| Custom output style files/directories (replaces default `output-styles/`)| `"./styles/"` -`lspServers`| string|array|object| [Language Server Protocol](<https://microsoft.github.io/language-server-protocol/>) configs for code intelligence (go to definition, find references, etc.)| `"./.lsp.json"` -`experimental.themes`| string|array| Color theme files/directories (replaces default `themes/`). See Themes| `"./themes/"` -`experimental.monitors`| string|array| Background [Monitor](</docs/en/tools-reference#monitor-tool>) configurations that start automatically when the plugin is active. See Monitors| `"./monitors.json"` -`experimental.evals`| string|array| Directory below the plugin root that holds the plugin’s [eval cases](</docs/en/plugin-evals#use-a-different-eval-directory>), when it isn’t the default `evals/`. `claude plugin eval --eval-dir` overrides it| `"quality/evals"` -`userConfig`| object| User-configurable values prompted at enable time. See User configuration| -`channels`| array| Channel declarations for message injection (Telegram, Slack, Discord style). See Channels| -`dependencies`| array| Other plugins this plugin requires, optionally with semver version constraints. See [Constrain plugin dependency versions](</docs/en/plugin-dependencies>)| `[{ "name": "secrets-vault", "version": "~2.1.0" }]` - -### - -​ - -Experimental components - -Components under the `experimental` key, `themes` and `monitors`, have a manifest schema that may change between releases while they stabilize. Where you declare them is a separate migration: the top level still works, `claude plugin validate` warns, and a future release will require `experimental.*`. - -### - -​ - -User configuration - -The `userConfig` field declares values that Claude Code prompts the user for when the plugin is enabled. Use this instead of requiring users to hand-edit `settings.json`. - - { - "userConfig": { - "api_endpoint": { - "type": "string", - "title": "API endpoint", - "description": "Your team's API endpoint" - }, - "api_token": { - "type": "string", - "title": "API token", - "description": "API authentication token", - "sensitive": true - } - } - } - -Keys must be valid identifiers. Each option supports these fields: - -Field| Required| Description ----|---|--- -`type`| Yes| One of `string`, `number`, `boolean`, `directory`, or `file` -`title`| Yes| Label shown in the configuration dialog -`description`| Yes| Help text shown beneath the field -`sensitive`| No| If `true`, masks input and stores the value in secure storage instead of `settings.json` -`required`| No| If `true`, validation fails when the field is empty -`default`| No| Value used when the user provides nothing -`options`| No| For `string` type, the values the field accepts, shown in `/config` as a picker over them. See Limit a field to fixed options. Requires Claude Code v2.1.271 or later -`multiple`| No| For `string` type, allow an array of strings -`min` / `max`| No| Bounds for `number` type - -Except `sensitive` fields and `multiple` lists, each field of each enabled plugin also appears as a row in the `/config` panel. The rows require Claude Code v2.1.269 or later. Each value is available for substitution as `${user_config.KEY}` in MCP and LSP server configs and hook commands. Non-sensitive values can also be substituted in skill and agent content. All values are exported to hook processes as `CLAUDE_PLUGIN_OPTION_<KEY>` environment variables, where `<KEY>` is the option key uppercased. Fields that run in a shell reject `${user_config.*}`: substituting a configured value into a shell command would let the shell run whatever that value contains, so the component fails with an [error](</docs/en/errors#plugin-command-references-user-config>) instead. Each rejected field has an alternative way to pass the value: - -Rejected field| How to pass the value ----|--- -Shell-form hook commands| Use [exec form](</docs/en/hooks#exec-form-and-shell-form>) with `args`, or read `CLAUDE_PLUGIN_OPTION_<KEY>` from the hook’s environment -Monitor commands| Read the value from a config file in the script -MCP [`headersHelper`](</docs/en/mcp#use-dynamic-headers-for-custom-authentication>)| Read the value from a config file in the script - -Before v2.1.207, these fields substituted `${user_config.KEY}` values; update plugins that relied on this. Non-sensitive values are stored under the [`pluginConfigs`](</docs/en/settings-reference#pluginconfigs>) key in your user `settings.json` as `pluginConfigs[<plugin-id>].options`. On macOS, Claude Code stores sensitive values in the macOS Keychain, falling back to `~/.claude/.credentials.json` when the Keychain rejects the write. On platforms without a supported keychain, it stores them in `~/.claude/.credentials.json`. Keychain storage is shared with OAuth tokens and has an approximately 2 KB total limit, so keep sensitive values small. Claude Code reads all `pluginConfigs` values from only three settings sources: - - * **User settings** : `~/.claude/settings.json`, the file the enable-time prompt writes to - * **`--settings`** : the CLI flag or SDK inline settings - * **Managed settings** : [organization-controlled policy](</docs/en/permissions#managed-settings>) - -When more than one source sets the same key, managed settings take precedence, then `--settings`, then user settings. The only source you can remove from this list is user settings: pass [`--setting-sources`](</docs/en/cli-reference#cli-flags>) without `user` and Claude Code skips them. Managed settings and `--settings` stay whatever you pass. The SDK’s [`settingSources`](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) option sets the same list. Entries in a project’s `.claude/settings.json` or `.claude/settings.local.json` are ignored. Both files live in the workspace, so a cloned repository could supply values there, and those values would flow into plugin hook commands, MCP server configs, LSP commands, and monitor commands. Before v2.1.207, these entries were read. The restriction is specific to `pluginConfigs`: [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>) still honors project and local settings. - -#### - -​ - -Limit a field to fixed options - -Set `options` on a `userConfig` field to make users pick its value from a fixed list. To limit a `tone` field to three options, list them in `options` and set `default` to one of them: - - { - "userConfig": { - "tone": { - "type": "string", - "title": "Tone", - "description": "Voice for generated replies", - "options": ["neutral", "warm", "formal"], - "default": "neutral" - } - } - } - -If you declare `options` on any field, users on Claude Code versions before v2.1.271 can’t load the plugin. When you set `options` on a field, follow these rules: - - * Set `type` to `string` - * Don’t set `multiple` or `sensitive` to `true` - * Set `default` to one of the options - * If you leave `default` unset, set `required` to `true` - * List at least one option, each 1 to 64 characters long - * Don’t start or end an option with a space - * Don’t use control characters, invisible characters, characters that change text direction, or spaces other than a regular space in an option - * Don’t list the same option twice, even in a different letter case - -If you break any of these rules, the plugin fails to load. Run `claude plugin validate` to see which field breaks which rule. - -### - -​ - -Channels - -The `channels` field lets a plugin declare one or more message channels that inject content into the conversation. Each channel binds to an MCP server that the plugin provides. - - { - "channels": [ - { - "server": "telegram", - "userConfig": { - "bot_token": { - "type": "string", - "title": "Bot token", - "description": "Telegram bot token", - "sensitive": true - }, - "owner_id": { - "type": "string", - "title": "Owner ID", - "description": "Your Telegram user ID" - } - } - } - ] - } - -The `server` field is required and must match a key in the plugin’s `mcpServers`. The optional per-channel `userConfig` uses the same schema as the top-level field, letting the plugin prompt for bot tokens or owner IDs when the plugin is enabled. - -### - -​ - -Path behavior rules - -Whether a custom path replaces or extends the plugin’s default directory depends on the field: - - * **Replaces the default** : `commands`, `agents`, `workflows`, `outputStyles`, `experimental.themes`, `experimental.monitors`. For example, when the manifest specifies `commands`, the default `commands/` directory is not scanned. To keep the default and add more, list it explicitly: `"commands": ["./commands/", "./extras/"]` - * **Adds to the default** : `skills`. The default `skills/` directory is always scanned, and directories listed in `skills` are loaded alongside it. Exception: for a [marketplace entry whose `source` resolves to the marketplace root](</docs/en/plugin-marketplaces#advanced-plugin-entries>), declaring specific subdirectories replaces the default `skills/` scan - * **Own merge rules** : hooks, MCP servers, and LSP servers. See each section for how multiple sources combine - -When a plugin has both a default folder and the matching manifest key, Claude Code warns about the ignored folder in `claude plugin list` and the `/plugin` detail view. The plugin still loads using the manifest paths. Claude Code doesn’t warn when the manifest key points into the default folder, for example `"commands": ["./commands/deploy.md"]`, because that path names the folder explicitly. For all path fields: - - * All paths must be relative to the plugin root and start with `./`, except that the `skills` field also accepts `"."` - * Both `"."` and `"./"` denote the plugin root itself - * Before v2.1.221, `"."` failed manifest validation and the plugin didn’t load, so use `"./"` to support earlier versions - * Components from custom paths use the same naming and namespacing rules, except agent files. See Agents for how agent names work - * Multiple paths can be specified as arrays - * A skill path can point to a directory that contains a `SKILL.md` directly, for example `"skills": ["."]` for the plugin root - * Claude Code takes the skill’s invocation name from the frontmatter `name` field in `SKILL.md`, so the name stays stable whatever the install directory is named - * If `name` isn’t set in the frontmatter, Claude Code falls back to the directory basename - -A plugin that has a `SKILL.md` at its root, no `skills/` subdirectory, and no `skills` manifest field is automatically loaded as a single-skill plugin. You do not need to set `"skills": ["./"]` in `plugin.json` for this layout. **Path examples** : - - { - "commands": [ - "./specialized/deploy.md", - "./utilities/batch-process.md" - ], - "agents": [ - "./custom-agents/reviewer.md", - "./custom-agents/tester.md" - ] - } - -### - -​ - -Environment variables - -Claude Code provides three variables for referencing paths: - -Variable| Resolves to| Use it for ----|---|--- -`${CLAUDE_PLUGIN_ROOT}`| Absolute path to the plugin’s installation directory| Scripts, binaries, and config files bundled with the plugin -`${CLAUDE_PLUGIN_DATA}`| Persistent directory that survives plugin updates, created on first reference| Installed dependencies such as `node_modules` or Python virtual environments, generated code, and caches -`${CLAUDE_PROJECT_DIR}`| The project root| Project-local scripts and config files - -All three are exported as environment variables to hook processes and to MCP and LSP server subprocesses. They aren’t present in the environment of commands Claude runs through the Bash tool, in the main session or in a subagent. In plugin content, write the placeholder instead, and Claude Code substitutes the path inline when it loads the content. Which fields substitute them inline depends on the plugin component: - -Plugin component| Fields where placeholders resolve ----|--- -Skill and agent content| Anywhere the placeholder appears -Hook and monitor commands| Anywhere the placeholder appears -MCP `stdio` servers| `command`, `args`, `env` -MCP `http`, `sse`, `ws` servers| `url`, `headers`, `headersHelper` -LSP servers| `command`, `args`, `env`, `workspaceFolder` - -In hook commands, use [exec form](</docs/en/hooks#exec-form-and-shell-form>) with `args` so each path is passed as one argument with no quoting. In shell-form hooks and monitor commands, wrap the variables in double quotes, as in `"${CLAUDE_PROJECT_DIR}/scripts/server.sh"`. This shell-form hook runs a script bundled with a plugin: - - { - "hooks": { - "PostToolUse": [ - { - "hooks": [ - { - "type": "command", - "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/process.sh" - } - ] - } - ] - } - } - -For a copied plugin, `${CLAUDE_PLUGIN_ROOT}` changes when the plugin updates. The previous version’s directory remains on disk for a grace period after an update, but treat it as ephemeral and don’t write state there. For a plugin loaded in place from a local-directory marketplace, the variable points at the stable source directory. See plugin caching for which plugins are copied and for cleanup semantics. When a copied plugin updates mid-session, hook commands, monitors, MCP servers, and LSP servers keep using the previous version’s path. Run `/reload-plugins` to switch hooks, MCP servers, and LSP servers to the new path; monitors require a session restart. In a session without an interactive terminal, the reload leaves plugin MCP servers on the old path until the next session. For a plugin with a `command` source, Claude Code [can reload the plugin itself](</docs/en/plugin-marketplaces#when-claude-code-re-runs-the-command>). MCP servers can also call the `roots/list` request to read the session’s working directories at runtime. See [what `roots/list` returns and when Claude Code notifies the server of changes](</docs/en/mcp#option-3-add-a-local-stdio-server>). - -#### - -​ - -Persistent data directory - -The `${CLAUDE_PLUGIN_DATA}` directory resolves to `~/.claude/plugins/data/{id}/`, where `{id}` is the plugin identifier with characters outside `a-z`, `A-Z`, `0-9`, `_`, and `-` replaced by `-`. For a plugin installed as `formatter@my-marketplace`, the directory is `~/.claude/plugins/data/formatter-my-marketplace/`. A common use is installing language dependencies once and reusing them across sessions and plugin updates. Use it for Python dependencies, dependencies locked with Yarn or pnpm, and packages whose lifecycle scripts must run. For a marketplace-installed plugin, you may not need it at all: Claude Code installs eligible Node.js package dependencies automatically when it caches the plugin. Because the data directory outlives any single plugin version, a check for directory existence alone cannot detect when an update changes the plugin’s dependency manifest. The recommended pattern compares the bundled manifest against a copy in the data directory and reinstalls when they differ. This `SessionStart` hook installs `node_modules` on the first run and again whenever a plugin update includes a changed `package.json`: - - { - "hooks": { - "SessionStart": [ - { - "hooks": [ - { - "type": "command", - "command": "diff -q \"${CLAUDE_PLUGIN_ROOT}/package.json\" \"${CLAUDE_PLUGIN_DATA}/package.json\" >/dev/null 2>&1 || (cd \"${CLAUDE_PLUGIN_DATA}\" && cp \"${CLAUDE_PLUGIN_ROOT}/package.json\" . && npm install) || rm -f \"${CLAUDE_PLUGIN_DATA}/package.json\"" - } - ] - } - ] - } - } - -The `diff` exits nonzero when the stored copy is missing or differs from the bundled one, covering both first run and dependency-changing updates. If `npm install` fails, the trailing `rm` removes the copied manifest so the next session retries. Scripts bundled in `${CLAUDE_PLUGIN_ROOT}` can then run against the persisted `node_modules`: - - { - "mcpServers": { - "routines": { - "command": "node", - "args": ["${CLAUDE_PLUGIN_ROOT}/server.js"], - "env": { - "NODE_PATH": "${CLAUDE_PLUGIN_DATA}/node_modules" - } - } - } - } - -The data directory is deleted automatically when you uninstall the plugin from the last scope where it is installed. The `/plugin` interface shows the directory size and prompts before deleting. The CLI deletes by default; pass `--keep-data` to preserve it. - -* * * - -## - -​ - -Plugin caching and file resolution - -Plugins are specified in one of three ways: - - * Through `claude --plugin-dir` or `claude --plugin-url`, for the duration of a session. - * Through a marketplace, installed for future sessions. - * Through your claude.ai account, synced into `~/.claude/plugins/synced/`. - -For security and verification purposes, Claude Code copies _marketplace_ plugins to the user’s local **plugin cache** (`~/.claude/plugins/cache`), unless the plugin loads in place. A [`command` source in link mode](</docs/en/plugin-marketplaces#copy-mode-and-link-mode>) loads in place through links in the cache entry. A [relative path source](</docs/en/plugin-marketplaces#relative-paths>) in a marketplace added from a local directory loads in place from the marketplace folder. For a plugin loaded in place from a local-directory marketplace, your edits to the source directory take effect at the next session start or `/reload-plugins`. You don’t need a version bump. The plugin’s hook processes and MCP and LSP servers receive a `CLAUDE_PLUGIN_ROOT` that points at the source directory. Claude Code doesn’t install the plugin’s Node.js package dependencies into the source directory. Install them there yourself, or from a hook into the persistent data directory. For copied plugins, each installed version is a separate directory in the cache, grouped by marketplace and plugin and named for the resolved version, with its own copy of the plugin’s files and Node.js package dependencies. A dependency resolved from a [release tag](</docs/en/plugin-dependencies#tag-plugin-releases-for-version-resolution>) gets a directory name with a commit-SHA suffix. When you update or uninstall a plugin, Claude Code marks the previous version directory as orphaned and removes it in a background sweep roughly 14 days later. The grace period lets concurrent Claude Code sessions that already loaded the old version keep running without errors. Claude Code runs the sweep only while at least one plugin is installed; after you uninstall your last plugin, orphaned directories stay on disk until you install a plugin again. Claude Code removes a plugin or marketplace folder from the cache only when it no longer contains any directory or symlink. If you symlink a development checkout into the cache as a plugin’s version entry, Claude Code never marks the link as orphaned and never removes it or the folders that hold it. Claude Code also never writes its version-tracking files inside the linked checkout. Claude’s Glob and Grep tools skip orphaned version directories during searches, so file results don’t include outdated plugin code. - -### - -​ - -Node.js package dependencies - -When Claude Code copies a plugin into the cache, it also installs the plugin’s Node.js package dependencies there, so the plugin’s hooks and MCP servers can load them. This section covers the npm and Bun packages a plugin declares in its own `package.json`. For plugins that depend on other plugins, see [plugin dependency versions](</docs/en/plugin-dependencies>). Claude Code runs the install inside the copied version directory each time it creates one: when you install a plugin, when Claude Code updates a plugin to a new version, and at session start when an enabled plugin isn’t cached yet, such as on a new machine. The install runs only when the plugin’s root directory contains both a `package.json` and a supported lockfile: - -Lockfile| Command ----|--- -`bun.lock` or `bun.lockb`| `bun install --frozen-lockfile --ignore-scripts` -`npm-shrinkwrap.json` or `package-lock.json`| `npm ci --ignore-scripts` - -If a plugin contains more than one of these lockfiles, Claude Code uses the first match, checking in order: `bun.lock`, `bun.lockb`, `npm-shrinkwrap.json`, `package-lock.json`. Claude Code skips the install in two cases, each with its own fix: - - * If your plugin ships only a `yarn.lock` or `pnpm-lock.yaml`, replace it with an npm lockfile. - * If a `bunfig.toml` sits beside the bun lockfile, remove the `bunfig.toml`, or replace the bun lockfile with an npm lockfile. - -Ship an npm lockfile for the widest reach. Claude Code runs the matched lockfile’s package manager from the user’s PATH and doesn’t fall back to the other lockfile if it’s missing. For a plugin distributed through an npm source, use `npm-shrinkwrap.json`; npm excludes `package-lock.json` from published packages. Claude Code constrains this dependency install so that no code from the plugin or its packages executes during it, and bounds how long it can run: - - * **Frozen resolution:** Bun and npm install exactly what the lockfile pins, and fail rather than re-resolve versions when `package.json` and the lockfile disagree. - * **No lifecycle scripts:** `--ignore-scripts` keeps `preinstall`, `install`, and `postinstall` scripts from running, so dependencies that build native modules in those scripts download but don’t compile during this install. - * **60-second timeout:** Claude Code stops an install that runs longer and treats it as failed. - -Claude Code fetches an npm-source plugin before this dependency install, and none of the package’s own install scripts run during the fetch. See [npm packages](</docs/en/plugin-marketplaces#npm-packages>). A failed or skipped install never blocks the plugin. When the install fails, or Claude Code skips it because of a yarn or pnpm lockfile or a `bunfig.toml`, it records the reason as a warning in debug output. A plugin with a `package.json` and no lockfile is skipped without a log entry. A timed-out install can leave a partial `node_modules` tree in the cached copy. You can’t turn the automatic install off; no setting or environment variable disables it. In restricted networks, see the [network access requirements](</docs/en/network-config#network-access-requirements>) for the hosts to allow. For dependencies the automatic install can’t provide, such as packages that need their lifecycle scripts to build, Python dependencies, or a plugin locked with Yarn or pnpm, install them from a hook into the persistent data directory. - -### - -​ - -Path traversal limitations - -Claude Code doesn’t let a plugin reference files outside its own directory. It rejects a component path that resolves outside the plugin root, whether the path is declared in `plugin.json` or in a [marketplace entry](</docs/en/plugin-marketplaces#plugin-entries>). That covers a path that points outside the plugin as written, such as `../shared-utils`, and a symlink that leads outside the plugin, other than links within one marketplace. On macOS and Linux, Claude Code also rejects a component path that contains a backslash anywhere in it, even when the path stays inside the plugin. Components declared with backslash paths therefore load on Windows only. Write component paths with forward slashes, such as `./commands/deploy.md`. When Claude Code rejects a path, it reports a [`path escapes plugin directory`](</docs/en/errors#path-escapes-plugin-directory>) error and loads the plugin without that component. Claude Code also doesn’t copy files outside the plugin directory into the cache when it installs the plugin, so when a script inside a copied plugin reads a path above the plugin root, it doesn’t find those files either. - -### - -​ - -Share files within a marketplace with symlinks - -If your plugin needs to share files with other parts of the same marketplace, you can create symbolic links inside your plugin directory. How a symlink is handled when the plugin is copied into the cache depends on where its target resolves: - - * **Within the plugin’s own directory:** the symlink is preserved as a relative symlink in the cache, so it keeps resolving to the copied target at runtime. - * **Elsewhere within the same marketplace:** the symlink is dereferenced. The target’s content is copied into the cache in its place. This lets a meta-plugin’s `skills/` directory link to skills defined by other plugins in the marketplace. - * **Outside the marketplace:** the symlink is skipped for security. This prevents plugins from pulling arbitrary host files such as system paths into the cache. - -For plugins installed with `--plugin-dir`, from a local path, or from a [`command` source](</docs/en/plugin-marketplaces#copy-mode-and-link-mode>) in copy mode, only symlinks that resolve within the plugin’s own directory are preserved. All others are skipped. The following command creates a link from inside a marketplace plugin to a shared skill defined by a sibling plugin. On Windows, use `mklink /D` from an elevated Command Prompt or enable Developer Mode: - - ln -s ../../shared-plugin/skills/foo ./skills/foo - -* * * - -## - -​ - -Plugin directory structure - -### - -​ - -Standard plugin layout - -A complete plugin follows this structure: - - enterprise-plugin/ - ├── .claude-plugin/ # Metadata directory (optional) - │ └── plugin.json # plugin manifest - ├── skills/ # Skills - │ ├── code-reviewer/ - │ │ └── SKILL.md - │ └── pdf-processor/ - │ ├── SKILL.md - │ └── scripts/ - ├── commands/ # Skills as flat .md files - │ ├── status.md - │ └── logs.md - ├── agents/ # Subagent definitions - │ ├── security-reviewer.md - │ ├── performance-tester.md - │ ├── compliance-checker.md - │ └── review/ # Agents here load as enterprise-plugin:review:<name> - │ └── accessibility.md - ├── workflows/ # Workflow scripts - │ └── release-audit.js - ├── output-styles/ # Output style definitions - │ └── terse.md - ├── themes/ # Color theme definitions - │ └── dracula.json - ├── monitors/ # Background monitor configurations - │ └── monitors.json - ├── hooks/ # Hook configurations - │ ├── hooks.json # Main hook config - │ └── security-hooks.json # Additional hooks - ├── bin/ # Plugin executables added to PATH - │ └── my-tool # Invokable as bare command in Bash tool - ├── settings.json # Default settings for the plugin - ├── .mcp.json # MCP server definitions - ├── .lsp.json # LSP server configurations - ├── scripts/ # Hook and utility scripts - │ ├── security-scan.sh - │ ├── format-code.py - │ └── deploy.js - ├── LICENSE # License file - └── CHANGELOG.md # Version history - -The `.claude-plugin/` directory contains the `plugin.json` file. All other directories (commands/, agents/, skills/, workflows/, output-styles/, themes/, monitors/, hooks/) must be at the plugin root, not inside `.claude-plugin/`. - -A `CLAUDE.md` file at the plugin root is not loaded as project context. Plugins contribute context through skills, agents, and hooks rather than CLAUDE.md. To ship instructions that load into Claude’s context, put them in a skill. - -### - -​ - -File locations reference - -Component| Default Location| Purpose ----|---|--- -**Manifest**| `.claude-plugin/plugin.json`| Plugin metadata and configuration (optional) -**Skills**| `skills/`| Skills with `<name>/SKILL.md` structure -**Commands**| `commands/`| Skills as flat Markdown files. Use `skills/` for new plugins -**Agents**| `agents/`| Subagent Markdown files. Subfolders are part of the agent name -**Workflows**| `workflows/`| [Workflow](</docs/en/workflows>) script files -**Output styles**| `output-styles/`| Output style definitions -**Themes**| `themes/`| Color theme definitions -**Hooks**| `hooks/hooks.json`| Hook configuration -**MCP servers**| `.mcp.json`| MCP server definitions -**LSP servers**| `.lsp.json`| Language server configurations -**Monitors**| `monitors/monitors.json`| Background monitor configurations -**Executables**| `bin/`| Executables added to the Bash tool’s `PATH` and invokable as bare commands while the plugin is enabled. You can’t include this directory in a plugin you [distribute through claude.ai organization settings](</docs/en/plugin-marketplaces#keep-executables-out-of-the-top-level-bin-directory>) -**Settings**| `settings.json`| Default configuration applied when the plugin is enabled. Only the [`agent`](</docs/en/sub-agents>) and [`subagentStatusLine`](</docs/en/statusline#subagent-status-lines>) keys are supported - -* * * - -## - -​ - -CLI commands reference - -Claude Code provides CLI commands for non-interactive plugin management, useful for scripting and automation. - -### - -​ - -plugin init - -Scaffold a new plugin at `~/.claude/skills/<name>/`. On the next Claude Code session it loads automatically as `<name>@skills-dir` and appears in `/plugin` and `claude plugin list` with no install step. See Skills-directory plugins for scope and trust requirements. - - claude plugin init <name> [options] - -The command takes these arguments: - - * `<name>`: Plugin name. Becomes the skill namespace and the directory name under `~/.claude/skills/`, so it cannot contain spaces or path separators. - -The command accepts these options: - -Option| Description| Default ----|---|--- -`--description <text>`| Manifest description| -`--author <name>`| Author name| `git config user.name` -`--author-email <email>`| Author email| `git config user.email` -`--with <components...>`| Also scaffold component folders. Valid values: `skills`, `agents`, `hooks`, `mcp`, `lsp`, `output-style`, `channel`| -`-f, --force`| Overwrite an existing `.claude-plugin/` at the target| -`-h, --help`| Display help for command| - -`claude plugin new` is an alias for this command. Each `--with` value adds a starter file for that component, ready to edit: - -Component| What it scaffolds ----|--- -`skills`| An extra namespaced `<name>:example` skill alongside the default one -`agents`| An `agents/` subagent definition -`hooks`| A `hooks/hooks.json` with a sample event handler -`mcp`| A `.mcp.json` with HTTP and stdio server examples -`lsp`| A `.lsp.json` language-server example -`output-style`| An `output-styles/<name>.md` that applies automatically while the plugin is enabled -`channel`| An MCP-based [channel](</docs/en/channels>): a stdio server (`server.ts`), its `.mcp.json`, and a `package.json` - -The scaffolded plugin uses the `@skills-dir` source rather than a marketplace. Admins can block this source with `strictKnownMarketplaces` or by adding `{"source": "skills-dir"}` to `blockedMarketplaces` in [managed settings](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>). When blocked, `plugin init` fails before writing. These examples show common invocations: - - # Scaffold a minimal plugin - claude plugin init my-helper - - # Scaffold with skill and hook folders - claude plugin init my-helper --with skills hooks - - # Overwrite an existing scaffold - claude plugin init my-helper --force - -### - -​ - -plugin install - -Install a plugin from available marketplaces. - - claude plugin install <plugin> [options] - -The command takes these arguments: - - * `<plugin>`: Plugin name or `plugin-name@marketplace-name` for a specific marketplace - -The command accepts these options: - -Option| Description| Default ----|---|--- -`-s, --scope <scope>`| Installation scope: `user`, `project`, or `local`| `user` -`--config <key=value>`| Set a `userConfig` option declared in the plugin’s manifest. Repeat the flag to set multiple options| -`-y, --yes`| Accept a command the plugin’s marketplace declares, without the confirmation prompt: the command that produces a plugin with a [`command` source](</docs/en/plugin-marketplaces#command-sources>), or the [`headersHelper`](</docs/en/plugin-marketplaces#authenticate-archive-downloads>) that authenticates an archive download. Accepting a `headersHelper` requires Claude Code v2.1.238 or later. Claude Code still prints the command first. Required when stdin or stdout isn’t a TTY, unless you pass `--accept-command`. Has no effect inside a Claude Code session, so run the command from your own terminal| -`--accept-command <sha256>`| Accept the marketplace-declared command whose `sha256` a previous `--json` run reported in `shownCommand`, in place of `-y`. The acceptance counts for exactly that command, plugin, and marketplace catalog. If any of them changed since the command was displayed, including through the run’s own marketplace refresh, Claude Code doesn’t accept the digest and shows the command again. Can’t be combined with `-y`. Has no effect inside a Claude Code session, so run the command from your own terminal. Requires Claude Code v2.1.271 or later| -`--json`| Print the result as one JSON object on the last line of stdout instead of the human-readable message, for use in scripts. See JSON result format. Requires Claude Code v2.1.268 or later| -`-h, --help`| Display help for command| - -Scope determines which settings file the installed plugin is added to. For example, `--scope project` writes to `enabledPlugins` in .claude/settings.json, making the plugin available to everyone who clones the project repository. With `--json`, the last line of stdout is one JSON object. Parse only that line, because Claude Code prints any command the marketplace declares ahead of it. Three fields are always present: - - * `command`: the subcommand that ran, such as `install` - * `outcome`: `ok` or `failed` - * `message`: a human-readable description of the result - -Other fields, such as `pluginId`, `scope`, and `failureCode`, appear only when they apply. The `--json` option on `plugin uninstall`, `plugin update`, `plugin enable`, and `plugin disable` prints the same object with that subcommand’s own fields. A usage error, such as an invalid `--scope`, prints no result line and exits 1 with the reason on stderr. When a run displays a marketplace-declared command and doesn’t run it, the `failed` result also carries a `shownCommand` object whose fields include the command as displayed, the plugin it belongs to, and the command’s `sha256`. To accept exactly that command, re-run with that `sha256` as `--accept-command`. Requires Claude Code v2.1.271 or later. If `shownCommand.acceptCommandMatched` is `false`, the digest you passed doesn’t match the command now displayed. Show that command to a person before passing its `sha256`. These examples show common invocations: - - # Install to user scope (default) - claude plugin install formatter@my-marketplace - - # Install to project scope (shared with team) - claude plugin install formatter@my-marketplace --scope project - - # Install to local scope (not shared with team) - claude plugin install formatter@my-marketplace --scope local - -### - -​ - -plugin uninstall - -Remove an installed plugin. - - claude plugin uninstall <plugin> [options] - -The command takes these arguments: - - * `<plugin>`: Plugin name or `plugin-name@marketplace-name` - -The command accepts these options: - -Option| Description| Default ----|---|--- -`-s, --scope <scope>`| Uninstall from scope: `user`, `project`, or `local`| `user` -`--keep-data`| Preserve the plugin’s persistent data directory| -`--prune`| Also remove auto-installed dependencies that no other plugin requires. See plugin prune| -`-y, --yes`| Skip the `--prune` confirmation prompt. Required when stdin or stdout is not a TTY| -`--json`| Print the result as one JSON object on the last line of stdout, in the same format as `plugin install --json`. Can’t be combined with `--prune`. Requires Claude Code v2.1.268 or later| -`-h, --help`| Display help for command| - -`claude plugin remove` and `claude plugin rm` are aliases for this command. By default, uninstalling from the last remaining scope also deletes the plugin’s `${CLAUDE_PLUGIN_DATA}` directory. Use `--keep-data` to preserve it, for example when reinstalling after testing a new version. - -When installed plugins from different marketplaces share a name, the `plugin-name@marketplace-name` form uninstalls only the plugin from the named marketplace. Before v2.1.212, the qualified form could match and uninstall the same-named plugin from a different marketplace. - -### - -​ - -plugin prune - -Remove auto-installed plugin dependencies that are no longer required by any installed plugin. Dependencies that Claude Code pulled in to satisfy another plugin’s [`dependencies`](</docs/en/plugin-dependencies>) field are removed; plugins you installed directly are never touched. - - claude plugin prune [options] - -The command accepts these options: - -Option| Description| Default ----|---|--- -`-s, --scope <scope>`| Prune at scope: `user`, `project`, or `local`| `user` -`--dry-run`| List what would be removed without removing anything| -`-y, --yes`| Skip the confirmation prompt. Required when stdin or stdout is not a TTY| -`-h, --help`| Display help for command| - -`claude plugin autoremove` is an alias for this command. The command lists orphaned dependencies and asks for confirmation before removing them. To remove a plugin and clean up its dependencies in one step, run `claude plugin uninstall <plugin> --prune`. - -### - -​ - -plugin enable - -Enable a disabled plugin. When the target is installed from a marketplace and declares [dependencies](</docs/en/plugin-dependencies>), Claude Code enables them transitively at the same scope. The command fails under the conditions that [Enable or disable a plugin with dependencies](</docs/en/plugin-dependencies#enable-or-disable-a-plugin-with-dependencies>) lists. - - claude plugin enable <plugin> [options] - -The command takes these arguments: - - * `<plugin>`: Plugin name, `plugin-name@marketplace-name`, or `plugin-name@synced` for a plugin synced from claude.ai - -The command accepts these options: - -Option| Description| Default ----|---|--- -`-s, --scope <scope>`| Scope to enable: `user`, `project`, or `local`. When omitted, Claude Code detects the scope where the plugin is installed| Auto-detect -`--json`| Print the result as one JSON object on the last line of stdout, in the same format as `plugin install --json`. Requires Claude Code v2.1.268 or later| -`-h, --help`| Display help for command| - -### - -​ - -plugin disable - -Disable a plugin without uninstalling it. When the target is installed from a marketplace, the command fails if another enabled plugin [depends on](</docs/en/plugin-dependencies#enable-or-disable-a-plugin-with-dependencies>) it. The error message includes a chained command that disables every dependent first. For a synced plugin that your organization requires, the command fails and saves nothing. - - claude plugin disable [plugin] [options] - -The command takes these arguments: - - * `[plugin]`: Plugin name, `plugin-name@marketplace-name`, or `plugin-name@synced` for a plugin synced from claude.ai. Optional when using `--all` - -The command accepts these options: - -Option| Description| Default ----|---|--- -`-a, --all`| Disable all enabled plugins. Can’t be combined with `--scope`| -`-s, --scope <scope>`| Scope to disable: `user`, `project`, or `local`. When omitted, Claude Code detects the scope where the plugin is installed| Auto-detect -`--json`| Print the result as one JSON object on the last line of stdout, in the same format as `plugin install --json`. Requires Claude Code v2.1.268 or later| -`-h, --help`| Display help for command| - -### - -​ - -plugin update - -Update a plugin to the latest version. - - claude plugin update <plugin> [options] - -The command takes these arguments: - - * `<plugin>`: Plugin name or `plugin-name@marketplace-name` - -The command accepts these options: - -Option| Description| Default ----|---|--- -`-s, --scope <scope>`| Scope to update: `user`, `project`, `local`, or `managed`| `user` -`-y, --yes`| Accept a command the plugin’s marketplace declares, without the confirmation prompt: the command that produces a plugin with a [`command` source](</docs/en/plugin-marketplaces#command-sources>), or the [`headersHelper`](</docs/en/plugin-marketplaces#authenticate-archive-downloads>) that authenticates an archive download. Accepting a `headersHelper` requires Claude Code v2.1.238 or later. Claude Code still prints the command first. Required when stdin or stdout isn’t a TTY, unless you pass `--accept-command`. Has no effect inside a Claude Code session, so run the command from your own terminal| -`--accept-command <sha256>`| Accept the marketplace-declared command whose `sha256` a previous `--json` run reported in `shownCommand`, in place of `-y`. The acceptance counts for exactly that command, plugin, and marketplace catalog. If any of them changed since the command was displayed, including through the run’s own marketplace refresh, Claude Code doesn’t accept the digest and shows the command again. Can’t be combined with `-y`. Has no effect inside a Claude Code session, so run the command from your own terminal. Requires Claude Code v2.1.271 or later| -`--json`| Print the result as one JSON object on the last line of stdout, in the same format as `plugin install --json`. Requires Claude Code v2.1.268 or later| -`-h, --help`| Display help for command| - -Claude Code resolves a bare plugin name against your installed plugins. When installed plugins from different marketplaces share the name, Claude Code refuses the update and lists the qualified `plugin-name@marketplace-name` commands to run instead. Before v2.1.246, Claude Code accepted only the qualified form and rejected a bare name as not found. - -* * * - -### - -​ - -plugin list - -List installed plugins with their version, source marketplace, and enable status. - - claude plugin list [options] - -The command accepts these options: - -Option| Description| Default ----|---|--- -`--json`| Output as JSON. A plugin row with load problems or authoring warnings carries `errors` or `notes` string arrays. On Claude Code v2.1.268 or later, parallel `errorDetails` and `noteDetails` arrays give each entry’s diagnostic `type` and the names it refers to, such as the plugin, marketplace, server, or file| -`--available`| Include available plugins from marketplaces. Requires `--json`| -`-h, --help`| Display help for command| - -Within an interactive session, `/plugin list` prints a similar listing inline, but it covers marketplace-installed plugins only: - - * Plugins loaded from skills directories appear in the `/plugin` interface and in `claude plugin list`, but not in the inline `/plugin list` output. - * Plugins synced from claude.ai appear in `claude plugin list` on Claude Code v2.1.239 or later and in the `/plugin` interface, but not in the inline `/plugin list` output. - * Plugins loaded for the session with `--plugin-dir` or `--plugin-url` appear in the `/plugin` interface, and in `claude plugin list` only when the same flag precedes the subcommand, as in `claude --plugin-dir <dir> plugin list`. Only the flag names their location, so a bare `claude plugin list` can’t find them, unlike synced plugins and skills-directory plugins, whose fixed directories Claude Code scans. - -The interactive form accepts `--enabled` or `--disabled` to show only plugins in that state, and `ls` as a shorthand for `list`. - -### - -​ - -plugin details - -Show a plugin’s component inventory and projected token cost. The output lists all components the plugin contributes, grouped as Skills, Agents, Hooks, MCP servers, and LSP servers, along with an estimate of how many tokens it adds to each session. The Skills group includes both `skills/` and `commands/` entries. - - claude plugin details <name> - -The command takes these arguments: - - * `<name>`: Plugin name or `plugin-name@marketplace-name` - -The command accepts these options: - -Option| Description| Default ----|---|--- -`-h, --help`| Display help for command| - -The output shows two cost figures for each component: - - * **Always-on:** tokens added to every session by the plugin’s listing text, such as skill descriptions, agent descriptions, and command names, regardless of whether any component fires. - * **On-invoke:** tokens a component costs when it fires. Shown per component, not as a plugin total, because a typical session invokes only a subset of components. - -This example shows what the output looks like for a plugin with two skills: - - dependency-guard 1.2.0 - Dependency analysis for Claude Code sessions - Source: dependency-guard@example-marketplace - - Component inventory - Skills (2) scan-dependencies, review-changes - Agents (0) - Hooks (1) SessionStart (harness-only — no model context cost) - MCP servers (0) - LSP servers (0) - - Projected token cost - Always-on: ~180 tok added to every session - - Per-component (rounded) - component always-on on-invoke - scan-dependencies ~100 ~2400 - review-changes ~80 ~1800 - - On-invoke cost is paid each time a skill or agent fires. - Token counts are estimates and may differ from actual usage. - -The always-on total is computed via the `count_tokens` API for your active model. Per-component numbers are proportionally scaled from that total. If the API is unreachable, the command falls back to a character-based estimate. - -### - -​ - -plugin validate - -Check a plugin or a marketplace for syntax and schema errors before publishing. The command exits 0 when validation passes, 1 when it fails, and 2 when the validation run itself fails, such as when the path you pass is unreadable. - - claude plugin validate <path> [options] - -The command takes these arguments: - - * `<path>`: Path to a plugin directory or a marketplace directory. See [Validate a plugin or a directory without a manifest](</docs/en/plugin-marketplaces#validate-a-plugin-or-a-directory-without-a-manifest>) for which files a plugin run covers. - -The command accepts these options: - -Option| Description| Default ----|---|--- -`--strict`| Treat warnings as errors and exit 1 on them. Use in CI to catch issues the runtime tolerates, such as unrecognized fields| -`--json`| Output the validation report as one JSON object with the same exit codes. Requires Claude Code v2.1.259 or later| -`-h, --help`| Display help for command| - -With `--json`, Claude Code writes the report to stdout as one JSON object with these top-level fields: - - * `success`: the same verdict the exit code gives - * `strict`: whether the run treated warnings as errors - * `target`: the resolved path Claude Code validated - * `manifest`: the manifest’s own result, or `null` for a [run without a manifest](</docs/en/plugin-marketplaces#validate-a-plugin-or-a-directory-without-a-manifest>) - * `contents`: per-file results, each naming its `file` and carrying `errors`, `warnings`, and `notes` arrays - -On exit 2, the command writes nothing to stdout; the error message goes to stderr. Within an interactive session, `/plugin validate <path>` runs the same checks inline. - -### - -​ - -plugin eval - -Run a plugin’s [eval cases](</docs/en/plugin-evals>) and report scored results. Requires Claude Code v2.1.269 or later. Each case is a prompt plus graders; Claude Code runs it several times in an isolated session with only the target plugin loaded, and by default also without the plugin so the report shows the difference. See [Test plugins with evals](</docs/en/plugin-evals>) for the case format, graders, results, and CI usage. - - claude plugin eval [target] [options] - -The optional `target` is a plugin directory, a single `prompt.md` or `case.yaml` file, an installed plugin as `name` or `name@marketplace`, or `name@skills-dir`, and defaults to the current directory. Put it before `--tag`, `--allow-tools`, and `--json`. This table lists the options most runs use. Run `claude plugin eval --help` for the complete set, including `--case`, `--tag`, `--output-dir`, `--report`, `--allow-real-servers`, `--keep-temp`, and `--verbose`. - -Option| Description| Default ----|---|--- -`--runs <n>`| Runs per case per arm| Each case’s `runs`, else 3 -`-j, --concurrency <n>`| Agent sessions to run at once, 1 to 8. They share your rate limit| `1` -`--model <model>`| Model for the agent under test| Each case’s `model`, else `ANTHROPIC_MODEL` if set, else Claude Code’s default -`--judge-model <model>`| Model for `llm` and `baseline` graders| A small fast model -`--ablation <mode>`| `none` or `with-without`. See [Compare against a no-plugin baseline](</docs/en/plugin-evals#compare-against-a-no-plugin-baseline>)| `with-without` when a plugin resolves, else `none` -`--threshold <0..1>`| Exit 1 if any case scores below this| `1.0` -`--max-cost-usd <usd>`| Stop before the next run once spend reaches this, exit 2, and report partial results| No ceiling -`--allow-tools <tools...>`| Grant tools beyond the read-only set, such as `Bash`, `Write`, `Edit`, or `"mcp__plugin_<plugin>_<server>__*"`. See [Grant tools](</docs/en/plugin-evals#grant-tools>)| -`--scaffold`| Run each case’s [`scaffold_script`](</docs/en/plugin-evals#add-setup-or-history-with-case-yaml>)| Off -`--trust-plugin`| Skip the first-run trust prompt, for CI. See [What a run can access](</docs/en/plugin-evals#security>)| Off -`--mocks <mode>`| `record` or `off`. See [Mock MCP servers](</docs/en/plugin-evals#mock-mcp-servers>)| `record` -`--eval-dir <dir>`| Directory below the plugin that holds the cases| The manifest’s `experimental.evals`, else `evals` -`--json [path]`| Print the [result document](</docs/en/plugin-evals#json-result>) to stdout, or write it to a `.json` path| -`--no-publish`| Keep the HTML report local| -`-h, --help`| Display help for command| - -The command exits 0 when every case meets the threshold, 1 on a failing case, a load error, or an untrusted plugin directory, 2 on a partial run, 130 when interrupted, and 143 when terminated. See [Run evals in CI](</docs/en/plugin-evals#run-evals-in-ci>). - -### - -​ - -plugin eval init - -Create an eval suite for the plugin in the current directory. Requires Claude Code v2.1.269 or later. In a terminal this starts an authoring interview that reads the plugin, proposes cases and graders, pilots them, and writes the files. With `--bare`, or without a terminal, it writes a blank single-case template instead. Run from inside an interactive Claude Code session, it prints the interview instructions for that session to follow rather than writing a template. See [Create your first eval suite](</docs/en/plugin-evals#create-your-first-eval-suite>). - - claude plugin eval init [name] [options] - -The optional `name` is a case name: the interview doesn’t need one, while `--bare` and the no-terminal template path require it. It accepts these options: - -Option| Description| Default ----|---|--- -`--bare`| Write a blank `prompt.md` and `graders/criteria.md` for `<name>` instead of running the interview| -`-i, --interactive`| Require the interview. Fails without a terminal instead of writing a template| -`--eval-dir <dir>`| Directory below the current directory to write cases into| The manifest’s `experimental.evals`, else `evals` -`-h, --help`| Display help for command| - -### - -​ - -plugin tag - -Create a release git tag for a plugin. By default the command tags the plugin in the current directory; pass a path to tag a plugin elsewhere. See [Tag plugin releases](</docs/en/plugin-dependencies#tag-plugin-releases-for-version-resolution>). - - claude plugin tag [path] [options] - -The command takes these arguments: - - * `[path]`: Path to the plugin directory. Defaults to the current directory. - -The command accepts these options: - -Option| Description| Default ----|---|--- -`--push`| Push the tag to the remote after creating it| -`--dry-run`| Print what would be tagged without creating the tag| -`-f, --force`| Create the tag even if the working tree is dirty or the tag already exists| -`-m, --message <msg>`| Tag annotation message. Use `%s` as a placeholder for the version| -`--remote <name>`| Remote to push to with `--push`| `origin` -`-h, --help`| Display help for command| - -* * * - -## - -​ - -Debugging and development tools - -### - -​ - -Debugging commands - -Use `claude --debug` to see plugin loading details: This shows: - - * Which plugins are being loaded - * Any errors in plugin manifests - * Skill, agent, and hook registration - * MCP server initialization - -### - -​ - -Common issues - -Issue| Cause| Solution ----|---|--- -Plugin not loading| Invalid `plugin.json`| Run `claude plugin validate ./my-plugin` or `/plugin validate ./my-plugin`, where `./my-plugin` is your plugin directory, to check `plugin.json`, `hooks/hooks.json`, and the frontmatter of the skills, agents, and commands in the plugin’s default directories for syntax and schema errors. See [Validate a plugin or a directory without a manifest](</docs/en/plugin-marketplaces#validate-a-plugin-or-a-directory-without-a-manifest>) for what a run covers -Skills not appearing| Wrong directory structure| Ensure `skills/` or `commands/` is at the plugin root, not inside `.claude-plugin/` -Hooks not firing| Script not executable| Run `chmod +x script.sh` -MCP server fails| Missing `${CLAUDE_PLUGIN_ROOT}`| Use variable for all plugin paths -Path errors| Absolute paths used| Make paths relative, starting with `./`; see Path behavior rules, which cover the `skills` field’s `"."` exception -LSP `Executable not found in $PATH`| Language server not installed| Install the binary (for example, `npm install -g typescript-language-server typescript`) - -### - -​ - -Example error messages - -**Manifest validation errors** : - - * `Invalid JSON syntax: Unexpected token } in JSON at position 142`: check for missing commas, extra commas, or unquoted strings - * `Plugin <name> has an invalid manifest file at .claude-plugin/plugin.json. Validation errors: name: Invalid input: expected string, received undefined`: a required field is missing - * `Plugin <name> has a corrupt manifest file at .claude-plugin/plugin.json. JSON parse error: ...`: JSON syntax error. Before v2.1.246, Claude Code also produced this error for a `plugin.json` saved as UTF-8 with a leading byte-order mark (BOM), even when the JSON was otherwise valid. - -**Plugin loading errors** : - - * `Warning: No commands found in plugin my-plugin custom directory: ./cmds. Expected .md files or SKILL.md in subdirectories.`: command path exists but contains no valid command files - * `Plugin directory not found at path: ./plugins/my-plugin. Check that the marketplace entry has the correct path.`: the `source` path in marketplace.json points to a non-existent directory - * `Plugin my-plugin has conflicting manifests: both plugin.json and marketplace entry specify components.`: remove duplicate component definitions or remove `strict: false` in marketplace entry - -### - -​ - -Hook troubleshooting - -**Hook script not executing** : - - 1. Check the script is executable: `chmod +x ./scripts/your-script.sh` - 2. Verify the shebang line: First line should be `#!/bin/bash` or `#!/usr/bin/env bash` - 3. Check the path uses `${CLAUDE_PLUGIN_ROOT}`: `"command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/your-script.sh"` - 4. Test the script manually: `./scripts/your-script.sh` - -**Hook not triggering on expected events** : - - 1. Verify the event name is correct (case-sensitive): `PostToolUse`, not `postToolUse` - 2. Check the matcher pattern matches your tools: `"matcher": "Write|Edit"` for file operations - 3. Confirm the hook type is valid: `command`, `http`, `mcp_tool`, `prompt`, or `agent` - -### - -​ - -MCP server troubleshooting - -**Server not starting** : - - 1. Check the command exists and is executable - 2. Verify all paths use `${CLAUDE_PLUGIN_ROOT}` variable - 3. Check the MCP server logs: `claude --debug` shows initialization errors - 4. Test the server manually outside of Claude Code - -**Server tools not appearing** : - - 1. Ensure the server is properly configured in `.mcp.json` or `plugin.json` - 2. Verify the server implements the MCP protocol correctly - 3. Check for connection timeouts in debug output - -### - -​ - -Directory structure mistakes - -**Symptoms** : Plugin loads but components (skills, agents, hooks) are missing. **Correct structure** : Components must be at the plugin root, not inside `.claude-plugin/`. Only `plugin.json` belongs in `.claude-plugin/`. **Debug checklist** : - - 1. Run `claude --debug` and look for “loading plugin” messages - 2. Check that each component directory is listed in the debug output - 3. Verify file permissions allow reading the plugin files - -* * * - -## - -​ - -Distribution and versioning reference - -### - -​ - -Version management - -Claude Code uses the plugin’s version as the cache key that determines whether an update is available. When you run `/plugin update` or auto-update fires, Claude Code computes the current version and skips the update if it matches what’s already installed. A plugin loaded in place from a local-directory marketplace loads its current source files at every session start, whatever its version string says. For every source type except `command`, Claude Code resolves the version from the first of these that is set: - - 1. The `version` field in the plugin’s `plugin.json` - 2. The `version` field in the plugin’s marketplace entry in `marketplace.json` - 3. The git commit SHA of the plugin’s source, for `github`, `url`, `git-subdir`, and relative-path sources in a git-hosted marketplace - 4. The SHA-256 digest, for [`archive` sources](</docs/en/plugin-marketplaces#zip-archives>): the `sha256` pin in the marketplace entry, or the digest of the downloaded file when you set no pin. Claude Code shortens it to the first 12 characters - 5. `unknown`, for `npm` sources, or for local directories when neither the plugin directory nor its marketplace is a git repository. Claude Code doesn’t take the version from a repository that encloses the install path, such as a git-managed `~/.claude` - -For a [`command` source](</docs/en/plugin-marketplaces#command-sources>), Claude Code always derives the version from what the command produced: a 12-character content hash on its own, or appended to the `plugin.json` version as `<version>-<hash>` when one is set. Claude Code ignores the marketplace entry’s `version` field for command sources. A command whose hashed output changes therefore produces a new version, even when the authored version string stays the same. In [link mode](</docs/en/plugin-marketplaces#copy-mode-and-link-mode>), the hash covers the printed directory’s real path and its top-level entries rather than the file contents. For those source types, this gives you three ways to version a plugin: - -Approach| How| Update behavior| Best for ----|---|---|--- -**Explicit version**| Set `"version": "2.1.0"` in `plugin.json`| Users get updates only when you bump this field. Pushing new commits without bumping it has no effect, and `/plugin update` reports “already at the latest version”. For a plugin loaded in place, the new content loads anyway.| Published plugins with stable release cycles -**Commit-SHA version**| Omit `version` from both `plugin.json` and the marketplace entry| Users get updates whenever the source’s resolved commit changes| Internal or team plugins under active development -**Digest version**| Use an [`archive` source](</docs/en/plugin-marketplaces#zip-archives>) and omit `version` from both `plugin.json` and the marketplace entry| With a `sha256` pin, users get updates when you change the pin. Without one, users get updates whenever the hosted zip file’s bytes change| Plugins published as zip files to a static server or artifact repository - -If you use explicit versions, follow [semantic versioning](<https://semver.org>) (`MAJOR.MINOR.PATCH`): bump MAJOR for breaking changes, MINOR for new features, PATCH for bug fixes. Document changes in a `CHANGELOG.md`. - -* * * - -## - -​ - -See also - - * [Plugins](</docs/en/plugins>) \- Tutorials and practical usage - * [Plugin marketplaces](</docs/en/plugin-marketplaces>) \- Creating and managing marketplaces - * [Skills](</docs/en/skills>) \- Skill development details - * [Subagents](</docs/en/sub-agents>) \- Agent configuration and capabilities - * [Hooks](</docs/en/hooks>) \- Event handling and automation - * [MCP](</docs/en/mcp>) \- External tool integration - * [Settings](</docs/en/settings>) \- Configuration options for plugins