modified
Show diff (162 lines)
--- a/plugins.md +++ b/plugins.md @@ -7,11 +7,7 @@ For complete information on plugin structure and how to create plugins, see [Plugins](</docs/en/plugins/overview>). -## - -​ - -Loading plugins +## 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/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. @@ -51,11 +47,7 @@ asyncio.run(main()) -### - -​ - -Path specifications +### Path specifications Plugin paths can be: @@ -64,19 +56,11 @@ The path should point to the plugin’s root directory: the parent of `skills/`, `agents/`, `hooks/`, `commands/`, or `.claude-plugin/`. -### - -​ - -Reload plugins in a running session +### Reload plugins in a running session To apply a change to a plugin’s skills, commands, agents, or hooks without starting a new session, call [`reloadPlugins()`](</docs/en/agent-sdk/typescript#query-object>) on the TypeScript SDK’s `Query` object. The Python SDK doesn’t expose an equivalent method; send [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>) as a prompt in the session instead. -### - -​ - -Add plugins to a running session +### Add plugins to a running session In the TypeScript SDK, call [`reloadPlugins()`](</docs/en/agent-sdk/typescript#load-more-plugin-folders-with-addplugins>) on the `Query` object that `query()` returned, and list the plugin directory in that call’s `addPlugins` option. Each `addPlugins` entry is a `{ type: "local", path }` object with an absolute `path`. Requires TypeScript Agent SDK v0.3.301 or later. In this example, `q` is the `Query` object that `query()` returned. The example adds one plugin directory to the running session and, after `reloadPlugins()` returns, prints the path of every plugin in the session: @@ -88,11 +72,7 @@ If the plugin loaded, the printed list includes `/home/user/plugins/another-plugin`. If that path is missing from the list, or `reloadPlugins()` rejects, see [When `reloadPlugins()` doesn’t load the `addPlugins` folders](</docs/en/agent-sdk/typescript#when-reloadplugins-doesnt-load-the-addplugins-folders>) for the causes. -## - -​ - -Verifying plugin installation +## Verifying plugin installation When plugins load successfully, they appear in the system initialization message. You can verify that your plugins are available: @@ -148,11 +128,7 @@ asyncio.run(main()) -## - -​ - -Use 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. @@ -196,11 +172,7 @@ If you installed a plugin via the CLI (for example, `/plugin install my-plugin@marketplace`), you can still use it in the SDK by providing its installation path. Check `~/.claude/plugins/` for CLI-installed plugins. -## - -​ - -Complete example +## Complete example Here’s a full example demonstrating plugin loading and usage: @@ -278,11 +250,7 @@ if __name__ == "__main__": asyncio.run(run_with_plugin()) -## - -​ - -Plugin structure reference +## Plugin structure reference A plugin directory typically contains a `.claude-plugin/plugin.json` manifest file. The manifest is optional. When omitted, Claude Code auto-discovers components from the directory layout. The directory can include: @@ -302,11 +270,7 @@ The `commands/` directory holds skills as flat Markdown files. Use `skills/` for new plugins. Claude Code supports both locations. -## - -​ - -Multiple plugin sources +## Multiple plugin sources Combine plugins from different locations: @@ -323,17 +287,9 @@ The SDK doesn’t expand tilde paths like `~/plugins`. If a plugin path doesn’t exist, the SDK skips that plugin and the session continues, so check the `plugins` list in the init message to confirm each plugin loaded. -## - -​ - -Troubleshooting - -### - -​ - -Plugin not loading +## Troubleshooting + +### Plugin not loading If your plugin doesn’t appear in the init message’s `plugins` list, check its [`plugin_errors`](</docs/en/agent-sdk/typescript#sdksystemmessage>) field for the reason, then work through these checks: @@ -342,11 +298,7 @@ 3. **Check file permissions** : ensure the plugin directory is readable 4. **Confirm the directory exists** : the SDK skips a nonexistent path, and the plugin doesn’t appear in the init message’s `plugins` list -### - -​ - -Skills not appearing +### Skills not appearing If plugin skills don’t work: @@ -354,11 +306,7 @@ 2. **Check init message** : verify the skill appears in the `skills` list with the correct namespace 3. **Validate skill files** : ensure each skill has a `SKILL.md` file in its own subdirectory under `skills/`, for example `skills/my-skill/SKILL.md` -## - -​ - -See also +## See also * [Plugins](</docs/en/plugins/overview>) \- Complete plugin development guide * [Plugins reference](</docs/en/plugins/manifest-reference>) \- Technical specifications
modified
--- a/plugins.md +++ b/plugins.md @@ -63,6 +63,14 @@ * **Absolute paths** : full file system paths (for example, `"/home/user/plugins/my-plugin"`) The path should point to the plugin’s root directory: the parent of `skills/`, `agents/`, `hooks/`, `commands/`, or `.claude-plugin/`. + +### + +​ + +Reload plugins in a running session + +To apply a change to a plugin’s skills, commands, agents, or hooks without starting a new session, call [`reloadPlugins()`](</docs/en/agent-sdk/typescript#query-object>) on the TypeScript SDK’s `Query` object. The Python SDK doesn’t expose an equivalent method; send [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>) as a prompt in the session instead. ###
modified
--- a/plugins.md +++ b/plugins.md @@ -63,6 +63,22 @@ * **Absolute paths** : full file system paths (for example, `"/home/user/plugins/my-plugin"`) The path should point to the plugin’s root directory: the parent of `skills/`, `agents/`, `hooks/`, `commands/`, or `.claude-plugin/`. + +### + +​ + +Add plugins to a running session + +In the TypeScript SDK, call [`reloadPlugins()`](</docs/en/agent-sdk/typescript#load-more-plugin-folders-with-addplugins>) on the `Query` object that `query()` returned, and list the plugin directory in that call’s `addPlugins` option. Each `addPlugins` entry is a `{ type: "local", path }` object with an absolute `path`. Requires TypeScript Agent SDK v0.3.301 or later. In this example, `q` is the `Query` object that `query()` returned. The example adds one plugin directory to the running session and, after `reloadPlugins()` returns, prints the path of every plugin in the session: + + const result = await q.reloadPlugins({ + addPlugins: [{ type: "local", path: "/home/user/plugins/another-plugin" }] + }); + + console.log(result.plugins.map((plugin) => plugin.path)); + +If the plugin loaded, the printed list includes `/home/user/plugins/another-plugin`. If that path is missing from the list, or `reloadPlugins()` rejects, see [When `reloadPlugins()` doesn’t load the `addPlugins` folders](</docs/en/agent-sdk/typescript#when-reloadplugins-doesnt-load-the-addplugins-folders>) for the causes. ##
modified
--- a/plugins.md +++ b/plugins.md @@ -311,7 +311,7 @@ Plugin not loading -If your plugin doesn’t appear in the init message: +If your plugin doesn’t appear in the init message’s `plugins` list, check its [`plugin_errors`](</docs/en/agent-sdk/typescript#sdksystemmessage>) field for the reason, then work through these checks: 1. **Check the path** : ensure the path points to the plugin root directory, the parent of `skills/`, `agents/`, `hooks/`, `commands/`, or `.claude-plugin/` 2. **Validate plugin.json** : if your plugin includes a manifest, ensure it has valid JSON syntax
modified
--- 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
--- a/plugins.md +++ b/plugins.md @@ -1,4 +1,4 @@ -Plugins allow you to extend Claude Code with custom functionality that can be shared across projects. Through the Agent SDK, you can programmatically load plugins from local directories to add capabilities to your agent sessions. A plugin can include: +Plugins let you extend Claude Code with custom functionality that can be shared across projects. Through the Agent SDK, you can programmatically load plugins from local directories to add capabilities to your agent sessions. A plugin can include: * **Skills** : capabilities Claude invokes autonomously when relevant. You can also invoke a plugin skill directly with `/plugin-name:skill-name`. * **Agents** : specialized subagents for specific tasks
modified
--- a/plugins.md +++ b/plugins.md @@ -59,7 +59,7 @@ Plugin paths can be: - * **Relative paths** : resolved relative to your current working directory (for example, `"./plugins/my-plugin"`) + * **Relative paths** : resolved relative to the `cwd` option (for example, `"./plugins/my-plugin"`) * **Absolute paths** : full file system paths (for example, `"/home/user/plugins/my-plugin"`) The path should point to the plugin’s root directory: the parent of `skills/`, `agents/`, `hooks/`, `commands/`, or `.claude-plugin/`.
modified
--- a/plugins.md +++ b/plugins.md @@ -338,6 +338,6 @@ * [Plugins](</docs/en/plugins>) \- Complete plugin development guide * [Plugins reference](</docs/en/plugins-reference>) \- Technical specifications - * [Commands](</docs/en/agent-sdk/slash-commands>) \- Using commands in the SDK + * [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
--- a/plugins.md +++ b/plugins.md @@ -1,19 +1,9 @@ -Plugins allow you to extend Claude Code with custom functionality that can be shared across projects. Through the Agent SDK, you can programmatically load plugins from local directories to add skills, agents, hooks, and MCP servers to your agent sessions. - -## - -​ - -What are plugins? - -Plugins are packages of Claude Code extensions that can include: - - * **Skills** : Model-invoked capabilities that Claude uses autonomously (can also be invoked with `/skill-name`) - * **Agents** : Specialized subagents for specific tasks - * **Hooks** : Event handlers that respond to tool use and other events - * **MCP servers** : External tool integrations via Model Context Protocol - -The `commands/` directory is a legacy format. Use `skills/` for new plugins. Claude Code continues to support both formats for backward compatibility. +Plugins allow you to extend Claude Code with custom functionality that can be shared across projects. Through the Agent SDK, you can programmatically load plugins from local directories to add capabilities to your agent sessions. A plugin can include: + + * **Skills** : capabilities Claude invokes autonomously when relevant. You can also invoke a plugin skill directly with `/plugin-name:skill-name`. + * **Agents** : specialized subagents for specific tasks + * **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>). @@ -69,10 +59,10 @@ Plugin paths can be: - * **Relative paths** : Resolved relative to your current working directory (for example, `"./plugins/my-plugin"`) - * **Absolute paths** : Full file system paths (for example, `"/home/user/plugins/my-plugin"`) - -The path should point to the plugin’s root directory: the parent of `skills/`, `agents/`, `hooks/`, `commands/` (legacy), or `.claude-plugin/`, not a subdirectory. + * **Relative paths** : resolved relative to your current working directory (for example, `"./plugins/my-plugin"`) + * **Absolute paths** : full file system paths (for example, `"/home/user/plugins/my-plugin"`) + +The path should point to the plugin’s root directory: the parent of `skills/`, `agents/`, `hooks/`, `commands/`, or `.claude-plugin/`. ## @@ -275,10 +265,10 @@ my-plugin/ ├── .claude-plugin/ │ └── plugin.json # Plugin manifest (optional, components auto-discovered without it) - ├── skills/ # Agent Skills (invoked autonomously or via /skill-name) + ├── skills/ # Agent Skills (invoked autonomously or via /plugin-name:skill-name) │ └── my-skill/ │ └── SKILL.md - ├── commands/ # Legacy: use skills/ instead + ├── commands/ # Skills as flat .md files │ └── custom-cmd.md ├── agents/ # Custom agents │ └── specialist.md @@ -286,6 +276,8 @@ │ └── hooks.json └── .mcp.json # MCP server definitions +The `commands/` directory holds skills as flat Markdown files. Use `skills/` for new plugins. Claude Code supports both locations. + ## ​ @@ -321,7 +313,7 @@ If your plugin doesn’t appear in the init message: - 1. **Check the path** : ensure the path points to the plugin root directory, the parent of `skills/`, `agents/`, `hooks/`, `commands/` (legacy), or `.claude-plugin/` + 1. **Check the path** : ensure the path points to the plugin root directory, the parent of `skills/`, `agents/`, `hooks/`, `commands/`, or `.claude-plugin/` 2. **Validate plugin.json** : if your plugin includes a manifest, ensure it has valid JSON syntax 3. **Check file permissions** : ensure the plugin directory is readable 4. **Confirm the directory exists** : the SDK skips a nonexistent path, and the plugin doesn’t appear in the init message’s `plugins` list
modified
Show diff (816 lines)
--- a/plugins.md +++ b/plugins.md @@ -1,483 +1,351 @@ -Plugins let you extend Claude Code with custom functionality that can be shared across projects and teams. This guide covers creating your own plugins with skills, agents, hooks, and MCP servers. Looking to install existing plugins? See [Discover and install plugins](</docs/en/discover-plugins>). For complete technical specifications, see [Plugins reference](</docs/en/plugins-reference>). - -## - -​ - -When to use plugins vs standalone configuration - -Claude Code supports two ways to add custom skills, agents, and hooks: - -Approach| Skill names| Best for ----|---|--- -**Standalone** (`.claude/` directory)| `/hello`| Personal workflows, project-specific customizations, quick experiments -**Plugins** (self-contained directories with skills, agents, hooks, or a `.claude-plugin/plugin.json` manifest)| `/plugin-name:hello`| Sharing with teammates, distributing to community, versioned releases, reusable across projects - -Start with standalone configuration in `.claude/` for quick iteration, then convert to a plugin when you’re ready to share. - -## - -​ - -Quickstart - -This quickstart walks you through creating a plugin with a custom skill. You’ll create a manifest (the configuration file that defines your plugin), add a skill, and test it locally using the `--plugin-dir` flag. +Plugins allow you to extend Claude Code with custom functionality that can be shared across projects. Through the Agent SDK, you can programmatically load plugins from local directories to add skills, agents, hooks, and MCP servers to your agent sessions. + +## + +​ + +What are plugins? + +Plugins are packages of Claude Code extensions that can include: + + * **Skills** : Model-invoked capabilities that Claude uses autonomously (can also be invoked with `/skill-name`) + * **Agents** : Specialized subagents for specific tasks + * **Hooks** : Event handlers that respond to tool use and other events + * **MCP servers** : External tool integrations via Model Context Protocol + +The `commands/` directory is a legacy format. Use `skills/` for new plugins. Claude Code continues to support both formats for backward compatibility. + +For complete information on plugin structure and how to create plugins, see [Plugins](</docs/en/plugins>). + +## + +​ + +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. + +TypeScript + +Python + + import { query } from "@anthropic-ai/claude-agent-sdk"; + + for await (const message of query({ + prompt: "Hello", + options: { + plugins: [ + { type: "local", path: "./my-plugin" }, + { type: "local", path: "/absolute/path/to/another-plugin" } + ] + } + })) { + // Plugin commands, agents, and other features are now available + } + + import asyncio + from claude_agent_sdk import query, ClaudeAgentOptions + + async def main(): + async for message in query( + prompt="Hello", + options=ClaudeAgentOptions( + plugins=[ + {"type": "local", "path": "./my-plugin"}, + {"type": "local", "path": "/absolute/path/to/another-plugin"}, + ] + ), + ): + # Plugin commands, agents, and other features are now available + pass + + asyncio.run(main()) ### ​ -Prerequisites - - * Claude Code [installed and authenticated](</docs/en/quickstart#step-1-install-claude-code>) - -### - -​ - -Create your first plugin - -1 - -Create the plugin directory - -Every plugin lives in its own directory containing your skills, agents, or hooks, optionally alongside a `.claude-plugin/plugin.json` manifest. The location doesn’t matter for this quickstart because you’ll point Claude Code at the directory with `--plugin-dir` in the test step. Create it anywhere convenient, such as a scratch folder or a projects directory: - - mkdir my-first-plugin - -The remaining steps run from the parent directory and reference paths like `my-first-plugin/...` relative to it. - -2 - -Create the plugin manifest - -The manifest file at `.claude-plugin/plugin.json` defines your plugin’s identity: its name, description, and version. Claude Code uses this metadata to display your plugin in the plugin manager.Create the `.claude-plugin` directory inside your plugin folder: - - mkdir my-first-plugin/.claude-plugin - -Then create `my-first-plugin/.claude-plugin/plugin.json` with this content: - -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" +Path specifications + +Plugin paths can be: + + * **Relative paths** : Resolved relative to your current working directory (for example, `"./plugins/my-plugin"`) + * **Absolute paths** : Full file system paths (for example, `"/home/user/plugins/my-plugin"`) + +The path should point to the plugin’s root directory: the parent of `skills/`, `agents/`, `hooks/`, `commands/` (legacy), or `.claude-plugin/`, not a subdirectory. + +## + +​ + +Verifying plugin installation + +When plugins load successfully, they appear in the system initialization message. You can verify that your plugins are available: + +TypeScript + +Python + + import { query } from "@anthropic-ai/claude-agent-sdk"; + + for await (const message of query({ + prompt: "Hello", + options: { + plugins: [{ type: "local", path: "./my-plugin" }] + } + })) { + if (message.type === "system" && message.subtype === "init") { + // Check loaded plugins + console.log("Plugins:", message.plugins); + // Example: [{ name: "my-plugin", path: "/absolute/path/to/my-plugin" }] + + // Plugin skills appear with the plugin name as a prefix + console.log("Skills:", message.skills); + // Example: ["my-plugin:greet"] + + // Plugin commands use the same prefix, and skills appear here too + console.log("Commands:", message.slash_commands); + // Example: ["compact", "context", "my-plugin:custom-command", "my-plugin:greet"] } } -Field| Purpose ----|--- -`name`| Unique identifier and skill namespace. Skills are prefixed with this (e.g., `/my-first-plugin:hello`). -`description`| Shown in the plugin manager when browsing or installing plugins. -`version`| Optional. If set, users only receive updates when you bump this field. If omitted, the version comes from the next source in [version management](</docs/en/plugins-reference#version-management>). -`author`| Optional. Helpful for attribution. - -For additional fields like `homepage`, `repository`, and `license`, see the [full manifest schema](</docs/en/plugins-reference#plugin-manifest-schema>). - -3 - -Add a skill - -Skills live in the `skills/` directory. Each skill is a folder containing a `SKILL.md` file. The folder name becomes the skill name, prefixed with the plugin’s namespace (`hello/` in a plugin named `my-first-plugin` creates `/my-first-plugin:hello`).Create a skill directory in your plugin folder: - - 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 - - --- - description: Greet the user with a friendly message - disable-model-invocation: true - --- - - Greet the user warmly and ask how you can help them today. - -4 - -Test your plugin - -Run Claude Code with the `--plugin-dir` flag to load your plugin: - - claude --plugin-dir ./my-first-plugin - -Once Claude Code starts, try your new skill: - - /my-first-plugin:hello - -You’ll see Claude respond with a greeting. Run `/help` and open the **Custom commands** tab to see your skill listed under the plugin namespace. - -**Why namespacing?** Plugin skills are always namespaced (like `/my-first-plugin:hello`) to prevent conflicts when multiple plugins have skills with the same name.To change the namespace prefix, update the `name` field in `plugin.json`. - -5 - -Add skill arguments - -Make your skill dynamic by accepting user input. The `$ARGUMENTS` placeholder captures any text the user provides after the skill name.Update your `SKILL.md` file: - -my-first-plugin/skills/hello/SKILL.md - - --- - description: Greet the user with a personalized message - --- - - # Hello Skill - - Greet the user named "$ARGUMENTS" warmly and ask how you can help them today. Make the greeting personal and encouraging. - -Run `/reload-plugins` to pick up the changes. The skills count in the summary covers only `commands/` directories, so it can report `0 skills` even though the skill you just edited reloaded. Then try the skill with your name: - - /my-first-plugin:hello Alex - -Claude will greet you by name. For more on passing arguments to skills, see [Skills](</docs/en/skills#pass-arguments-to-skills>). - -The `--plugin-dir` flag is useful for development and testing. When you’re ready to share your plugin with others, see [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>). - -## - -​ - -Develop a plugin in your skills directory - -Instead of passing `--plugin-dir` on every launch, you can keep a plugin in your skills directory and have Claude Code load it automatically. `claude plugin init` scaffolds one: - - claude plugin init my-tool - -This creates `~/.claude/skills/my-tool/` with a `.claude-plugin/plugin.json` manifest and a starter `SKILL.md`. On the next session it loads as `my-tool@skills-dir` with no marketplace or install step. For the auto-load rules, personal vs. project scope, the workspace-trust requirement, and how to update or remove one, see [Skills-directory plugins](</docs/en/plugins-reference#skills-directory-plugins>). - -## - -​ - -Plugin structure overview - -You’ve created a plugin with a skill, but plugins can include much more: custom agents, hooks, MCP servers, LSP servers, and background monitors. - -**Common mistake** : Don’t put `commands/`, `agents/`, `skills/`, or `hooks/` inside the `.claude-plugin/` directory. Only `plugin.json` goes inside `.claude-plugin/`. All other directories must be at the plugin root level.The plugin root is the individual plugin’s own directory: the one you pass to `--plugin-dir` or that contains `.claude-plugin/plugin.json`. It is never `~/.claude/`. For example, Claude Code doesn’t read a `.mcp.json` placed at `~/.claude/.mcp.json`. - -Directory| Location| Purpose ----|---|--- -`.claude-plugin/`| Plugin root| Contains `plugin.json` manifest (optional if components use default locations) -`skills/`| Plugin root| Skills as `<name>/SKILL.md` directories -`commands/`| Plugin root| Skills as flat Markdown files. Use `skills/` for new plugins -`agents/`| Plugin root| Custom agent definitions -`hooks/`| Plugin root| Event handlers in `hooks.json` -`.mcp.json`| Plugin root| MCP server configurations -`.lsp.json`| Plugin root| LSP server configurations for code intelligence -`monitors/`| Plugin root| Background monitor configurations in `monitors.json` -`bin/`| Plugin root| Executables added to the Bash tool’s `PATH` while the plugin is enabled -`settings.json`| Plugin root| Default [settings](</docs/en/settings>) applied when the plugin is enabled - -A plugin that ships exactly one skill can place `SKILL.md` directly at the plugin root instead of creating a `skills/` directory. Claude Code loads it as a single skill and uses the frontmatter `name` field for the invocation name. Use the `skills/` layout for plugins that may grow to more than one skill. - -**Next steps** : Ready to add more features? Jump to Develop more complex plugins to add agents, hooks, MCP servers, and LSP servers. For complete technical specifications of all plugin components, see [Plugins reference](</docs/en/plugins-reference>). - -## - -​ - -Develop more complex plugins - -Once you’re comfortable with basic plugins, you can create more sophisticated extensions. - -### - -​ - -Add Skills to your plugin - -Plugins can include [Agent Skills](</docs/en/skills>) to extend Claude’s capabilities. Skills are model-invoked: Claude automatically uses them based on the task context. Add a `skills/` directory at your plugin root with Skill folders containing `SKILL.md` files: + import asyncio + from claude_agent_sdk import query, ClaudeAgentOptions, SystemMessage + + async def main(): + async for message in query( + prompt="Hello", + options=ClaudeAgentOptions( + plugins=[{"type": "local", "path": "./my-plugin"}] + ), + ): + if isinstance(message, SystemMessage) and message.subtype == "init": + # Check loaded plugins + print("Plugins:", message.data.get("plugins")) + # Example: [{"name": "my-plugin", "path": "/absolute/path/to/my-plugin"}] + + # Plugin skills appear with the plugin name as a prefix + print("Skills:", message.data.get("skills")) + # Example: ["my-plugin:greet"] + + # Plugin commands use the same prefix, and skills appear here too + print("Commands:", message.data.get("slash_commands")) + # Example: ["compact", "context", "my-plugin:custom-command", "my-plugin:greet"] + + asyncio.run(main()) + +## + +​ + +Using 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. + +TypeScript + +Python + + import { query } from "@anthropic-ai/claude-agent-sdk"; + + // Load a plugin with a custom /greet skill + for await (const message of query({ + prompt: "/my-plugin:greet", // Use plugin skill with namespace + options: { + plugins: [{ type: "local", path: "./my-plugin" }] + } + })) { + // Claude executes the custom greeting skill from the plugin + if (message.type === "assistant") { + console.log(message.message.content); + } + } + + import asyncio + from claude_agent_sdk import query, ClaudeAgentOptions, AssistantMessage, TextBlock + + async def main(): + # Load a plugin with a custom /greet skill + async for message in query( + prompt="/my-plugin:greet", # Use plugin skill with namespace + options=ClaudeAgentOptions( + plugins=[{"type": "local", "path": "./my-plugin"}] + ), + ): + # Claude executes the custom greeting skill from the plugin + if isinstance(message, AssistantMessage): + for block in message.content: + if isinstance(block, TextBlock): + print(f"Claude: {block.text}") + + asyncio.run(main()) + +If you installed a plugin via the CLI (for example, `/plugin install my-plugin@marketplace`), you can still use it in the SDK by providing its installation path. Check `~/.claude/plugins/` for CLI-installed plugins. + +## + +​ + +Complete example + +Here’s a full example demonstrating plugin loading and usage: + +TypeScript + +Python + + import { query } from "@anthropic-ai/claude-agent-sdk"; + import { fileURLToPath } from "node:url"; + + async function runWithPlugin() { + const pluginPath = fileURLToPath(new URL("./plugins/my-plugin", import.meta.url)); + + console.log("Loading plugin from:", pluginPath); + + for await (const message of query({ + prompt: "What custom commands do you have available?", + options: { + plugins: [{ type: "local", path: pluginPath }], + maxTurns: 3 + } + })) { + if (message.type === "system" && message.subtype === "init") { + console.log("Loaded plugins:", message.plugins); + console.log("Available skills:", message.skills); + console.log("Available commands:", message.slash_commands); + } + + if (message.type === "assistant") { + console.log("Assistant:", message.message.content); + } + } + } + + runWithPlugin().catch(console.error); + + #!/usr/bin/env python3 + """Example demonstrating how to use plugins with the Agent SDK.""" + + import asyncio + from pathlib import Path + + from claude_agent_sdk import ( + AssistantMessage, + ClaudeAgentOptions, + SystemMessage, + TextBlock, + query, + ) + + async def run_with_plugin(): + """Example using a custom plugin.""" + plugin_path = Path(__file__).parent / "plugins" / "my-plugin" + + print(f"Loading plugin from: {plugin_path}") + + options = ClaudeAgentOptions( + plugins=[{"type": "local", "path": str(plugin_path)}], + max_turns=3, + ) + + async for message in query( + prompt="What custom commands do you have available?", options=options + ): + if isinstance(message, SystemMessage) and message.subtype == "init": + print(f"Loaded plugins: {message.data.get('plugins')}") + print(f"Available skills: {message.data.get('skills')}") + print(f"Available commands: {message.data.get('slash_commands')}") + + if isinstance(message, AssistantMessage): + for block in message.content: + if isinstance(block, TextBlock): + print(f"Assistant: {block.text}") + + if __name__ == "__main__": + asyncio.run(run_with_plugin()) + +## + +​ + +Plugin structure reference + +A plugin directory typically contains a `.claude-plugin/plugin.json` manifest file. The manifest is optional. When omitted, Claude Code auto-discovers components from the directory layout. The directory can include: my-plugin/ ├── .claude-plugin/ - │ └── plugin.json - └── skills/ - └── code-review/ - └── SKILL.md - -Each `SKILL.md` contains YAML frontmatter and instructions. Include a `description` so Claude knows when to use the skill: - - --- - description: Reviews code for best practices and potential issues. Use when reviewing code, checking PRs, or analyzing code quality. - --- - - When reviewing code, check for: - 1. Code organization and structure - 2. Error handling - 3. Security concerns - 4. Test coverage - -After you install the plugin, check the install summary: if it reports `Run /reload-plugins to activate.`, run that command to load the Skills. For complete Skill authoring guidance including progressive disclosure and tool restrictions, see [Agent Skills](</docs/en/skills>). + │ └── plugin.json # Plugin manifest (optional, components auto-discovered without it) + ├── skills/ # Agent Skills (invoked autonomously or via /skill-name) + │ └── my-skill/ + │ └── SKILL.md + ├── commands/ # Legacy: use skills/ instead + │ └── custom-cmd.md + ├── agents/ # Custom agents + │ └── specialist.md + ├── hooks/ # Event handlers + │ └── hooks.json + └── .mcp.json # MCP server definitions + +## + +​ + +Multiple plugin sources + +Combine plugins from different locations: + + import * as os from "node:os"; + import * as path from "node:path"; + + plugins: [ + { type: "local", path: "./local-plugin" }, + { + type: "local", + path: path.join(os.homedir(), ".claude", "custom-plugins", "shared-plugin") + } + ]; + +The SDK doesn’t expand tilde paths like `~/plugins`. If a plugin path doesn’t exist, the SDK skips that plugin and the session continues, so check the `plugins` list in the init message to confirm each plugin loaded. + +## + +​ + +Troubleshooting ### ​ -Add LSP servers to your plugin - -For common languages like TypeScript, Python, and Rust, install the pre-built LSP plugins from the official marketplace. Create custom LSP plugins only when you need support for languages not already covered. - -LSP (Language Server Protocol) plugins give Claude real-time code intelligence. If you need to support a language that doesn’t have an official LSP plugin, you can create your own by adding an `.lsp.json` file to your plugin: - -.lsp.json - - { - "go": { - "command": "gopls", - "args": ["serve"], - "extensionToLanguage": { - ".go": "go" - } - } - } - -Users installing your plugin must have the language server binary installed on their machine. To confirm the server starts, launch Claude Code with the plugin enabled and check the `/plugin` Errors tab: a language server that fails to start appears there, for example with `Executable not found in $PATH` when the binary isn’t installed. An entry with an invalid configuration is skipped instead; run `claude --debug` to see why. For complete LSP configuration options, see [LSP servers](</docs/en/plugins-reference#lsp-servers>). +Plugin not loading + +If your plugin doesn’t appear in the init message: + + 1. **Check the path** : ensure the path points to the plugin root directory, the parent of `skills/`, `agents/`, `hooks/`, `commands/` (legacy), or `.claude-plugin/` + 2. **Validate plugin.json** : if your plugin includes a manifest, ensure it has valid JSON syntax + 3. **Check file permissions** : ensure the plugin directory is readable + 4. **Confirm the directory exists** : the SDK skips a nonexistent path, and the plugin doesn’t appear in the init message’s `plugins` list ### ​ -Add background monitors to your plugin - -Background monitors let your plugin watch logs, files, or external status in the background and notify Claude as events arrive. Claude Code starts each monitor automatically when the plugin is active, so you don’t need to instruct Claude to start the watch. Add a `monitors/monitors.json` file at the plugin root with an array of monitor entries: - -monitors/monitors.json - - [ - { - "name": "error-log", - "command": "tail -F ./logs/error.log", - "description": "Application error log" - } - ] - -Each stdout line from `command` is delivered to Claude as a notification during the session. For the full schema, including the `when` trigger and variable substitution, see [Monitors](</docs/en/plugins-reference#monitors>). - -### - -​ - -Ship default settings with your plugin - -Plugins can include a `settings.json` file at the plugin root to apply default configuration when the plugin is enabled. Currently, only the `agent` and `subagentStatusLine` keys are supported. Setting `agent` activates one of the plugin’s [custom agents](</docs/en/sub-agents>) as the main thread, applying its system prompt, tool restrictions, and model. This lets a plugin change how Claude Code behaves by default when enabled. - -settings.json - - { - "agent": "security-reviewer" - } - -This example activates the `security-reviewer` agent defined in the plugin’s `agents/` directory. Settings from `settings.json` take priority over `settings` declared in `plugin.json`. Unknown keys are silently ignored. - -### - -​ - -Organize complex plugins - -For plugins with many components, organize your directory structure by functionality. For complete directory layouts and organization patterns, see [Plugin directory structure](</docs/en/plugins-reference#plugin-directory-structure>). - -### - -​ - -Test your plugins locally - -Use the `--plugin-dir` flag to test plugins during development. This loads your plugin directly without requiring installation. - - claude --plugin-dir ./my-plugin - -The flag also accepts a `.zip` archive of the plugin directory. - - claude --plugin-dir ./my-plugin.zip - -When a `--plugin-dir` plugin has the same name as an installed marketplace plugin, the local copy takes precedence for that session. This lets you test changes to a plugin you already have installed without uninstalling it first. The exception is plugins that managed settings force-enable or force-disable: `--plugin-dir` cannot override those. As you make changes to your plugin, run `/reload-plugins` to pick up the updates without restarting. This reloads plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Test your plugin components: - - * Try your skills with `/plugin-name:skill-name` - * Check that agents appear in `/context` under Custom Agents, or @-mention one by its scoped name - * Trigger the event each hook matches, such as asking Claude to edit a file for a `PostToolUse` hook, and confirm its effect. Claude Code records which hooks matched, their exit codes, and their output in the [debug log](</docs/en/hooks#debug-hooks>) - -You can load multiple plugins at once by specifying the flag multiple times: - - claude --plugin-dir ./plugin-one --plugin-dir ./plugin-two - -To test a plugin that is already packaged as a `.zip` archive and hosted at a URL, such as a CI build artifact, use `--plugin-url` instead. Claude Code fetches the archive at startup and loads it for that session only. 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. The same [trust considerations](</docs/en/discover-plugins#security>) apply as for any plugin source: only point this flag at archives you control or trust. To load multiple plugins, repeat the flag for each URL: - - claude --plugin-url https://example.com/my-plugin.zip --plugin-url https://example.com/other.zip - -Or pass space-separated URLs as one quoted argument: - - claude --plugin-url "https://example.com/my-plugin.zip https://example.com/other.zip" - -### - -​ - -Debug plugin issues - -If your plugin isn’t working as expected: - - 1. **Check the structure** : Ensure your directories are at the plugin root, not inside `.claude-plugin/` - 2. **Test components individually** : Check each skill, agent, and hook separately - 3. **Use validation and debugging tools** : See [Debugging and development tools](</docs/en/plugins-reference#debugging-and-development-tools>) for CLI commands and troubleshooting techniques - -### - -​ - -Share your plugins - -When your plugin is ready to share: - - 1. **Add documentation** : Include a `README.md` with installation and usage instructions - 2. **Choose a versioning strategy** : Decide whether to set an explicit `version` or rely on the fallback described in [version management](</docs/en/plugins-reference#version-management>). - 3. **Create or use a marketplace** : Distribute through [plugin marketplaces](</docs/en/plugin-marketplaces>) for installation - 4. **Test with others** : Have team members test the plugin before wider distribution - -Once your plugin is in a marketplace, others can install it using the instructions in [Discover and install plugins](</docs/en/discover-plugins>). To keep a plugin internal to your team, host the marketplace in a [private repository](</docs/en/plugin-marketplaces#private-repositories>). - -### - -​ - -Submit your plugin to the community marketplace - -Anthropic maintains two public marketplaces for Claude Code plugins: - - * **`claude-plugins-official`** : a curated set of plugins maintained by Anthropic. Claude Code registers it automatically the first time you start Claude Code interactively. If you run Claude Code non-interactively before that first interactive launch, or a [marketplace policy](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) blocked an earlier attempt, register it yourself with `claude plugin marketplace add anthropics/claude-plugins-official`. - * **`claude-community`** : the public community marketplace where third-party submissions land after review. Users add it with `/plugin marketplace add anthropics/claude-plugins-community` and install from it as `@claude-community`. - -To submit your plugin for community-marketplace review, 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 directory management access; organization Owners have this access by default. Individual authors who aren’t part of a Team or Enterprise organization can use the Console form instead. Run `claude plugin validate ./your-plugin` locally before you submit, replacing `./your-plugin` with the path to your plugin directory. The review pipeline runs the same check on every submission, along with automated safety screening. 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. Approved plugins are pinned to a specific commit SHA in the [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>) catalog, and CI bumps the pin automatically as you push new commits to your repository. The public catalog syncs nightly from the review pipeline, so there can be a delay between approval 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`, is curated separately. Anthropic decides which plugins to include at its discretion. There is no application process, and the submission form does not add plugins to the official marketplace. If Anthropic lists your plugin in the official marketplace, your CLI can prompt Claude Code users to install it. See [Recommend your plugin from your CLI](</docs/en/plugin-hints>). - -## - -​ - -Convert existing configurations to plugins - -If you already have skills or hooks in your `.claude/` directory, you can convert them into a plugin for easier sharing and distribution. - -### - -​ - -Migration steps - -1 - -Create the plugin structure - -Create a new plugin directory in your project root, alongside the existing `.claude/` folder, so the relative `cp` paths in the next step resolve: - - mkdir -p my-plugin/.claude-plugin - -Create the manifest file at `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. You might not have all three: if a directory doesn’t exist, `cp` prints `No such file or directory` and copies nothing, so skip that command or ignore the error. - - cp -r .claude/commands my-plugin/ - - cp -r .claude/agents my-plugin/ - - cp -r .claude/skills my-plugin/ - -Your plugin now contains copies of the directories you had under `.claude/`. Run `ls my-plugin` to confirm: you should see each directory you copied. - -3 - -Migrate hooks - -If you have hooks in your settings, create a hooks directory: - - mkdir my-plugin/hooks - -Create `my-plugin/hooks/hooks.json` with your hooks configuration. Copy the `hooks` object from your `.claude/settings.json` or `settings.local.json`, since the format is the same. The command receives hook input as JSON on stdin, so use `jq` to extract the file path: - -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 your migrated plugin - -Load your plugin to verify everything works: - - claude --plugin-dir ./my-plugin - -Test each component: run your commands, check that agents appear in `/context`, and trigger the event each hook matches to confirm its effect. Claude Code records which hooks matched and how they exited in the [debug log](</docs/en/hooks#debug-hooks>). - -### - -​ - -What changes when migrating - -Standalone (`.claude/`)| Plugin ----|--- -Only available in one project| Can be shared via marketplaces -Files in `.claude/commands/`| Files in `plugin-name/commands/` -Hooks in `settings.json`| Hooks in `hooks/hooks.json` -Must manually copy to share| Install with `/plugin install` - -After migrating, remove the original files from `.claude/` to avoid duplicates. Project and user `.claude/agents/` definitions override same-named plugin agents, so the plugin version only takes effect once the originals are removed. Plugin skills are namespaced as `/plugin-name:skill-name`, so the original `/skill-name` and the plugin copy both remain available rather than one overriding the other. - -## - -​ - -Next steps - -Now that you understand Claude Code’s plugin system, here are suggested paths for different goals: - -### - -​ - -For plugin users - - * [Discover and install plugins](</docs/en/discover-plugins>): browse marketplaces and install plugins - * [Configure team marketplaces](</docs/en/discover-plugins#configure-team-marketplaces>): set up repository-level plugins for your team - -### - -​ - -For plugin developers - - * [Create and distribute a marketplace](</docs/en/plugin-marketplaces>): package and share your plugins - * [Plugins reference](</docs/en/plugins-reference>): complete technical specifications - * Dive deeper into specific plugin components: - * [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 +Skills not appearing + +If plugin skills don’t work: + + 1. **Use the namespace** : invoke plugin skills as `/plugin-name:skill-name` + 2. **Check init message** : verify the skill appears in the `skills` list with the correct namespace + 3. **Validate skill files** : ensure each skill has a `SKILL.md` file in its own subdirectory under `skills/`, for example `skills/my-skill/SKILL.md` + +## + +​ + +See also + + * [Plugins](</docs/en/plugins>) \- Complete plugin development guide + * [Plugins reference](</docs/en/plugins-reference>) \- Technical specifications + * [Commands](</docs/en/agent-sdk/slash-commands>) \- Using commands in the SDK + * [Subagents](</docs/en/agent-sdk/subagents>) \- Working with specialized agents + * [Skills](</docs/en/agent-sdk/skills>) \- Using Agent Skills
modified
--- a/plugins.md +++ b/plugins.md @@ -13,21 +13,6 @@ **Standalone** (`.claude/` directory)| `/hello`| Personal workflows, project-specific customizations, quick experiments **Plugins** (self-contained directories with skills, agents, hooks, or a `.claude-plugin/plugin.json` manifest)| `/plugin-name:hello`| Sharing with teammates, distributing to community, versioned releases, reusable across projects -**Use standalone configuration when** : - - * You’re customizing Claude Code for a single project - * The configuration is personal and doesn’t need to be shared - * You’re experimenting with skills or hooks before packaging them - * You want short skill names like `/hello` or `/deploy` - -**Use plugins when** : - - * You want to share functionality with your team or community - * You need the same skills/agents across multiple projects - * You want version control and easy updates for your extensions - * You’re distributing through a marketplace - * You’re okay with namespaced skills like `/my-plugin:hello` (namespacing prevents conflicts between plugins) - Start with standalone configuration in `.claude/` for quick iteration, then convert to a plugin when you’re ready to share. ## @@ -45,8 +30,6 @@ Prerequisites * Claude Code [installed and authenticated](</docs/en/quickstart#step-1-install-claude-code>) - -If you don’t see the `/plugin` command, update Claude Code to the latest version. See [Troubleshooting](</docs/en/troubleshooting>) for upgrade instructions. ### @@ -89,7 +72,7 @@ ---|--- `name`| Unique identifier and skill namespace. Skills are prefixed with this (e.g., `/my-first-plugin:hello`). `description`| Shown in the plugin manager when browsing or installing plugins. -`version`| Optional. If set, users only receive updates when you bump this field. If omitted and your plugin is distributed via git, the commit SHA is used and every commit counts as a new version. See [version management](</docs/en/plugins-reference#version-management>). +`version`| Optional. If set, users only receive updates when you bump this field. If omitted, the version comes from the next source in [version management](</docs/en/plugins-reference#version-management>). `author`| Optional. Helpful for attribution. For additional fields like `homepage`, `repository`, and `license`, see the [full manifest schema](</docs/en/plugins-reference#plugin-manifest-schema>). @@ -150,12 +133,6 @@ /my-first-plugin:hello Alex Claude will greet you by name. For more on passing arguments to skills, see [Skills](</docs/en/skills#pass-arguments-to-skills>). - -You’ve successfully created and tested a plugin with these key components: - - * **Plugin manifest** (`.claude-plugin/plugin.json`): describes your plugin’s metadata - * **Skills directory** (`skills/`): contains your custom skills - * **Skill arguments** (`$ARGUMENTS`): captures user input for dynamic behavior The `--plugin-dir` flag is useful for development and testing. When you’re ready to share your plugin with others, see [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>). @@ -313,7 +290,7 @@ claude --plugin-dir ./my-plugin -The flag also accepts a `.zip` archive of the plugin directory, which requires Claude Code v2.1.128 or later. +The flag also accepts a `.zip` archive of the plugin directory. claude --plugin-dir ./my-plugin.zip @@ -356,7 +333,7 @@ When your plugin is ready to share: 1. **Add documentation** : Include a `README.md` with installation and usage instructions - 2. **Choose a versioning strategy** : Decide whether to set an explicit `version` or rely on the git commit SHA. See [version management](</docs/en/plugins-reference#version-management>) + 2. **Choose a versioning strategy** : Decide whether to set an explicit `version` or rely on the fallback described in [version management](</docs/en/plugins-reference#version-management>). 3. **Create or use a marketplace** : Distribute through [plugin marketplaces](</docs/en/plugin-marketplaces>) for installation 4. **Test with others** : Have team members test the plugin before wider distribution @@ -379,8 +356,6 @@ * **Console** : [platform.claude.com/plugins/submit](<https://platform.claude.com/plugins/submit>) The claude.ai form requires a Team or Enterprise organization and directory management access; organization Owners have this access by default. Individual authors who aren’t part of a Team or Enterprise organization can use the Console form instead. Run `claude plugin validate ./your-plugin` locally before you submit, replacing `./your-plugin` with the path to your plugin directory. The review pipeline runs the same check on every submission, along with automated safety screening. 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. Approved plugins are pinned to a specific commit SHA in the [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>) catalog, and CI bumps the pin automatically as you push new commits to your repository. The public catalog syncs nightly from the review pipeline, so there can be a delay between approval 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`, is curated separately. Anthropic decides which plugins to include at its discretion. There is no application process, and the submission form does not add plugins to the official marketplace. If Anthropic lists your plugin in the official marketplace, your CLI can prompt Claude Code users to install it. See [Recommend your plugin from your CLI](</docs/en/plugin-hints>). - -For complete technical specifications, debugging techniques, and distribution strategies, see [Plugins reference](</docs/en/plugins-reference>). ##
modified
--- a/plugins.md +++ b/plugins.md @@ -233,7 +233,7 @@ 3. Security concerns 4. Test coverage -After installing the plugin, run `/reload-plugins` to load the Skills. For complete Skill authoring guidance including progressive disclosure and tool restrictions, see [Agent Skills](</docs/en/skills>). +After you install the plugin, check the install summary: if it reports `Run /reload-plugins to activate.`, run that command to load the Skills. For complete Skill authoring guidance including progressive disclosure and tool restrictions, see [Agent Skills](</docs/en/skills>). ###
modified
--- a/plugins.md +++ b/plugins.md @@ -370,7 +370,7 @@ Anthropic maintains two public marketplaces for Claude Code plugins: - * **`claude-plugins-official`** : a curated set of plugins maintained by Anthropic. Registered automatically the first time you start Claude Code interactively. A non-interactive script that runs before that first launch must add it explicitly with `claude plugin marketplace add anthropics/claude-plugins-official`. + * **`claude-plugins-official`** : a curated set of plugins maintained by Anthropic. Claude Code registers it automatically the first time you start Claude Code interactively. If you run Claude Code non-interactively before that first interactive launch, or a [marketplace policy](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) blocked an earlier attempt, register it yourself with `claude plugin marketplace add anthropics/claude-plugins-official`. * **`claude-community`** : the public community marketplace where third-party submissions land after review. Users add it with `/plugin marketplace add anthropics/claude-plugins-community` and install from it as `@claude-community`. To submit your plugin for community-marketplace review, use one of the in-app forms:
modified
--- a/plugins.md +++ b/plugins.md @@ -125,7 +125,7 @@ /my-first-plugin:hello -You’ll see Claude respond with a greeting. Run `/help` to see your skill listed under the plugin namespace. +You’ll see Claude respond with a greeting. Run `/help` and open the **Custom commands** tab to see your skill listed under the plugin namespace. **Why namespacing?** Plugin skills are always namespaced (like `/my-first-plugin:hello`) to prevent conflicts when multiple plugins have skills with the same name.To change the namespace prefix, update the `name` field in `plugin.json`. @@ -145,7 +145,7 @@ Greet the user named "$ARGUMENTS" warmly and ask how you can help them today. Make the greeting personal and encouraging. -Run `/reload-plugins` to pick up the changes, then try the skill with your name: +Run `/reload-plugins` to pick up the changes. The skills count in the summary covers only `commands/` directories, so it can report `0 skills` even though the skill you just edited reloaded. Then try the skill with your name: /my-first-plugin:hello Alex @@ -257,7 +257,7 @@ } } -Users installing your plugin must have the language server binary installed on their machine. For complete LSP configuration options, see [LSP servers](</docs/en/plugins-reference#lsp-servers>). +Users installing your plugin must have the language server binary installed on their machine. To confirm the server starts, launch Claude Code with the plugin enabled and check the `/plugin` Errors tab: a language server that fails to start appears there, for example with `Executable not found in $PATH` when the binary isn’t installed. An entry with an invalid configuration is skipped instead; run `claude --debug` to see why. For complete LSP configuration options, see [LSP servers](</docs/en/plugins-reference#lsp-servers>). ### @@ -321,13 +321,13 @@ * Try your skills with `/plugin-name:skill-name` * Check that agents appear in `/context` under Custom Agents, or @-mention one by its scoped name - * Verify hooks work as expected + * Trigger the event each hook matches, such as asking Claude to edit a file for a `PostToolUse` hook, and confirm its effect. Claude Code records which hooks matched, their exit codes, and their output in the [debug log](</docs/en/hooks#debug-hooks>) You can load multiple plugins at once by specifying the flag multiple times: claude --plugin-dir ./plugin-one --plugin-dir ./plugin-two -To test a plugin that is already packaged as a `.zip` archive and hosted at a URL, such as a CI build artifact, use `--plugin-url` instead. Claude Code fetches the archive at startup and loads it for that session only. If the fetch fails or the archive is invalid, Claude Code reports a plugin load error and starts without it. The same [trust considerations](</docs/en/discover-plugins#security>) apply as for any plugin source: only point this flag at archives you control or trust. To load multiple plugins, repeat the flag for each URL: +To test a plugin that is already packaged as a `.zip` archive and hosted at a URL, such as a CI build artifact, use `--plugin-url` instead. Claude Code fetches the archive at startup and loads it for that session only. 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. The same [trust considerations](</docs/en/discover-plugins#security>) apply as for any plugin source: only point this flag at archives you control or trust. To load multiple plugins, repeat the flag for each URL: claude --plugin-url https://example.com/my-plugin.zip --plugin-url https://example.com/other.zip @@ -378,7 +378,7 @@ * **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 directory management access; organization Owners have this access by default. Individual authors who aren’t part of a Team or Enterprise organization can use the Console form instead. Run `claude plugin validate` locally before you submit. The review pipeline runs the same check on every submission, along with automated safety screening. Approved plugins are pinned to a specific commit SHA in the [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>) catalog, and CI bumps the pin automatically as you push new commits to your repository. The public catalog syncs nightly from the review pipeline, so there can be a delay between approval 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`, is curated separately. Anthropic decides which plugins to include at its discretion. There is no application process, and the submission form does not add plugins to the official marketplace. If Anthropic lists your plugin in the official marketplace, your CLI can prompt Claude Code users to install it. See [Recommend your plugin from your CLI](</docs/en/plugin-hints>). +The claude.ai form requires a Team or Enterprise organization and directory management access; organization Owners have this access by default. Individual authors who aren’t part of a Team or Enterprise organization can use the Console form instead. Run `claude plugin validate ./your-plugin` locally before you submit, replacing `./your-plugin` with the path to your plugin directory. The review pipeline runs the same check on every submission, along with automated safety screening. 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. Approved plugins are pinned to a specific commit SHA in the [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>) catalog, and CI bumps the pin automatically as you push new commits to your repository. The public catalog syncs nightly from the review pipeline, so there can be a delay between approval 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`, is curated separately. Anthropic decides which plugins to include at its discretion. There is no application process, and the submission form does not add plugins to the official marketplace. If Anthropic lists your plugin in the official marketplace, your CLI can prompt Claude Code users to install it. See [Recommend your plugin from your CLI](</docs/en/plugin-hints>). For complete technical specifications, debugging techniques, and distribution strategies, see [Plugins reference](</docs/en/plugins-reference>). @@ -418,16 +418,15 @@ Copy your existing files -Copy your existing configurations to the plugin directory: - - # Copy commands +Copy each configuration directory you have to the plugin root. You might not have all three: if a directory doesn’t exist, `cp` prints `No such file or directory` and copies nothing, so skip that command or ignore the error. + cp -r .claude/commands my-plugin/ - # Copy agents (if any) cp -r .claude/agents my-plugin/ - # Copy skills (if any) cp -r .claude/skills my-plugin/ + +Your plugin now contains copies of the directories you had under `.claude/`. Run `ls my-plugin` to confirm: you should see each directory you copied. 3 @@ -460,7 +459,7 @@ claude --plugin-dir ./my-plugin -Test each component: run your commands, check that agents appear in `/context`, and verify hooks trigger correctly. +Test each component: run your commands, check that agents appear in `/context`, and trigger the event each hook matches to confirm its effect. Claude Code records which hooks matched and how they exited in the [debug log](</docs/en/hooks#debug-hooks>). ###
modified
--- a/plugins.md +++ b/plugins.md @@ -179,7 +179,7 @@ You’ve created a plugin with a skill, but plugins can include much more: custom agents, hooks, MCP servers, LSP servers, and background monitors. -**Common mistake** : Don’t put `commands/`, `agents/`, `skills/`, or `hooks/` inside the `.claude-plugin/` directory. Only `plugin.json` goes inside `.claude-plugin/`. All other directories must be at the plugin root level.The plugin root is the individual plugin’s own directory: the one containing `.claude-plugin/plugin.json`. It is never `~/.claude/`. For example, Claude Code doesn’t read a `.mcp.json` placed at `~/.claude/.mcp.json`. +**Common mistake** : Don’t put `commands/`, `agents/`, `skills/`, or `hooks/` inside the `.claude-plugin/` directory. Only `plugin.json` goes inside `.claude-plugin/`. All other directories must be at the plugin root level.The plugin root is the individual plugin’s own directory: the one you pass to `--plugin-dir` or that contains `.claude-plugin/plugin.json`. It is never `~/.claude/`. For example, Claude Code doesn’t read a `.mcp.json` placed at `~/.claude/.mcp.json`. Directory| Location| Purpose ---|---|---
modified
--- a/plugins.md +++ b/plugins.md @@ -475,7 +475,7 @@ Hooks in `settings.json`| Hooks in `hooks/hooks.json` Must manually copy to share| Install with `/plugin install` -After migrating, remove the original files from `.claude/` to avoid duplicates. Project and user `.claude/agents/` definitions override same-named plugin agents, so the plugin version only takes effect once the originals are removed. +After migrating, remove the original files from `.claude/` to avoid duplicates. Project and user `.claude/agents/` definitions override same-named plugin agents, so the plugin version only takes effect once the originals are removed. Plugin skills are namespaced as `/plugin-name:skill-name`, so the original `/skill-name` and the plugin copy both remain available rather than one overriding the other. ##
modified
--- a/plugins.md +++ b/plugins.md @@ -179,7 +179,7 @@ You’ve created a plugin with a skill, but plugins can include much more: custom agents, hooks, MCP servers, LSP servers, and background monitors. -**Common mistake** : Don’t put `commands/`, `agents/`, `skills/`, or `hooks/` inside the `.claude-plugin/` directory. Only `plugin.json` goes inside `.claude-plugin/`. All other directories must be at the plugin root level. +**Common mistake** : Don’t put `commands/`, `agents/`, `skills/`, or `hooks/` inside the `.claude-plugin/` directory. Only `plugin.json` goes inside `.claude-plugin/`. All other directories must be at the plugin root level.The plugin root is the individual plugin’s own directory: the one containing `.claude-plugin/plugin.json`. It is never `~/.claude/`. For example, Claude Code doesn’t read a `.mcp.json` placed at `~/.claude/.mcp.json`. Directory| Location| Purpose ---|---|---
modified
--- a/plugins.md +++ b/plugins.md @@ -58,9 +58,11 @@ Create the plugin directory -Every plugin lives in its own directory containing your skills, agents, or hooks, optionally alongside a `.claude-plugin/plugin.json` manifest. Create one now: +Every plugin lives in its own directory containing your skills, agents, or hooks, optionally alongside a `.claude-plugin/plugin.json` manifest. The location doesn’t matter for this quickstart because you’ll point Claude Code at the directory with `--plugin-dir` in the test step. Create it anywhere convenient, such as a scratch folder or a projects directory: mkdir my-first-plugin + +The remaining steps run from the parent directory and reference paths like `my-first-plugin/...` relative to it. 2 @@ -318,7 +320,7 @@ When a `--plugin-dir` plugin has the same name as an installed marketplace plugin, the local copy takes precedence for that session. This lets you test changes to a plugin you already have installed without uninstalling it first. The exception is plugins that managed settings force-enable or force-disable: `--plugin-dir` cannot override those. As you make changes to your plugin, run `/reload-plugins` to pick up the updates without restarting. This reloads plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Test your plugin components: * Try your skills with `/plugin-name:skill-name` - * Check that agents appear in `/agents` + * Check that agents appear in `/context` under Custom Agents, or @-mention one by its scoped name * Verify hooks work as expected You can load multiple plugins at once by specifying the flag multiple times: @@ -398,7 +400,7 @@ Create the plugin structure -Create a new plugin directory: +Create a new plugin directory in your project root, alongside the existing `.claude/` folder, so the relative `cp` paths in the next step resolve: mkdir -p my-plugin/.claude-plugin @@ -458,7 +460,7 @@ claude --plugin-dir ./my-plugin -Test each component: run your commands, check agents appear in `/agents`, and verify hooks trigger correctly. +Test each component: run your commands, check that agents appear in `/context`, and verify hooks trigger correctly. ###
modified
--- a/plugins.md +++ b/plugins.md @@ -368,15 +368,15 @@ Anthropic maintains two public marketplaces for Claude Code plugins: - * **`claude-plugins-official`** : a curated set of plugins maintained by Anthropic. Available automatically in every Claude Code installation. + * **`claude-plugins-official`** : a curated set of plugins maintained by Anthropic. Registered automatically the first time you start Claude Code interactively. A non-interactive script that runs before that first launch must add it explicitly with `claude plugin marketplace add anthropics/claude-plugins-official`. * **`claude-community`** : the public community marketplace where third-party submissions land after review. Users add it with `/plugin marketplace add anthropics/claude-plugins-community` and install from it as `@claude-community`. To submit your plugin for community-marketplace review, use one of the in-app forms: - * **Claude.ai** : [claude.ai/settings/plugins/submit](<https://claude.ai/settings/plugins/submit>) + * **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>) -Run `claude plugin validate` locally before you submit. The review pipeline runs the same check on every submission, along with automated safety screening. Approved plugins are pinned to a specific commit SHA in the [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>) catalog, and CI bumps the pin automatically as you push new commits to your repository. The public catalog syncs nightly from the review pipeline, so there can be a delay between approval 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`, is curated separately. Anthropic decides which plugins to include at its discretion. There is no application process, and the submission form does not add plugins to the official marketplace. If Anthropic lists your plugin in the official marketplace, your CLI can prompt Claude Code users to install it. See [Recommend your plugin from your CLI](</docs/en/plugin-hints>). +The claude.ai form requires a Team or Enterprise organization and directory management access; organization Owners have this access by default. Individual authors who aren’t part of a Team or Enterprise organization can use the Console form instead. Run `claude plugin validate` locally before you submit. The review pipeline runs the same check on every submission, along with automated safety screening. Approved plugins are pinned to a specific commit SHA in the [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>) catalog, and CI bumps the pin automatically as you push new commits to your repository. The public catalog syncs nightly from the review pipeline, so there can be a delay between approval 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`, is curated separately. Anthropic decides which plugins to include at its discretion. There is no application process, and the submission form does not add plugins to the official marketplace. If Anthropic lists your plugin in the official marketplace, your CLI can prompt Claude Code users to install it. See [Recommend your plugin from your CLI](</docs/en/plugin-hints>). For complete technical specifications, debugging techniques, and distribution strategies, see [Plugins reference](</docs/en/plugins-reference>).
modified
--- a/plugins.md +++ b/plugins.md @@ -192,6 +192,8 @@ `bin/`| Plugin root| Executables added to the Bash tool’s `PATH` while the plugin is enabled `settings.json`| Plugin root| Default [settings](</docs/en/settings>) applied when the plugin is enabled +A plugin that ships exactly one skill can place `SKILL.md` directly at the plugin root instead of creating a `skills/` directory. Claude Code loads it as a single skill and uses the frontmatter `name` field for the invocation name. Use the `skills/` layout for plugins that may grow to more than one skill. + **Next steps** : Ready to add more features? Jump to Develop more complex plugins to add agents, hooks, MCP servers, and LSP servers. For complete technical specifications of all plugin components, see [Plugins reference](</docs/en/plugins-reference>). ## @@ -471,7 +473,7 @@ Hooks in `settings.json`| Hooks in `hooks/hooks.json` Must manually copy to share| Install with `/plugin install` -After migrating, you can remove the original files from `.claude/` to avoid duplicates. The plugin version will take precedence when loaded. +After migrating, remove the original files from `.claude/` to avoid duplicates. Project and user `.claude/agents/` definitions override same-named plugin agents, so the plugin version only takes effect once the originals are removed. ##
modified
--- a/plugins.md +++ b/plugins.md @@ -1,9 +1,3 @@ -> ## Documentation Index -> -> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> -> -> Use this file to discover all available pages before exploring further. - Plugins let you extend Claude Code with custom functionality that can be shared across projects and teams. This guide covers creating your own plugins with skills, agents, hooks, and MCP servers. Looking to install existing plugins? See [Discover and install plugins](</docs/en/discover-plugins>). For complete technical specifications, see [Plugins reference](</docs/en/plugins-reference>). ##
modified
--- a/plugins.md +++ b/plugins.md @@ -17,7 +17,7 @@ Approach| Skill names| Best for ---|---|--- **Standalone** (`.claude/` directory)| `/hello`| Personal workflows, project-specific customizations, quick experiments -**Plugins** (directories with `.claude-plugin/plugin.json`)| `/plugin-name:hello`| Sharing with teammates, distributing to community, versioned releases, reusable across projects +**Plugins** (self-contained directories with skills, agents, hooks, or a `.claude-plugin/plugin.json` manifest)| `/plugin-name:hello`| Sharing with teammates, distributing to community, versioned releases, reusable across projects **Use standalone configuration when** : @@ -64,7 +64,7 @@ Create the plugin directory -Every plugin lives in its own directory containing a manifest and your skills, agents, or hooks. Create one now: +Every plugin lives in its own directory containing your skills, agents, or hooks, optionally alongside a `.claude-plugin/plugin.json` manifest. Create one now: mkdir my-first-plugin
modified
--- a/plugins.md +++ b/plugins.md @@ -162,6 +162,18 @@ * **Skill arguments** (`$ARGUMENTS`): captures user input for dynamic behavior The `--plugin-dir` flag is useful for development and testing. When you’re ready to share your plugin with others, see [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>). + +## + +​ + +Develop a plugin in your skills directory + +Instead of passing `--plugin-dir` on every launch, you can keep a plugin in your skills directory and have Claude Code load it automatically. `claude plugin init` scaffolds one: + + claude plugin init my-tool + +This creates `~/.claude/skills/my-tool/` with a `.claude-plugin/plugin.json` manifest and a starter `SKILL.md`. On the next session it loads as `my-tool@skills-dir` with no marketplace or install step. For the auto-load rules, personal vs. project scope, the workspace-trust requirement, and how to update or remove one, see [Skills-directory plugins](</docs/en/plugins-reference#skills-directory-plugins>). ##
modified
--- a/plugins.md +++ b/plugins.md @@ -356,14 +356,19 @@ ​ -Submit your plugin to the official marketplace - -To submit a plugin to the official Anthropic marketplace, use one of the in-app submission forms: +Submit your plugin to the community marketplace + +Anthropic maintains two public marketplaces for Claude Code plugins: + + * **`claude-plugins-official`** : a curated set of plugins maintained by Anthropic. Available automatically in every Claude Code installation. + * **`claude-community`** : the public community marketplace where third-party submissions land after review. Users add it with `/plugin marketplace add anthropics/claude-plugins-community` and install from it as `@claude-community`. + +To submit your plugin for community-marketplace review, use one of the in-app forms: * **Claude.ai** : [claude.ai/settings/plugins/submit](<https://claude.ai/settings/plugins/submit>) * **Console** : [platform.claude.com/plugins/submit](<https://platform.claude.com/plugins/submit>) -Once your plugin is listed, you can have your own CLI prompt Claude Code users to install it. See [Recommend your plugin from your CLI](</docs/en/plugin-hints>). +Run `claude plugin validate` locally before you submit. The review pipeline runs the same check on every submission, along with automated safety screening. Approved plugins are pinned to a specific commit SHA in the [`anthropics/claude-plugins-community`](<https://github.com/anthropics/claude-plugins-community>) catalog, and CI bumps the pin automatically as you push new commits to your repository. The public catalog syncs nightly from the review pipeline, so there can be a delay between approval 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`, is curated separately. Anthropic decides which plugins to include at its discretion. There is no application process, and the submission form does not add plugins to the official marketplace. If Anthropic lists your plugin in the official marketplace, your CLI can prompt Claude Code users to install it. See [Recommend your plugin from your CLI](</docs/en/plugin-hints>). For complete technical specifications, debugging techniques, and distribution strategies, see [Plugins reference](</docs/en/plugins-reference>).
modified
--- a/plugins.md +++ b/plugins.md @@ -307,7 +307,7 @@ claude --plugin-dir ./my-plugin.zip -When a `--plugin-dir` plugin has the same name as an installed marketplace plugin, the local copy takes precedence for that session. This lets you test changes to a plugin you already have installed without uninstalling it first. Marketplace plugins force-enabled by managed settings are the only exception and cannot be overridden. As you make changes to your plugin, run `/reload-plugins` to pick up the updates without restarting. This reloads plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Test your plugin components: +When a `--plugin-dir` plugin has the same name as an installed marketplace plugin, the local copy takes precedence for that session. This lets you test changes to a plugin you already have installed without uninstalling it first. The exception is plugins that managed settings force-enable or force-disable: `--plugin-dir` cannot override those. As you make changes to your plugin, run `/reload-plugins` to pick up the updates without restarting. This reloads plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Test your plugin components: * Try your skills with `/plugin-name:skill-name` * Check that agents appear in `/agents`
modified
--- a/plugins.md +++ b/plugins.md @@ -303,6 +303,10 @@ claude --plugin-dir ./my-plugin +The flag also accepts a `.zip` archive of the plugin directory, which requires Claude Code v2.1.128 or later. + + claude --plugin-dir ./my-plugin.zip + When a `--plugin-dir` plugin has the same name as an installed marketplace plugin, the local copy takes precedence for that session. This lets you test changes to a plugin you already have installed without uninstalling it first. Marketplace plugins force-enabled by managed settings are the only exception and cannot be overridden. As you make changes to your plugin, run `/reload-plugins` to pick up the updates without restarting. This reloads plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Test your plugin components: * Try your skills with `/plugin-name:skill-name`
modified
--- a/plugins.md +++ b/plugins.md @@ -313,9 +313,13 @@ claude --plugin-dir ./plugin-one --plugin-dir ./plugin-two -To test a plugin that is already packaged as a `.zip` archive and hosted at a URL, such as a CI build artifact, use `--plugin-url` instead. Claude Code fetches the archive at startup and loads it for that session only. If the fetch fails or the archive is invalid, Claude Code reports a plugin load error and starts without it. The same [trust considerations](</docs/en/discover-plugins#security>) apply as for any plugin source: only point this flag at archives you control or trust. - - claude --plugin-url https://example.com/my-plugin.zip +To test a plugin that is already packaged as a `.zip` archive and hosted at a URL, such as a CI build artifact, use `--plugin-url` instead. Claude Code fetches the archive at startup and loads it for that session only. If the fetch fails or the archive is invalid, Claude Code reports a plugin load error and starts without it. The same [trust considerations](</docs/en/discover-plugins#security>) apply as for any plugin source: only point this flag at archives you control or trust. To load multiple plugins, repeat the flag for each URL: + + claude --plugin-url https://example.com/my-plugin.zip --plugin-url https://example.com/other.zip + +Or pass space-separated URLs as one quoted argument: + + claude --plugin-url "https://example.com/my-plugin.zip https://example.com/other.zip" ###
modified
--- a/plugins.md +++ b/plugins.md @@ -313,6 +313,10 @@ claude --plugin-dir ./plugin-one --plugin-dir ./plugin-two +To test a plugin that is already packaged as a `.zip` archive and hosted at a URL, such as a CI build artifact, use `--plugin-url` instead. Claude Code fetches the archive at startup and loads it for that session only. If the fetch fails or the archive is invalid, Claude Code reports a plugin load error and starts without it. The same [trust considerations](</docs/en/discover-plugins#security>) apply as for any plugin source: only point this flag at archives you control or trust. + + claude --plugin-url https://example.com/my-plugin.zip + ### ​
modified
--- a/plugins.md +++ b/plugins.md @@ -1,3 +1,9 @@ +> ## Documentation Index +> +> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> +> +> Use this file to discover all available pages before exploring further. + Plugins let you extend Claude Code with custom functionality that can be shared across projects and teams. This guide covers creating your own plugins with skills, agents, hooks, and MCP servers. Looking to install existing plugins? See [Discover and install plugins](</docs/en/discover-plugins>). For complete technical specifications, see [Plugins reference](</docs/en/plugins-reference>). ## @@ -332,7 +338,7 @@ 3. **Create or use a marketplace** : Distribute through [plugin marketplaces](</docs/en/plugin-marketplaces>) for installation 4. **Test with others** : Have team members test the plugin before wider distribution -Once your plugin is in a marketplace, others can install it using the instructions in [Discover and install plugins](</docs/en/discover-plugins>). +Once your plugin is in a marketplace, others can install it using the instructions in [Discover and install plugins](</docs/en/discover-plugins>). To keep a plugin internal to your team, host the marketplace in a [private repository](</docs/en/plugin-marketplaces#private-repositories>). ###
modified
--- a/plugins.md +++ b/plugins.md @@ -87,7 +87,7 @@ ---|--- `name`| Unique identifier and skill namespace. Skills are prefixed with this (e.g., `/my-first-plugin:hello`). `description`| Shown in the plugin manager when browsing or installing plugins. -`version`| Track releases using [semantic versioning](</docs/en/plugins-reference#version-management>). +`version`| Optional. If set, users only receive updates when you bump this field. If omitted and your plugin is distributed via git, the commit SHA is used and every commit counts as a new version. See [version management](</docs/en/plugins-reference#version-management>). `author`| Optional. Helpful for attribution. For additional fields like `homepage`, `repository`, and `license`, see the [full manifest schema](</docs/en/plugins-reference#plugin-manifest-schema>). @@ -328,7 +328,7 @@ When your plugin is ready to share: 1. **Add documentation** : Include a `README.md` with installation and usage instructions - 2. **Version your plugin** : Use [semantic versioning](</docs/en/plugins-reference#version-management>) in your `plugin.json` + 2. **Choose a versioning strategy** : Decide whether to set an explicit `version` or rely on the git commit SHA. See [version management](</docs/en/plugins-reference#version-management>) 3. **Create or use a marketplace** : Distribute through [plugin marketplaces](</docs/en/plugin-marketplaces>) for installation 4. **Test with others** : Have team members test the plugin before wider distribution
modified
--- a/plugins.md +++ b/plugins.md @@ -163,7 +163,7 @@ Plugin structure overview -You’ve created a plugin with a skill, but plugins can include much more: custom agents, hooks, MCP servers, and LSP servers. +You’ve created a plugin with a skill, but plugins can include much more: custom agents, hooks, MCP servers, LSP servers, and background monitors. **Common mistake** : Don’t put `commands/`, `agents/`, `skills/`, or `hooks/` inside the `.claude-plugin/` directory. Only `plugin.json` goes inside `.claude-plugin/`. All other directories must be at the plugin root level. @@ -176,6 +176,7 @@ `hooks/`| Plugin root| Event handlers in `hooks.json` `.mcp.json`| Plugin root| MCP server configurations `.lsp.json`| Plugin root| LSP server configurations for code intelligence +`monitors/`| Plugin root| Background monitor configurations in `monitors.json` `bin/`| Plugin root| Executables added to the Bash tool’s `PATH` while the plugin is enabled `settings.json`| Plugin root| Default [settings](</docs/en/settings>) applied when the plugin is enabled @@ -246,6 +247,26 @@ ​ +Add background monitors to your plugin + +Background monitors let your plugin watch logs, files, or external status in the background and notify Claude as events arrive. Claude Code starts each monitor automatically when the plugin is active, so you don’t need to instruct Claude to start the watch. Add a `monitors/monitors.json` file at the plugin root with an array of monitor entries: + +monitors/monitors.json + + [ + { + "name": "error-log", + "command": "tail -F ./logs/error.log", + "description": "Application error log" + } + ] + +Each stdout line from `command` is delivered to Claude as a notification during the session. For the full schema, including the `when` trigger and variable substitution, see [Monitors](</docs/en/plugins-reference#monitors>). + +### + +​ + Ship default settings with your plugin Plugins can include a `settings.json` file at the plugin root to apply default configuration when the plugin is enabled. Currently, only the `agent` and `subagentStatusLine` keys are supported. Setting `agent` activates one of the plugin’s [custom agents](</docs/en/sub-agents>) as the main thread, applying its system prompt, tool restrictions, and model. This lets a plugin change how Claude Code behaves by default when enabled. @@ -323,6 +344,8 @@ * **Claude.ai** : [claude.ai/settings/plugins/submit](<https://claude.ai/settings/plugins/submit>) * **Console** : [platform.claude.com/plugins/submit](<https://platform.claude.com/plugins/submit>) + +Once your plugin is listed, you can have your own CLI prompt Claude Code users to install it. See [Recommend your plugin from your CLI](</docs/en/plugin-hints>). For complete technical specifications, debugging techniques, and distribution strategies, see [Plugins reference](</docs/en/plugins-reference>).
modified
--- a/plugins.md +++ b/plugins.md @@ -204,10 +204,9 @@ └── code-review/ └── SKILL.md -Each `SKILL.md` needs frontmatter with `name` and `description` fields, followed by instructions: - - --- - name: code-review +Each `SKILL.md` contains YAML frontmatter and instructions. Include a `description` so Claude knows when to use the skill: + + --- description: Reviews code for best practices and potential issues. Use when reviewing code, checking PRs, or analyzing code quality. ---
modified
--- a/plugins.md +++ b/plugins.md @@ -249,7 +249,7 @@ Ship default settings with your plugin -Plugins can include a `settings.json` file at the plugin root to apply default configuration when the plugin is enabled. Currently, only the `agent` key is supported. Setting `agent` activates one of the plugin’s [custom agents](</docs/en/sub-agents>) as the main thread, applying its system prompt, tool restrictions, and model. This lets a plugin change how Claude Code behaves by default when enabled. +Plugins can include a `settings.json` file at the plugin root to apply default configuration when the plugin is enabled. Currently, only the `agent` and `subagentStatusLine` keys are supported. Setting `agent` activates one of the plugin’s [custom agents](</docs/en/sub-agents>) as the main thread, applying its system prompt, tool restrictions, and model. This lets a plugin change how Claude Code behaves by default when enabled. settings.json
modified
--- a/plugins.md +++ b/plugins.md @@ -170,9 +170,9 @@ Directory| Location| Purpose ---|---|--- `.claude-plugin/`| Plugin root| Contains `plugin.json` manifest (optional if components use default locations) -`commands/`| Plugin root| Skills as Markdown files +`skills/`| Plugin root| Skills as `<name>/SKILL.md` directories +`commands/`| Plugin root| Skills as flat Markdown files. Use `skills/` for new plugins `agents/`| Plugin root| Custom agent definitions -`skills/`| Plugin root| Agent Skills with `SKILL.md` files `hooks/`| Plugin root| Event handlers in `hooks.json` `.mcp.json`| Plugin root| MCP server configurations `.lsp.json`| Plugin root| LSP server configurations for code intelligence @@ -296,7 +296,7 @@ If your plugin isn’t working as expected: 1. **Check the structure** : Ensure your directories are at the plugin root, not inside `.claude-plugin/` - 2. **Test components individually** : Check each command, agent, and hook separately + 2. **Test components individually** : Check each skill, agent, and hook separately 3. **Use validation and debugging tools** : See [Debugging and development tools](</docs/en/plugins-reference#debugging-and-development-tools>) for CLI commands and troubleshooting techniques ###
modified
--- a/plugins.md +++ b/plugins.md @@ -75,12 +75,12 @@ 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" - } + "name": "my-first-plugin", + "description": "A greeting plugin to learn the basics", + "version": "1.0.0", + "author": { + "name": "Your Name" + } } Field| Purpose
modified
--- a/plugins.md +++ b/plugins.md @@ -176,6 +176,7 @@ `hooks/`| Plugin root| Event handlers in `hooks.json` `.mcp.json`| Plugin root| MCP server configurations `.lsp.json`| Plugin root| LSP server configurations for code intelligence +`bin/`| Plugin root| Executables added to the Bash tool’s `PATH` while the plugin is enabled `settings.json`| Plugin root| Default [settings](</docs/en/settings>) applied when the plugin is enabled **Next steps** : Ready to add more features? Jump to Develop more complex plugins to add agents, hooks, MCP servers, and LSP servers. For complete technical specifications of all plugin components, see [Plugins reference](</docs/en/plugins-reference>).
modified
--- a/plugins.md +++ b/plugins.md @@ -45,7 +45,6 @@ Prerequisites * Claude Code [installed and authenticated](</docs/en/quickstart#step-1-install-claude-code>) - * Claude Code version 1.0.33 or later (run `claude --version` to check) If you don’t see the `/plugin` command, update Claude Code to the latest version. See [Troubleshooting](</docs/en/troubleshooting>) for upgrade instructions.
modified
Show diff (264 lines)
--- a/plugins.md +++ b/plugins.md @@ -61,12 +61,6 @@ Every plugin lives in its own directory containing a manifest and your skills, agents, or hooks. Create one now: -Report incorrect code - -Copy - -Ask AI - mkdir my-first-plugin 2 @@ -75,23 +69,11 @@ The manifest file at `.claude-plugin/plugin.json` defines your plugin’s identity: its name, description, and version. Claude Code uses this metadata to display your plugin in the plugin manager.Create the `.claude-plugin` directory inside your plugin folder: -Report incorrect code - -Copy - -Ask AI - mkdir my-first-plugin/.claude-plugin Then create `my-first-plugin/.claude-plugin/plugin.json` with this content: my-first-plugin/.claude-plugin/plugin.json - -Report incorrect code - -Copy - -Ask AI { "name": "my-first-plugin", @@ -117,23 +99,11 @@ Skills live in the `skills/` directory. Each skill is a folder containing a `SKILL.md` file. The folder name becomes the skill name, prefixed with the plugin’s namespace (`hello/` in a plugin named `my-first-plugin` creates `/my-first-plugin:hello`).Create a skill directory in your plugin folder: -Report incorrect code - -Copy - -Ask AI - 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 - -Report incorrect code - -Copy - -Ask AI --- description: Greet the user with a friendly message @@ -148,22 +118,10 @@ Run Claude Code with the `--plugin-dir` flag to load your plugin: -Report incorrect code - -Copy - -Ask AI - claude --plugin-dir ./my-first-plugin Once Claude Code starts, try your new skill: -Report incorrect code - -Copy - -Ask AI - /my-first-plugin:hello You’ll see Claude respond with a greeting. Run `/help` to see your skill listed under the plugin namespace. @@ -178,12 +136,6 @@ my-first-plugin/skills/hello/SKILL.md -Report incorrect code - -Copy - -Ask AI - --- description: Greet the user with a personalized message --- @@ -193,12 +145,6 @@ Greet the user named "$ARGUMENTS" warmly and ask how you can help them today. Make the greeting personal and encouraging. Run `/reload-plugins` to pick up the changes, then try the skill with your name: - -Report incorrect code - -Copy - -Ask AI /my-first-plugin:hello Alex @@ -251,12 +197,6 @@ Plugins can include [Agent Skills](</docs/en/skills>) to extend Claude’s capabilities. Skills are model-invoked: Claude automatically uses them based on the task context. Add a `skills/` directory at your plugin root with Skill folders containing `SKILL.md` files: -Report incorrect code - -Copy - -Ask AI - my-plugin/ ├── .claude-plugin/ │ └── plugin.json @@ -266,12 +206,6 @@ Each `SKILL.md` needs frontmatter with `name` and `description` fields, followed by instructions: -Report incorrect code - -Copy - -Ask AI - --- name: code-review description: Reviews code for best practices and potential issues. Use when reviewing code, checking PRs, or analyzing code quality. @@ -296,12 +230,6 @@ LSP (Language Server Protocol) plugins give Claude real-time code intelligence. If you need to support a language that doesn’t have an official LSP plugin, you can create your own by adding an `.lsp.json` file to your plugin: .lsp.json - -Report incorrect code - -Copy - -Ask AI { "go": { @@ -325,12 +253,6 @@ settings.json -Report incorrect code - -Copy - -Ask AI - { "agent": "security-reviewer" } @@ -352,12 +274,6 @@ Test your plugins locally Use the `--plugin-dir` flag to test plugins during development. This loads your plugin directly without requiring installation. - -Report incorrect code - -Copy - -Ask AI claude --plugin-dir ./my-plugin @@ -368,12 +284,6 @@ * Verify hooks work as expected You can load multiple plugins at once by specifying the flag multiple times: - -Report incorrect code - -Copy - -Ask AI claude --plugin-dir ./plugin-one --plugin-dir ./plugin-two @@ -437,23 +347,11 @@ Create a new plugin directory: -Report incorrect code - -Copy - -Ask AI - mkdir -p my-plugin/.claude-plugin Create the manifest file at `my-plugin/.claude-plugin/plugin.json`: my-plugin/.claude-plugin/plugin.json - -Report incorrect code - -Copy - -Ask AI { "name": "my-plugin", @@ -467,12 +365,6 @@ Copy your existing configurations to the plugin directory: -Report incorrect code - -Copy - -Ask AI - # Copy commands cp -r .claude/commands my-plugin/ @@ -488,23 +380,11 @@ If you have hooks in your settings, create a hooks directory: -Report incorrect code - -Copy - -Ask AI - mkdir my-plugin/hooks Create `my-plugin/hooks/hooks.json` with your hooks configuration. Copy the `hooks` object from your `.claude/settings.json` or `settings.local.json`, since the format is the same. The command receives hook input as JSON on stdin, so use `jq` to extract the file path: my-plugin/hooks/hooks.json - -Report incorrect code - -Copy - -Ask AI { "hooks": { @@ -523,12 +403,6 @@ Load your plugin to verify everything works: -Report incorrect code - -Copy - -Ask AI - claude --plugin-dir ./my-plugin Test each component: run your commands, check agents appear in `/agents`, and verify hooks trigger correctly.
modified
--- a/plugins.md +++ b/plugins.md @@ -168,7 +168,7 @@ You’ll see Claude respond with a greeting. Run `/help` to see your skill listed under the plugin namespace. -**Why namespacing?** Plugin skills are always namespaced (like `/greet:hello`) to prevent conflicts when multiple plugins have skills with the same name.To change the namespace prefix, update the `name` field in `plugin.json`. +**Why namespacing?** Plugin skills are always namespaced (like `/my-first-plugin:hello`) to prevent conflicts when multiple plugins have skills with the same name.To change the namespace prefix, update the `name` field in `plugin.json`. 5
added
Show diff (583 lines)
--- a/plugins.md +++ b/plugins.md @@ -0,0 +1,580 @@ +Plugins let you extend Claude Code with custom functionality that can be shared across projects and teams. This guide covers creating your own plugins with skills, agents, hooks, and MCP servers. Looking to install existing plugins? See [Discover and install plugins](</docs/en/discover-plugins>). For complete technical specifications, see [Plugins reference](</docs/en/plugins-reference>). + +## + +​ + +When to use plugins vs standalone configuration + +Claude Code supports two ways to add custom skills, agents, and hooks: + +Approach| Skill names| Best for +---|---|--- +**Standalone** (`.claude/` directory)| `/hello`| Personal workflows, project-specific customizations, quick experiments +**Plugins** (directories with `.claude-plugin/plugin.json`)| `/plugin-name:hello`| Sharing with teammates, distributing to community, versioned releases, reusable across projects + +**Use standalone configuration when** : + + * You’re customizing Claude Code for a single project + * The configuration is personal and doesn’t need to be shared + * You’re experimenting with skills or hooks before packaging them + * You want short skill names like `/hello` or `/deploy` + +**Use plugins when** : + + * You want to share functionality with your team or community + * You need the same skills/agents across multiple projects + * You want version control and easy updates for your extensions + * You’re distributing through a marketplace + * You’re okay with namespaced skills like `/my-plugin:hello` (namespacing prevents conflicts between plugins) + +Start with standalone configuration in `.claude/` for quick iteration, then convert to a plugin when you’re ready to share. + +## + +​ + +Quickstart + +This quickstart walks you through creating a plugin with a custom skill. You’ll create a manifest (the configuration file that defines your plugin), add a skill, and test it locally using the `--plugin-dir` flag. + +### + +​ + +Prerequisites + + * Claude Code [installed and authenticated](</docs/en/quickstart#step-1-install-claude-code>) + * Claude Code version 1.0.33 or later (run `claude --version` to check) + +If you don’t see the `/plugin` command, update Claude Code to the latest version. See [Troubleshooting](</docs/en/troubleshooting>) for upgrade instructions. + +### + +​ + +Create your first plugin + +1 + +Create the plugin directory + +Every plugin lives in its own directory containing a manifest and your skills, agents, or hooks. Create one now: + +Report incorrect code + +Copy + +Ask AI + + mkdir my-first-plugin + +2 + +Create the plugin manifest + +The manifest file at `.claude-plugin/plugin.json` defines your plugin’s identity: its name, description, and version. Claude Code uses this metadata to display your plugin in the plugin manager.Create the `.claude-plugin` directory inside your plugin folder: + +Report incorrect code + +Copy + +Ask AI + + mkdir my-first-plugin/.claude-plugin + +Then create `my-first-plugin/.claude-plugin/plugin.json` with this content: + +my-first-plugin/.claude-plugin/plugin.json + +Report incorrect code + +Copy + +Ask AI + + { + "name": "my-first-plugin", + "description": "A greeting plugin to learn the basics", + "version": "1.0.0", + "author": { + "name": "Your Name" + } + } + +Field| Purpose +---|--- +`name`| Unique identifier and skill namespace. Skills are prefixed with this (e.g., `/my-first-plugin:hello`). +`description`| Shown in the plugin manager when browsing or installing plugins. +`version`| Track releases using [semantic versioning](</docs/en/plugins-reference#version-management>). +`author`| Optional. Helpful for attribution. + +For additional fields like `homepage`, `repository`, and `license`, see the [full manifest schema](</docs/en/plugins-reference#plugin-manifest-schema>). + +3 + +Add a skill + +Skills live in the `skills/` directory. Each skill is a folder containing a `SKILL.md` file. The folder name becomes the skill name, prefixed with the plugin’s namespace (`hello/` in a plugin named `my-first-plugin` creates `/my-first-plugin:hello`).Create a skill directory in your plugin folder: + +Report incorrect code + +Copy + +Ask AI + + 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 + +Report incorrect code + +Copy + +Ask AI + + --- + description: Greet the user with a friendly message + disable-model-invocation: true + --- + + Greet the user warmly and ask how you can help them today. + +4 + +Test your plugin + +Run Claude Code with the `--plugin-dir` flag to load your plugin: + +Report incorrect code + +Copy + +Ask AI + + claude --plugin-dir ./my-first-plugin + +Once Claude Code starts, try your new skill: + +Report incorrect code + +Copy + +Ask AI + + /my-first-plugin:hello + +You’ll see Claude respond with a greeting. Run `/help` to see your skill listed under the plugin namespace. + +**Why namespacing?** Plugin skills are always namespaced (like `/greet:hello`) to prevent conflicts when multiple plugins have skills with the same name.To change the namespace prefix, update the `name` field in `plugin.json`. + +5 + +Add skill arguments + +Make your skill dynamic by accepting user input. The `$ARGUMENTS` placeholder captures any text the user provides after the skill name.Update your `SKILL.md` file: + +my-first-plugin/skills/hello/SKILL.md + +Report incorrect code + +Copy + +Ask AI + + --- + description: Greet the user with a personalized message + --- + + # Hello Skill + + Greet the user named "$ARGUMENTS" warmly and ask how you can help them today. Make the greeting personal and encouraging. + +Run `/reload-plugins` to pick up the changes, then try the skill with your name: + +Report incorrect code + +Copy + +Ask AI + + /my-first-plugin:hello Alex + +Claude will greet you by name. For more on passing arguments to skills, see [Skills](</docs/en/skills#pass-arguments-to-skills>). + +You’ve successfully created and tested a plugin with these key components: + + * **Plugin manifest** (`.claude-plugin/plugin.json`): describes your plugin’s metadata + * **Skills directory** (`skills/`): contains your custom skills + * **Skill arguments** (`$ARGUMENTS`): captures user input for dynamic behavior + +The `--plugin-dir` flag is useful for development and testing. When you’re ready to share your plugin with others, see [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>). + +## + +​ + +Plugin structure overview + +You’ve created a plugin with a skill, but plugins can include much more: custom agents, hooks, MCP servers, and LSP servers. + +**Common mistake** : Don’t put `commands/`, `agents/`, `skills/`, or `hooks/` inside the `.claude-plugin/` directory. Only `plugin.json` goes inside `.claude-plugin/`. All other directories must be at the plugin root level. + +Directory| Location| Purpose +---|---|--- +`.claude-plugin/`| Plugin root| Contains `plugin.json` manifest (optional if components use default locations) +`commands/`| Plugin root| Skills as Markdown files +`agents/`| Plugin root| Custom agent definitions +`skills/`| Plugin root| Agent Skills with `SKILL.md` files +`hooks/`| Plugin root| Event handlers in `hooks.json` +`.mcp.json`| Plugin root| MCP server configurations +`.lsp.json`| Plugin root| LSP server configurations for code intelligence +`settings.json`| Plugin root| Default [settings](</docs/en/settings>) applied when the plugin is enabled + +**Next steps** : Ready to add more features? Jump to Develop more complex plugins to add agents, hooks, MCP servers, and LSP servers. For complete technical specifications of all plugin components, see [Plugins reference](</docs/en/plugins-reference>). + +## + +​ + +Develop more complex plugins + +Once you’re comfortable with basic plugins, you can create more sophisticated extensions. + +### + +​ + +Add Skills to your plugin + +Plugins can include [Agent Skills](</docs/en/skills>) to extend Claude’s capabilities. Skills are model-invoked: Claude automatically uses them based on the task context. Add a `skills/` directory at your plugin root with Skill folders containing `SKILL.md` files: + +Report incorrect code + +Copy + +Ask AI + + my-plugin/ + ├── .claude-plugin/ + │ └── plugin.json + └── skills/ + └── code-review/ + └── SKILL.md + +Each `SKILL.md` needs frontmatter with `name` and `description` fields, followed by instructions: + +Report incorrect code + +Copy + +Ask AI + + --- + name: code-review + description: Reviews code for best practices and potential issues. Use when reviewing code, checking PRs, or analyzing code quality. + --- + + When reviewing code, check for: + 1. Code organization and structure + 2. Error handling + 3. Security concerns + 4. Test coverage + +After installing the plugin, run `/reload-plugins` to load the Skills. For complete Skill authoring guidance including progressive disclosure and tool restrictions, see [Agent Skills](</docs/en/skills>). + +### + +​ + +Add LSP servers to your plugin + +For common languages like TypeScript, Python, and Rust, install the pre-built LSP plugins from the official marketplace. Create custom LSP plugins only when you need support for languages not already covered. + +LSP (Language Server Protocol) plugins give Claude real-time code intelligence. If you need to support a language that doesn’t have an official LSP plugin, you can create your own by adding an `.lsp.json` file to your plugin: + +.lsp.json + +Report incorrect code + +Copy + +Ask AI + + { + "go": { + "command": "gopls", + "args": ["serve"], + "extensionToLanguage": { + ".go": "go" + } + } + } + +Users installing your plugin must have the language server binary installed on their machine. For complete LSP configuration options, see [LSP servers](</docs/en/plugins-reference#lsp-servers>). + +### + +​ + +Ship default settings with your plugin + +Plugins can include a `settings.json` file at the plugin root to apply default configuration when the plugin is enabled. Currently, only the `agent` key is supported. Setting `agent` activates one of the plugin’s [custom agents](</docs/en/sub-agents>) as the main thread, applying its system prompt, tool restrictions, and model. This lets a plugin change how Claude Code behaves by default when enabled. + +settings.json + +Report incorrect code + +Copy + +Ask AI + + { + "agent": "security-reviewer" + } + +This example activates the `security-reviewer` agent defined in the plugin’s `agents/` directory. Settings from `settings.json` take priority over `settings` declared in `plugin.json`. Unknown keys are silently ignored. + +### + +​ + +Organize complex plugins + +For plugins with many components, organize your directory structure by functionality. For complete directory layouts and organization patterns, see [Plugin directory structure](</docs/en/plugins-reference#plugin-directory-structure>). + +### + +​ + +Test your plugins locally + +Use the `--plugin-dir` flag to test plugins during development. This loads your plugin directly without requiring installation. + +Report incorrect code + +Copy + +Ask AI + + claude --plugin-dir ./my-plugin + +When a `--plugin-dir` plugin has the same name as an installed marketplace plugin, the local copy takes precedence for that session. This lets you test changes to a plugin you already have installed without uninstalling it first. Marketplace plugins force-enabled by managed settings are the only exception and cannot be overridden. As you make changes to your plugin, run `/reload-plugins` to pick up the updates without restarting. This reloads plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Test your plugin components: + + * Try your skills with `/plugin-name:skill-name` + * Check that agents appear in `/agents` + * Verify hooks work as expected + +You can load multiple plugins at once by specifying the flag multiple times: + +Report incorrect code + +Copy + +Ask AI + + claude --plugin-dir ./plugin-one --plugin-dir ./plugin-two + +### + +​ + +Debug plugin issues + +If your plugin isn’t working as expected: + + 1. **Check the structure** : Ensure your directories are at the plugin root, not inside `.claude-plugin/` + 2. **Test components individually** : Check each command, agent, and hook separately + 3. **Use validation and debugging tools** : See [Debugging and development tools](</docs/en/plugins-reference#debugging-and-development-tools>) for CLI commands and troubleshooting techniques + +### + +​ + +Share your plugins + +When your plugin is ready to share: + + 1. **Add documentation** : Include a `README.md` with installation and usage instructions + 2. **Version your plugin** : Use [semantic versioning](</docs/en/plugins-reference#version-management>) in your `plugin.json` + 3. **Create or use a marketplace** : Distribute through [plugin marketplaces](</docs/en/plugin-marketplaces>) for installation + 4. **Test with others** : Have team members test the plugin before wider distribution + +Once your plugin is in a marketplace, others can install it using the instructions in [Discover and install plugins](</docs/en/discover-plugins>). + +### + +​ + +Submit your plugin to the official marketplace + +To submit a plugin to the official Anthropic marketplace, use one of the in-app submission forms: + + * **Claude.ai** : [claude.ai/settings/plugins/submit](<https://claude.ai/settings/plugins/submit>) + * **Console** : [platform.claude.com/plugins/submit](<https://platform.claude.com/plugins/submit>) + +For complete technical specifications, debugging techniques, and distribution strategies, see [Plugins reference](</docs/en/plugins-reference>). + +## + +​ + +Convert existing configurations to plugins + +If you already have skills or hooks in your `.claude/` directory, you can convert them into a plugin for easier sharing and distribution. + +### + +​ + +Migration steps + +1 + +Create the plugin structure + +Create a new plugin directory: + +Report incorrect code + +Copy + +Ask AI + + mkdir -p my-plugin/.claude-plugin + +Create the manifest file at `my-plugin/.claude-plugin/plugin.json`: + +my-plugin/.claude-plugin/plugin.json + +Report incorrect code + +Copy + +Ask AI + + { + "name": "my-plugin", + "description": "Migrated from standalone configuration", + "version": "1.0.0" + } + +2 + +Copy your existing files + +Copy your existing configurations to the plugin directory: + +Report incorrect code + +Copy + +Ask AI + + # Copy commands + cp -r .claude/commands my-plugin/ + + # Copy agents (if any) + cp -r .claude/agents my-plugin/ + + # Copy skills (if any) + cp -r .claude/skills my-plugin/ + +3 + +Migrate hooks + +If you have hooks in your settings, create a hooks directory: + +Report incorrect code + +Copy + +Ask AI + + mkdir my-plugin/hooks + +Create `my-plugin/hooks/hooks.json` with your hooks configuration. Copy the `hooks` object from your `.claude/settings.json` or `settings.local.json`, since the format is the same. The command receives hook input as JSON on stdin, so use `jq` to extract the file path: + +my-plugin/hooks/hooks.json + +Report incorrect code + +Copy + +Ask AI + + { + "hooks": { + "PostToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [{ "type": "command", "command": "jq -r '.tool_input.file_path' | xargs npm run lint:fix" }] + } + ] + } + } + +4 + +Test your migrated plugin + +Load your plugin to verify everything works: + +Report incorrect code + +Copy + +Ask AI + + claude --plugin-dir ./my-plugin + +Test each component: run your commands, check agents appear in `/agents`, and verify hooks trigger correctly. + +### + +​ + +What changes when migrating + +Standalone (`.claude/`)| Plugin +---|--- +Only available in one project| Can be shared via marketplaces +Files in `.claude/commands/`| Files in `plugin-name/commands/` +Hooks in `settings.json`| Hooks in `hooks/hooks.json` +Must manually copy to share| Install with `/plugin install` + +After migrating, you can remove the original files from `.claude/` to avoid duplicates. The plugin version will take precedence when loaded. + +## + +​ + +Next steps + +Now that you understand Claude Code’s plugin system, here are suggested paths for different goals: + +### + +​ + +For plugin users + + * [Discover and install plugins](</docs/en/discover-plugins>): browse marketplaces and install plugins + * [Configure team marketplaces](</docs/en/discover-plugins#configure-team-marketplaces>): set up repository-level plugins for your team + +### + +​ + +For plugin developers + + * [Create and distribute a marketplace](</docs/en/plugin-marketplaces>): package and share your plugins + * [Plugins reference](</docs/en/plugins-reference>): complete technical specifications + * Dive deeper into specific plugin components: + * [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