Complete reference for Claude Code plugins system (January 2026). Use when creating plugins, understanding plugin.json schema, marketplace configuration, bundling skills/commands/agents/hooks/MCP/LSP servers, plugin caching, validation, or distribution. Covers plugin components, directory structure, installation scopes, environment variables, CLI commands, debugging, and enterprise features.
Plugins extend Claude Code with skills, agents, hooks, MCP servers, and LSP servers. This reference provides complete technical specifications for creating and distributing plugins.
Plugins can include any combination of:
/name shortcuts (legacy; use skills instead)The plugin.json file in .claude-plugin/ defines your plugin's metadata and configuration.
{
"name": "plugin-name",
"version": "1.2.0",
"description": "Brief plugin description",
"author": {
"name": "Author Name",
"email": "author@example.com",
"url": "https://github.com/author"
},
"homepage": "https://docs.example.com/plugin",
"repository": "https://github.com/author/plugin",
"license": "MIT",
"keywords": ["keyword1", "keyword2"],
"commands": ["./custom/commands/special.md"],
"agents": "./custom/agents/",
"skills": "./custom/skills/",
"hooks": "./config/hooks.json",
"mcpServers": "./mcp-config.json",
"outputStyles": "./styles/",
"lspServers": "./.lsp.json"
}
| Field | Type | Description | Example |
| ------ | ------ | ----------------------------------------- | -------------------- |
| name | string | Unique identifier (kebab-case, no spaces) | "deployment-tools" |
| Field | Type | Description | Example |
| ------------- | ------ | ----------------------------------- | -------------------------------------------------- |
| version | string | Semantic version | "2.1.0" |
| description | string | Brief explanation of plugin purpose | "Deployment automation tools" |
| author | object | Author information | {"name": "Dev Team", "email": "dev@company.com"} |
| homepage | string | Documentation URL | "https://docs.example.com" |
| repository | string | Source code URL | "https://github.com/user/plugin" |
| license | string | License identifier | "MIT", "Apache-2.0" |
| keywords | array | Discovery tags | ["deployment", "ci-cd"] |
| Field | Type | Description | Example |
| -------------- | -------------- | ------------------------------------------------------------------------------ | -------------------------------------- |
| commands | string|array | Command files/directories — replaces the default commands/ | "./custom/cmd.md" or ["./cmd1.md"] |
| agents | array | Agent file paths — replaces the default agents/; must be an array of individual files, NOT a directory string | ["./agents/reviewer.md"] |
| skills | string|array | Additional skill directories — loaded alongside the default skills/ | "./custom/skills/" |
| hooks | string|object | Hook config path or inline config | "./hooks.json" |
| mcpServers | string|object | MCP config path or inline config | "./mcp-config.json" |
| outputStyles | string|array | Output style files/directories — replaces the default output-styles/ | "./styles/" |
| lspServers | string|object | Language Server Protocol config for code intelligence (go to definition, etc.) | "./.lsp.json" |
| monitors | string|array | Background monitor configurations — path to monitors.json or inline array | "./monitors/monitors.json" |
| userConfig | object | User-configurable values prompted at enable time; stored in keychain or settings | See User Config Reference |
| channels | array | Message channel declarations bound to MCP servers with per-channel user config | See User Config Reference |
Path behavior rules:
Whether a custom path replaces or extends the plugin's default directory depends on the field:
commands, agents, workflows, outputStyles, experimental.themes, experimental.monitors. Declaring the key stops the matching default directory being scanned. To keep the default and add more, list it explicitly: "commands": ["./commands/", "./extras/"]skills. The default skills/ directory is always scanned, and directories listed in skills load alongside it. Exception: for a marketplace entry whose source resolves to the marketplace root, declaring specific subdirectories replaces the default skills/ scan./agents field must ALWAYS be an array of individual file paths, never a directory stringSOURCE: Plugins reference — Path resolution (accessed 2026-09-13)
Common validation errors:
// CORRECT agents field
"agents": ["./agents/security-reviewer.md", "./agents/code-formatter.md"]
// INCORRECT - will fail validation
"agents": "./agents/"
"agents": "./custom/agents/"
enterprise-plugin/
├── .claude-plugin/ # Metadata directory
│ └── plugin.json # Required: plugin manifest
├── commands/ # Default command location
│ ├── status.md
│ └── logs.md
├── agents/ # Default agent location
│ ├── security-reviewer.md
│ ├── performance-tester.md
│ └── compliance-checker.md
├── skills/ # Agent Skills
│ ├── code-reviewer/
│ │ └── SKILL.md
│ └── pdf-processor/
│ ├── SKILL.md
│ └── scripts/
├── hooks/ # Hook configurations
│ ├── hooks.json # Main hook config
│ └── security-hooks.json # Additional hooks
├── .mcp.json # MCP server definitions
├── .lsp.json # LSP server configurations
├── scripts/ # Hook and utility scripts
│ ├── security-scan.sh
│ ├── format-code.py
│ └── deploy.js
├── LICENSE # License file
└── CHANGELOG.md # Version history
Critical: The .claude-plugin/ directory contains ONLY the plugin.json file. All other directories (commands/, agents/, skills/, hooks/) must be at the plugin root, not inside .claude-plugin/.
| Component | Default Location | Purpose |
| --------------- | ---------------------------- | ------------------------------------------ |
| Manifest | .claude-plugin/plugin.json | Required metadata file |
| Commands | commands/ | Skill Markdown files (legacy; use skills/) |
| Agents | agents/ | Subagent Markdown files |
| Skills | skills/ | Skills with <name>/SKILL.md structure |
| Hooks | hooks/hooks.json | Hook configuration |
| MCP servers | .mcp.json | MCP server definitions |
| LSP servers | .lsp.json | Language server configurations |
Plugins add skills to Claude Code, creating /name shortcuts that you or Claude can invoke.
Location: skills/ or commands/ directory in plugin root
Skill structure:
skills/
├── pdf-processor/
│ ├── SKILL.md
│ ├── reference.md (optional)
│ └── scripts/ (optional)
└── code-reviewer/
└── SKILL.md
Integration behavior:
Skill subdirectory warning — nested skill directories silently fail to register, with a wrong/right example; read before organizing related skills into grouping subdirectories.
Plugins can provide specialized subagents for specific tasks that Claude can invoke automatically when appropriate.
Location: agents/ directory in plugin root
File format: Markdown files with YAML frontmatter describing agent capabilities
Integration points:
/agents interfaceFor security reasons, certain frontmatter fields are silently ignored when present in plugin-shipped agents. These restrictions apply only to agents bundled inside a plugin (in agents/ or declared in plugin.json). They do not apply to directly-installed agents in ~/.claude/agents/ or .claude/agents/.
| Field | Status in plugin agents |
| ----- | ----------------------- |
| hooks | Silently ignored |
| mcpServers | Not supported |
| permissionMode | Not supported |
| isolation | Supported — valid value: "worktree" (provides isolated worktree environment for agent execution) |
SOURCE: Plugins Reference line 182 (accessed 2026-04-23)
isolation field example:
---
name: my-isolated-agent
description: Agent that runs in an isolated worktree
isolation: worktree
---
Setting isolation: "worktree" causes the agent to execute in a fresh worktree, preventing it from affecting the main working tree directly.
SOURCE: Plugins Reference line 183 (accessed 2026-04-23)
Plugins can provide event handlers that respond to Claude Code events automatically.
Location: hooks/hooks.json in plugin root, or inline in plugin.json
Format: JSON configuration with event matchers and actions
Hook configuration:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/format-code.sh"
}
]
}
]
}
}
Available events (representative examples — see the full list of hook events in the complete reference):
PreToolUse: Before Claude uses any toolPostToolUse: After Claude successfully uses any toolUserPromptSubmit: When user submits a promptSessionStart: At the beginning of sessionsSOURCE: Plugins Reference lines 211-265 (accessed 2026-04-23)
For the complete hook event catalog (all events, matchers, input schemas, exit code behavior), see hook events reference.
For hook types (command, prompt, agent, http) and their configuration options, see hook events reference.
Plugins can bundle Model Context Protocol (MCP) servers to connect Claude Code with external tools and services.
Location: .mcp.json in plugin root, or inline in plugin.json
Format: Standard MCP server configuration
MCP server configuration:
{
"mcpServers": {
"plugin-database": {
"command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server",
"args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"],
"env": {
"DB_PATH": "${CLAUDE_PLUGIN_ROOT}/data"
}
},
"plugin-api-client": {
"command": "npx",
"args": ["@company/mcp-server", "--plugin-mode"],
"cwd": "${CLAUDE_PLUGIN_ROOT}"
}
}
}
Integration behavior:
Plugins can provide Language Server Protocol (LSP) servers to give Claude real-time code intelligence while working on your codebase.
LSP integration provides:
Location: .lsp.json in plugin root, or inline in plugin.json
Format: JSON configuration mapping language server names to their configurations
.lsp.json file format:
{
"go": {
"command": "gopls",
"args": ["serve"],
"extensionToLanguage": {
".go": "go"
}
}
}
Inline in plugin.json:
{
"name": "my-plugin",
"lspServers": {
"go": {
"command": "gopls",
"args": ["serve"],
"extensionToLanguage": {
".go": "go"
}
}
}
}
Required fields:
| Field | Description |
| --------------------- | -------------------------------------------- |
| command | The LSP binary to execute (must be in PATH) |
| extensionToLanguage | Maps file extensions to language identifiers |
Optional fields:
| Field | Description |
| ----------------------- | --------------------------------------------------------- |
| args | Command-line arguments for the LSP server |
| transport | Communication transport: stdio (default) or socket |
| env | Environment variables to set when starting the server |
| initializationOptions | Options passed to the server during initialization |
| settings | Settings passed via workspace/didChangeConfiguration |
| workspaceFolder | Workspace folder path for the server |
| startupTimeout | Max time to wait for server startup (milliseconds) |
| shutdownTimeout | Max time to wait for graceful shutdown (milliseconds) |
| restartOnCrash | Whether to automatically restart the server if it crashes |
| maxRestarts | Maximum number of restart attempts before giving up |
Important: You must install the language server binary separately. LSP plugins configure how Claude Code connects to a language server, but they don't include the server itself.
Plugins can declare background monitor processes that run for the lifetime of a Claude Code session. Each line written to a monitor's stdout is delivered as a notification to Claude. Monitors require Claude Code v2.1.105 or later, run only in interactive CLI sessions, and execute unsandboxed at the same trust level as hooks.
For the complete monitors specification (schema, when field, variable substitution, constraints), see monitors reference.
SOURCE: Plugins Reference lines 1087-1132 (accessed 2026-04-23)
Available LSP plugins:
| Plugin | Language server | Install command |
| ---------------- | -------------------------- | ------------------------------------------------------------------------------------------ |
| pyright-lsp | Pyright (Python) | pip install pyright or npm install -g pyright |
| typescript-lsp | TypeScript Language Server | npm install -g typescript-language-server typescript |
| rust-lsp | rust-analyzer | See rust-analyzer installation |
For security and verification purposes, Claude Code copies plugins to a cache directory rather than using them in-place. Understanding this behavior is important when developing plugins that reference external files.
When you install a plugin, Claude Code copies the plugin files to a cache directory:
source field is copied recursively. For example, if your marketplace entry specifies "source": "./plugins/my-plugin", the entire ./plugins directory is copied..claude-plugin/plugin.json: The implicit root directory (the directory containing .claude-plugin/plugin.json) is copied recursively.Plugins cannot reference files outside their copied directory structure. Paths that traverse outside the plugin root (such as ../shared-utils) will not work after installation because those external files are not copied to the cache.
If your plugin needs to access files outside its directory, you have two options:
Option 1: Use symlinks
Create symbolic links to external files within your plugin directory. Symlinks are honored during the copy process:
# Inside your plugin directory
ln -s /path/to/shared-utils ./shared-utils
The symlinked content will be copied into the plugin cache.
Option 2: Restructure your marketplace
Set the plugin path to a parent directory that contains all required files, then provide the rest of the plugin manifest directly in the marketplace entry:
{
"name": "my-plugin",
"source": "./",
"description": "Plugin that needs root-level access",
"commands": ["./plugins/my-plugin/commands/"],
"agents": ["./plugins/my-plugin/agents/"],
"strict": false
}
This approach copies the entire marketplace root, giving your plugin access to sibling directories.
Note: Symlinks that point to locations outside the plugin's logical root are followed during copying. This provides flexibility while maintaining the security benefits of the caching system.
When you install a plugin, you choose a scope that determines where the plugin is available and who else can use it:
| Scope | Settings file | Use case |
| --------- | ----------------------------- | -------------------------------------------------------- |
| user | ~/.claude/settings.json | Personal plugins available across all projects (default) |
| project | .claude/settings.json | Team plugins shared via version control |
| local | .claude/settings.local.json | Project-specific plugins, gitignored |
| managed | managed-settings.json | Managed plugins (read-only, update only) |
${CLAUDE_PLUGIN_ROOT}: Contains the absolute path to your plugin directory. Use this in hooks, MCP servers, and scripts to ensure correct paths regardless of installation location.
{
"hooks": {
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/process.sh"
}
]
}
]
}
}
${CLAUDE_PROJECT_DIR}: Project root directory (where Claude Code was started).
${CLAUDE_PLUGIN_DATA}: Persistent plugin data directory that survives plugin updates. Path: ~/.claude/plugins/data/{id}/ where {id} is the plugin name with non-alphanumeric characters replaced by hyphens. Use for installed dependencies (node_modules, virtualenvs), generated code, and caches. Recommended pattern: store a manifest hash in this directory, check it on startup, and reinstall dependencies only when the manifest changes.
{
"mcpServers": {
"my-server": {
"command": "node",
"args": ["${CLAUDE_PLUGIN_DATA}/node_modules/.bin/my-server"]
}
}
}
SOURCE: Plugins Reference lines 1275-1318 (accessed 2026-04-23)
Create .claude-plugin/marketplace.json in your repository root:
{
"name": "company-tools",
"owner": {
"name": "DevTools Team",
"email": "devtools@example.com"
},
"plugins": [
{
"name": "code-formatter",
"source": "./plugins/formatter",
"description": "Automatic code formatting on save",
"version": "2.1.0",
"author": {
"name": "DevTools Team"
}
},
{
"name": "deployment-tools",
"source": {
"source": "github",
"repo": "company/deploy-plugin"
},
"description": "Deployment automation tools"
}
]
}
| Field | Type | Description | Example |
| --------- | ------ | ----------------------------------- | -------------- |
| name | string | Marketplace identifier (kebab-case) | "acme-tools" |
| owner | object | Marketplace maintainer information | |
| plugins | array | List of available plugins | |
Reserved names: claude-code-marketplace, claude-code-plugins, claude-plugins-official, anthropic-marketplace, anthropic-plugins, agent-skills, life-sciences are reserved for official Anthropic use.
For plugins in the same repository:
{
"name": "my-plugin",
"source": "./plugins/my-plugin"
}
Note: Relative paths only work when users add your marketplace via Git (GitHub, GitLab, or git URL). If users add your marketplace via a direct URL to the marketplace.json file, relative paths will not resolve correctly.
{
"name": "github-plugin",
"source": {
"source": "github",
"repo": "owner/plugin-repo"
}
}
You can pin to a specific branch, tag, or commit:
{
"name": "github-plugin",
"source": {
"source": "github",
"repo": "owner/plugin-repo",
"ref": "v2.0.0",
"sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"
}
}
| Field | Type | Description |
| ------ | ------ | --------------------------------------------------------------------- |
| repo | string | Required. GitHub reposit
npx skills add Jamie-BitFlight/克劳德-插件-参考-2026下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer