| title | Plugins Technical Reference | |||||
|---|---|---|---|---|---|---|
| category | reference | |||||
| target_platform | linux | |||||
| audience | ai_agent | |||||
| keywords |
|
| Component | Location | Purpose | Details |
|---|---|---|---|
| Skills | skills/ |
Domain knowledge | skills.md |
| Agents | agents/ |
Specialized assistants | sub-agents.md |
| Hooks | hooks/ |
Lifecycle events | hooks.md |
| MCP | .mcp.json |
External tools | mcp.md |
| LSP | .lsp.json |
Code intelligence | See below |
| Commands | commands/ |
User commands | Slash commands (see plugins.md) |
Location: .claude-plugin/plugin.json
The manifest uses Zod strict mode — unknown fields are rejected. Only the fields listed here are valid.
{
// Required
"name": string, // Unique ID (lowercase-hyphenated)
"version": string, // Semver (e.g., "1.0.0")
"description": string, // One-line summary
// Optional
"author": { // Author info
"name": string,
"url": string // or "email": string
},
"homepage": string // Plugin homepage URL
}MCP servers are configured in .mcp.json at plugin root (not in plugin.json).
LSP servers are configured in .lsp.json at plugin root (not in plugin.json).
- author: Object with
nameandurl(oremail). Plugin creator information. - homepage: String. URL to plugin documentation or repository.
{
"name": "my-plugin",
"version": "1.2.0",
"description": "One-line description of what this plugin does.",
"author": {
"name": "Your Name",
"url": "https://github.com/your-org"
},
"homepage": "https://github.com/your-org/your-repo/tree/main/plugins/my-plugin"
}Configure MCP servers in .mcp.json at plugin root (not inside .claude-plugin/):
{
"server-name": {
"command": "node",
"args": ["dist/server.js"]
}
}For npx-based servers:
{
"server-name": {
"command": "npx",
"args": ["-y", "@scope/package"]
}
}For HTTP servers:
{
"server-name": {
"type": "http",
"url": "https://api.example.com/mcp"
}
}Note: Plugin install does not run npm install. Dependencies must be pre-built or use npx.
See MCP for complete documentation on server types, authentication, and advanced configuration.
Language Server Protocol integrations give Claude code intelligence. Configure them in
manifest.json:
{
"lspServers": {
"typescript": {
"command": "typescript-language-server",
"args": ["--stdio"],
"filetypes": ["typescript", "typescriptreact", "javascript", "javascriptreact"]
}
}
}- command: String (required). The LSP server executable.
- args: Array of strings. Command-line arguments.
- filetypes: Array of strings. File extensions that trigger this server.
- rootPatterns: Array of strings. Files/directories that identify project root
(e.g.,
["package.json"]). - initializationOptions: Object. Server-specific initialization options.
- env: Object. Environment variables.
{
"lspServers": {
"python": {
"command": "pylsp",
"args": [],
"filetypes": ["python"],
"rootPatterns": ["pyproject.toml", "setup.py", "requirements.txt"],
"initializationOptions": {
"plugins": {
"pycodestyle": { "enabled": false },
"pylint": { "enabled": true }
}
}
}
}
}| Language | Server | Command | Installation |
|---|---|---|---|
| TypeScript/JavaScript | typescript-language-server | typescript-language-server --stdio |
npm i -g typescript-language-server |
| Python | pylsp | pylsp |
pip install python-lsp-server |
| Go | gopls | gopls |
go install golang.org/x/tools/gopls@latest |
| Rust | rust-analyzer | rust-analyzer |
via rustup |
| Java | jdtls | jdtls |
via Eclipse JDT |
Manage plugins from within Claude Code using the /plugin command.
# Install from marketplace
/plugin install plugin-name@marketplace-name
# Install with specific scope
/plugin install plugin-name@marketplace-name --scope user
/plugin install plugin-name@marketplace-name --scope project
/plugin install plugin-name@marketplace-name --scope local# List installed plugins
/plugin list
# Disable a plugin
/plugin disable plugin-name
# Enable a disabled plugin
/plugin enable plugin-name
# Uninstall a plugin
/plugin uninstall plugin-name@marketplace-name
# Update a plugin
/plugin update plugin-name@marketplace-name# Add a marketplace
/plugin marketplace add owner/repo
/plugin marketplace add https://github.com/owner/repo
/plugin marketplace add /path/to/local/marketplace
/plugin marketplace add https://example.com/marketplace.json
# List marketplaces
/plugin marketplace list
# Update marketplace catalog
/plugin marketplace update marketplace-name
# Remove a marketplace
/plugin marketplace remove marketplace-name- Use
/plugin marketinstead of/plugin marketplace - Use
rminstead ofremove - Use
lsinstead oflist
A complete plugin with all component types:
my-plugin/
├── .claude-plugin/
│ └── plugin.json # Required: plugin metadata (only this file goes here)
├── commands/ # Optional: slash commands
│ └── my-command.md
├── skills/ # Optional: AI skills (one folder per skill)
│ └── my-skill/
│ └── SKILL.md
├── agents/ # Optional: custom subagents
│ └── my-agent.md
├── hooks/ # Optional: lifecycle hooks
│ ├── hooks.json # Hook configuration (JSON record keyed by event)
│ └── (scripts are in scripts/)
├── scripts/ # Optional: hook scripts and utilities
│ └── my-hook.sh
├── .mcp.json # Optional: MCP server config (at plugin root)
├── .lsp.json # Optional: LSP server config (at plugin root)
└── README.md # Documentation
Important: Only plugin.json goes inside .claude-plugin/. All other directories are at plugin root.
Plugins can be installed at different scopes:
- User scope: Available across all your projects
- Location:
~/.claude/plugins/
- Location:
- Project scope: Shared with all collaborators via git
- Location:
<project>/.claude/plugins/
- Location:
- Local scope: Only for you in this project (gitignored)
- Location:
<project>/.claude-local/plugins/
- Location:
Plugins installed from remote sources are cached locally:
Cache location: ~/.claude/plugins/cache/<marketplace-name>/<plugin-name>/
When you install a plugin from a marketplace, Claude:
- Downloads the plugin source
- Copies it to the cache directory
- Loads components from the cached copy
This means:
- Offline access after first install
- Faster load times
- Must run
/plugin updateto get new versions
Run /plugin and go to the Errors tab to see loading issues.
Common errors:
- Invalid JSON in
plugin.json - Missing required fields (
name,version,description) - Unknown fields in
plugin.json(strict mode rejects them) - Skill frontmatter syntax errors
hooks.jsonhooksfield is an array instead of a record
# List all plugins and their status
/plugin list
# See detailed plugin info
/plugin info plugin-name- Skills: Check
skills/<name>/SKILL.mdfiles have valid YAML frontmatter - Agents: Try invoking with
/agent-namecommand - Hooks: Check hook events are firing (see Hooks debugging)
- MCP servers: Test with MCP inspector tools
Plugin not appearing after install:
- Check
/plugin listto confirm installation - Verify scope is correct for your use case
- Restart Claude Code
- Check the Errors tab in
/plugin
Commands not working:
- Verify plugin is enabled (
/plugin list) - Check command syntax:
/plugin-name:command-name - Some plugins require additional setup (check README)
Skills not being invoked:
- Check skill frontmatter is valid YAML
- Verify
applyTopatterns match your context - Skills are loaded on-demand based on relevance
MCP server failures:
- Check server binary is installed
- Verify environment variables are set
- Check server logs (see MCP debugging)
-
Create plugin directory:
mkdir -p my-plugin/.claude-plugin cd my-plugin -
Create manifest:
cat > .claude-plugin/plugin.json << 'EOF' { "name": "my-plugin", "version": "0.1.0", "description": "My custom plugin" } EOF
-
Add components (skills, agents, hooks) as needed
-
Test locally:
claude --plugin-dir ./my-plugin
-
Iterate: Make changes and restart Claude Code to reload
-
Distribute via marketplace (see Plugin marketplaces)
- Plugin names: lowercase-with-hyphens
- Skill names: descriptive-action-names
- Agent names: single-word or hyphenated
- Hook config:
hooks/hooks.json— a JSON record keyed by event name
Use semantic versioning:
- Major (1.0.0): Breaking changes
- Minor (0.1.0): New features, backwards compatible
- Patch (0.0.1): Bug fixes
Include a README.md with:
- What the plugin does
- Installation instructions
- Configuration requirements
- Usage examples
- Troubleshooting tips
- Don't commit secrets in manifest files
- Use environment variables for API keys
- Document required permissions
- Test in isolated environments first
- Create skills for domain knowledge
- Build custom agents for specialized tasks
- Add hooks to customize behavior
- Bundle MCP servers for external integrations
- Distribute via marketplace to share your plugin