Claude Code Plugins
A plugin (Plugin) is Claude Code'shighest-level extension mechanism,used to package, version, share, and distribute capabilities such ascommands, agents, Skills, hooks, MCP, LSP。
Plugin = a collection of reusable Claude Code extension capabilities
A plugin can contain:
- Slash Commands
- Sub-agents (Agents)
- Skills (capability descriptions)
- Hooks (event hooks)
- MCP servers (external tools/services)
- LSP servers (code intelligence)
The core goal of plugins is only one:
Let Claude Code's capabilities be reused like a toolbox, rather than repeatedly configuring every project
Plugins vs Standalone Configuration (How to choose)
Claude Code supports two extension approaches:
| Method | Command form | Suitable scenarios |
|---|---|---|
Standalone configuration(.claude/) |
/hello |
Personal use, single project, rapid experimentation |
Plugin(.claude-plugin/) |
/plugin-name:hello |
Team sharing, cross-project, versioning |
When to use standalone configuration?
- Only used in the current project
- Personal workflow
- Experimental configurations not yet stable
- Want short command names (e.g.
/review)
When to use plugins?
- Toreuse across multiple projects
- Toshare with the team or community
- NeededVersion control, upgrade, rollback
- Plan to distribute through the marketplace
- Can accept namespaced commands (avoid conflicts)
Best practices:
First in
.claude/iterate → package as a plugin once stable
Minimal plugin structure (must remember)
my-plugin/
├── .claude-plugin/
│ └── plugin.json # 插件清单(必需)
├── commands/ # 斜杠命令
├── agents/ # 子代理
├── skills/ # Skills
├── hooks/ # 钩子
├── .mcp.json # MCP 配置
└── .lsp.json # LSP 配置
Important rules
.claude-plugin/directorycan only containplugin.json- Other directories must be in the plugin root directory
Plugin manifest (plugin.json)
The plugin's "ID card", determines:
- Plugin name
- Command namespace
- Version
- Author information
Example:
{
"name": "my-first-plugin",
"description": "A greeting plugin to learn the basics",
"version": "1.0.0",
"author": { "name": "Your Name" }
}
Key field descriptions:
| Field | Purpose |
|---|---|
| name | Unique identifier + command namespace |
| description | Displayed in the plugin marketplace |
| version | Semantic versioning |
| author | Optional, attribution description |
Slash commands (most commonly used plugin capability)
1. Command definition method
- is located in the
commands/directory - Each command = a Markdown file
- File name = command name
Example:
commands/hello.md
Corresponding command:
/my-first-plugin:hello
2. Command content example
---
description: Greet the user with a friendly message
---
Greet the user warmly and ask how you can help them today.
3. Command parameters
Use $ARGUMENTS Capture user input:
Greet the user named "$ARGUMENTS" warmly.
Call:
/my-first-plugin:hello Alex
Local plugin testing (essential for development)
Use --plugin-dir Directly load the plugin directory:
claude --plugin-dir ./my-plugin
Characteristics:
- No installation needed
- Need to restart Claude Code after modifications
- Supports loading multiple plugins simultaneously
claude --plugin-dir ./plugin-a --plugin-dir ./plugin-b
What else can plugins do
| Capability | Purpose |
|---|---|
| Commands | Custom slash commands |
| Agents | Dedicated sub-agents |
| Skills | Teach Claude when to use a certain capability |
| Hooks | Automation (execute commands after writing files, etc.) |
| MCP | Connect external services (GitHub, DB, API) |
| LSP | Code intelligence (navigation, type checking) |
Plugin Marketplace
Plugins are distributed throughMarket, essentially a repository of plugin directories.
Official marketplace
- Added by default
- Run
/plugin→ Discover

Install the plugin:
/plugin install plugin-name@claude-plugins-official
Plugin installation scope
| Range | Description |
|---|---|
| User scope | Only yourself, all projects |
| Project scope | Current repository, shared with team |
| Local scope | Current repository, only you |
Recommended:
- Team tools → Project scope
- Personal productivity tools → User scope
Typical plugin categories
1. Code intelligence (LSP)
- TypeScript, Python, Go, Rust, etc.
- Provide go-to-definition, references, type errors
Requires local installation of the corresponding language server
2. External integration (MCP)
- GitHub / GitLab
- Jira / Notion
- Slack / Figma
- Vercel / Supabase
Essence:Plugin = MCP server + configuration
3. Development workflow
- Git commit, PR
- Code review agent
- Plugin development tools
Common plugin management commands
/plugin # 打开插件管理器
/plugin install # 安装插件
/plugin uninstall # 卸载
/plugin enable/disable # 启用 / 禁用
/plugin marketplace add # 添加市场
/plugin marketplace rm # 移除市场
From the .claude/ Migrating to plugins (core approach)
| Before | After migration |
|---|---|
.claude/commands |
plugin/commands |
.claude/agents |
plugin/agents |
settings.json hooks |
plugin/hooks/hooks.json |
After migration:
- Plugin version takes precedence
- Can delete old
.claude/configuration to avoid duplication
When must you use plugins?
- You already havea stable Claude workflow
- You arerepeatedly copying
.claude/ - Team members start asking you: "How is this configured?"
- You want Claude to be as controllable as an IDE plugin
Plugins are the watershed taking Claude Code from a "personal AI assistant" to an "engineering tool"