Claude Code Docs

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. For complete technical specifications, see Plugins reference.

When to use plugins vs standalone configuration

Claude Code supports two ways to add custom skills, agents, and hooks:

ApproachSkill namesBest for
Standalone (.claude/ directory)/helloPersonal workflows, project-specific customizations, quick experiments
Plugins (self-contained directories with skills, agents, hooks, or a .claude-plugin/plugin.json manifest)/plugin-name:helloSharing with teammates, distributing to community, versioned releases, reusable across projects

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

Create your first plugin

1

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:

Then create my-first-plugin/.claude-plugin/plugin.json with this content:

my-first-plugin/.claude-plugin/plugin.json

FieldPurpose
nameUnique identifier and skill namespace. Skills are prefixed with this (e.g., /my-first-plugin:hello).
descriptionShown in the plugin manager when browsing or installing plugins.
versionOptional. If set, users only receive updates when you bump this field, except for a command source; see version management. If omitted, the version comes from the next source in version management.
authorOptional. Helpful for attribution.

For additional fields like homepage, repository, and license, see the full manifest schema.

3

4

5

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:

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.

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.

DirectoryLocationPurpose
.claude-plugin/Plugin rootContains plugin.json manifest (optional if components use default locations)
skills/Plugin rootSkills as <name>/SKILL.md directories
commands/Plugin rootSkills as flat Markdown files. Use skills/ for new plugins
agents/Plugin rootCustom agent definitions
hooks/Plugin rootEvent handlers in hooks.json
.mcp.jsonPlugin rootMCP server configurations
.lsp.jsonPlugin rootLSP server configurations for code intelligence
monitors/Plugin rootBackground monitor configurations in monitors.json
bin/Plugin rootExecutables added to the Bash tool’s PATH while the plugin is enabled
settings.jsonPlugin rootDefault 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.

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 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:

Each SKILL.md contains YAML frontmatter and instructions. Include a description so Claude knows when to use the skill:

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.

Add LSP servers to your plugin

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

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.

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

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.

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 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

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.

Test your plugins locally

Use the --plugin-dir flag to test plugins during development. This loads your plugin directly without requiring installation.

The flag also accepts a .zip archive of the plugin directory.

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

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 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:

Or pass space-separated URLs as one quoted argument:

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 for CLI commands and troubleshooting techniques

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.
  3. Create or use a marketplace: Distribute through 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. To keep a plugin internal to your team, host the marketplace in a private repository.

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 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:

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 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. 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.

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

2

3

4

What changes when migrating

Standalone (.claude/)Plugin
Only available in one projectCan be shared via marketplaces
Files in .claude/commands/Files in plugin-name/commands/
Hooks in settings.jsonHooks in hooks/hooks.json
Must manually copy to shareInstall with /plugin install

Next steps

Now that you understand Claude Code’s plugin system, here are suggested paths for different goals:

For plugin users

For plugin developers

Read the original on code.claude.com ↗