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 |
- 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
/helloor/review
- 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)
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
- Claude Code version 1.0.33 or later (run
claude --versionto check)
If you don’t see the
/plugin command, update Claude Code to the latest version. See Troubleshooting for upgrade instructions.Create your first plugin
Create the plugin directory
Every plugin lives in its own directory containing a manifest and your skills, agents, or hooks. Create one now:
Create the plugin manifest
The manifest file at Then create
For additional fields like
.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:my-first-plugin/.claude-plugin/plugin.json with this content:my-first-plugin/.claude-plugin/plugin.json
| 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. |
author | Optional. Helpful for attribution. |
homepage, repository, and license, see the full manifest schema.Add a skill
Skills live in the Then create
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:my-first-plugin/skills/hello/SKILL.md with this content:my-first-plugin/skills/hello/SKILL.md
Test your plugin
Run Claude Code with the Once Claude Code starts, try your new command:You’ll see Claude respond with a greeting. Run
--plugin-dir flag to load your plugin:/help to see your command 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.Add skill arguments
Make your skill dynamic by accepting user input. The Restart Claude Code to pick up the changes, then try the command with your name:Claude will greet you by name. For more on passing arguments to skills, see Skills.
$ARGUMENTS placeholder captures any text the user provides after the skill name.Update your hello.md file:my-first-plugin/commands/hello.md
- Plugin manifest (
.claude-plugin/plugin.json): describes your plugin’s metadata - Commands directory (
commands/): contains your custom skills - Skill arguments (
$ARGUMENTS): captures user input for dynamic behavior
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.| 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 |
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.
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 askills/ directory at your plugin root with Skill folders containing SKILL.md files:
SKILL.md needs frontmatter with name and description fields, followed by instructions:
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
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.
- Try your commands with
/command-name - Check that agents appear in
/agents - Verify hooks work as expected
Debug plugin issues
If your plugin isn’t working as expected:- Check the structure: Ensure your directories are at the plugin root, not inside
.claude-plugin/ - Test components individually: Check each command, agent, and hook separately
- Use validation and debugging tools: See Debugging and development tools for CLI commands and troubleshooting techniques
Share your plugins
When your plugin is ready to share:- Add documentation: Include a
README.mdwith installation and usage instructions - Version your plugin: Use semantic versioning in your
plugin.json - Create or use a marketplace: Distribute through plugin marketplaces for installation
- Test with others: Have team members test the plugin before wider distribution
For complete technical specifications, debugging techniques, and distribution strategies, see 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
Create the plugin structure
Create a new plugin directory:Create the manifest file at
my-plugin/.claude-plugin/plugin.json:my-plugin/.claude-plugin/plugin.json
Migrate hooks
If you have hooks in your settings, create a hooks directory: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
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: browse marketplaces and install plugins
- Configure team marketplaces: set up repository-level plugins for your team
For plugin developers
- Create and distribute a marketplace: package and share your plugins
- Plugins reference: complete technical specifications
- Dive deeper into specific plugin components: