Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt Use this file to discover all available pages before exploring further.
Create custom plugins to extend Claude Code with skills, agents, hooks, and MCP servers.
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.
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
/helloor/review
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)
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.
- Claude Code installed and authenticated
- Claude Code version 1.0.33 or later (run
claude --versionto check)
```bash theme={null}
mkdir my-first-plugin
```
Create the `.claude-plugin` directory inside your plugin folder:
```bash theme={null}
mkdir my-first-plugin/.claude-plugin
```
Then create `my-first-plugin/.claude-plugin/plugin.json` with this content:
```json my-first-plugin/.claude-plugin/plugin.json theme={null}
{
"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](/en/plugins-reference#version-management). |
| `author` | Optional. Helpful for attribution. |
For additional fields like `homepage`, `repository`, and `license`, see the [full manifest schema](/en/plugins-reference#plugin-manifest-schema).
Create a skill directory in your plugin folder:
```bash theme={null}
mkdir -p my-first-plugin/skills/hello
```
Then create `my-first-plugin/skills/hello/SKILL.md` with this content:
```markdown my-first-plugin/skills/hello/SKILL.md theme={null}
---
description: Greet the user with a friendly message
disable-model-invocation: true
---
Greet the user warmly and ask how you can help them today.
```
```bash theme={null}
claude --plugin-dir ./my-first-plugin
```
Once Claude Code starts, try your new skill:
```shell theme={null}
/my-first-plugin:hello
```
You'll see Claude respond with a greeting. Run `/help` to see your skill listed under the plugin namespace.
<Note>
**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`.
</Note>
Update your `SKILL.md` file:
```markdown my-first-plugin/skills/hello/SKILL.md theme={null}
---
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.
```
Restart Claude Code to pick up the changes, then try the skill with your name:
```shell theme={null}
/my-first-plugin:hello Alex
```
Claude will greet you by name. For more on passing arguments to skills, see [Skills](/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
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 applied when the plugin is enabled |
Once you're comfortable with basic plugins, you can create more sophisticated extensions.
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:
my-plugin/
├── .claude-plugin/
│ └── plugin.json
└── skills/
└── code-review/
└── SKILL.md
Each SKILL.md needs frontmatter with name and description fields, followed by instructions:
---
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 coverageAfter installing the plugin, restart Claude Code to load the Skills. For complete Skill authoring guidance including progressive disclosure and tool restrictions, see Agent Skills.
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:
{
"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.
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 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.
{
"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.
For plugins with many components, organize your directory structure by functionality. For complete directory layouts and organization patterns, see Plugin directory structure.
Use the --plugin-dir flag to test plugins during development. This loads your plugin directly without requiring installation.
claude --plugin-dir ./my-pluginAs you make changes to your plugin, restart Claude Code to pick up the updates. Test your plugin components:
- Try your skills with
/plugin-name:skill-name - Check that agents appear in
/agents - Verify hooks work as expected
claude --plugin-dir ./plugin-one --plugin-dir ./plugin-twoIf 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
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
Once your plugin is in a marketplace, others can install it using the instructions in Discover and install plugins.
To submit a plugin to the official Anthropic marketplace, use one of the in-app submission forms:
- Claude.ai: claude.ai/settings/plugins/submit
- Console: platform.claude.com/plugins/submit
If you already have skills or hooks in your .claude/ directory, you can convert them into a plugin for easier sharing and distribution.
```bash theme={null}
mkdir -p my-plugin/.claude-plugin
```
Create the manifest file at `my-plugin/.claude-plugin/plugin.json`:
```json my-plugin/.claude-plugin/plugin.json theme={null}
{
"name": "my-plugin",
"description": "Migrated from standalone configuration",
"version": "1.0.0"
}
```
```bash theme={null}
# 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/
```
```bash theme={null}
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:
```json my-plugin/hooks/hooks.json theme={null}
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [{ "type": "command", "command": "jq -r '.tool_input.file_path' | xargs npm run lint:fix" }]
}
]
}
}
```
```bash theme={null}
claude --plugin-dir ./my-plugin
```
Test each component: run your commands, check agents appear in `/agents`, and verify hooks trigger correctly.
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 |
Now that you understand Claude Code's plugin system, here are suggested paths for different goals:
- Discover and install plugins: browse marketplaces and install plugins
- Configure team marketplaces: set up repository-level plugins for your team
- Create and distribute a marketplace: package and share your plugins
- Plugins reference: complete technical specifications
- Dive deeper into specific plugin components: