Claude Code /plugin Explained: Install Plugins for Your AI Coding Assistant
Why /plugin
Claude Code ships with 40+ tools and 80+ commands — already powerful. But every team and project has different needs. Some want a one-click deploy command, others need to connect internal MCP services, and some want Claude to run checks automatically before every commit.
Built-in features can’t satisfy everyone. That’s why Claude Code has a plugin system that lets you extend its capabilities yourself.
/plugin is the gateway to managing those plugins.
What Is /plugin
/plugin is Claude Code’s plugin management command (aliases: /plugins, /marketplace). It provides an interactive UI for browsing, installing, enabling, disabling, and managing plugins.
Type:
/plugin
This opens the plugin management interface, showing your installed plugins and available marketplaces.
What Plugins Can Do
A plugin can contain any combination of:
| Component | Description | Examples |
|---|---|---|
| Commands | Custom slash commands | /build, /deploy |
| Skills | AI skills (SKILL.md format) | Code review skill, test generation skill |
| Agents | AI sub-agents | A dedicated test runner agent |
| Hooks | Lifecycle hooks | Auto-lint before commits |
| MCP Servers | MCP protocol servers | Connect to databases, internal APIs |
| LSP Servers | Language Server Protocol | Custom language support |
| Output Styles | Terminal output styling | Custom themes |
In short, plugins are the standardized way to add features to Claude Code.
Plugin Structure
A typical plugin directory looks like this:
my-plugin/
├── plugin.json # Plugin manifest (metadata + component declarations)
├── commands/ # Custom commands
│ ├── build.md
│ └── deploy.md
├── skills/ # AI skills
│ └── code-review/
│ └── SKILL.md
├── agents/ # AI agents
│ └── test-runner.md
├── hooks/ # Lifecycle hooks
│ └── hooks.json
├── .mcp.json # MCP server configuration
└── data/ # Persistent data directory
The core is plugin.json, which declares all metadata and components:
{
"name": "my-plugin",
"version": "1.0.0",
"description": "A custom plugin for my team",
"author": {
"name": "Your Name"
},
"commands": "./commands",
"skills": "./skills",
"agents": "./agents",
"hooks": "./hooks/hooks.json",
"mcpServers": {
"my-db": {
"command": "npx",
"args": ["my-mcp-server"]
}
}
}
Installation and Management
Interactive Management
/plugin
Opens the graphical interface where you can install, enable, and disable plugins directly.
Command-Line Management
Better suited for scripts and automation:
# Install a plugin
claude plugin install my-plugin@github:owner/repo
# Uninstall
claude plugin uninstall my-plugin@github:owner/repo
# Enable / Disable
claude plugin enable my-plugin@github:owner/repo
claude plugin disable my-plugin@github:owner/repo
# Update
claude plugin update my-plugin@github:owner/repo
# List installed plugins
claude plugin list
claude plugin list --json # JSON output
claude plugin list --available # Show installable plugins
# Validate a plugin manifest
claude plugin validate ./path/to/plugin.json
Three Installation Scopes
| Scope | Config Location | Who It Affects |
|---|---|---|
| user | ~/.claude/settings.json | All your projects |
| project | .claude/settings.json | All collaborators in this repo |
| local | .claude/settings.local.json | Only you, only this repo copy |
Specify with the --scope flag:
claude plugin install my-plugin@marketplace --scope project
Default scope is user.
Marketplace
Marketplaces are where plugins come from. You can add multiple marketplaces:
# Add a GitHub repo as a marketplace
claude plugin marketplace add github:owner/plugin-repo
# List added marketplaces
claude plugin marketplace list
# Update marketplace cache
claude plugin marketplace update
# Remove
claude plugin marketplace remove marketplace-name
Marketplaces support multiple source types:
- GitHub repos:
github:owner/repo - Git URLs: Any Git repository
- URLs: Direct links to
marketplace.json - Local directories: For development and debugging
Plugin Identifiers
Each plugin has a unique identifier in the format name@marketplace, for example:
my-tool@github:owner/repo— From a GitHub marketplacedev-util@builtin— Built-in plugintest-plugin@inline— Session-only plugin (loaded via--plugin-dir)
Built-in Plugins
Claude Code ships with some built-in plugins, identified as @builtin. Like third-party plugins, they can be enabled or disabled, but they don’t need installation — they ship with the CLI.
In the /plugin interface, built-in plugins appear in a separate “Built-in” section.
Plugin Environment Variables
Commands, hooks, and MCP configurations within plugins can use these variables:
| Variable | Value | Purpose |
|---|---|---|
${CLAUDE_PLUGIN_ROOT} | Plugin installation path | Reference files within the plugin |
${CLAUDE_PLUGIN_DATA} | ~/.claude/plugins/data/<id>/ | Persistent data directory |
${CLAUDE_SKILL_DIR} | Skill subdirectory path | Internal use within skills |
${CLAUDE_SESSION_ID} | Current session ID | Cross-tool correlation |
${user_config.KEY} | User-configured value | Dynamic parameters |
The ${CLAUDE_PLUGIN_DATA} directory persists across plugin updates, making it ideal for storing user data.
User Configuration
Plugins can declare configuration fields that users need to fill in:
{
"userConfig": {
"API_KEY": {
"type": "secret",
"description": "Your API key for the service",
"sensitive": true
},
"BUILD_FLAGS": {
"type": "string",
"description": "Extra build flags",
"default": "--production"
}
}
}
After installing a plugin, Claude Code prompts users to fill in these configurations. Sensitive fields (like API keys) won’t appear in command content.
/reload-plugins
After modifying plugin configurations, you don’t need to restart Claude Code. Just run:
/reload-plugins
It will:
- Clear the plugin cache
- Reload all plugins
- Report results: plugin count, skill count, agent count, hook count, MCP/LSP server count
- Clearly indicate any loading errors
Plugin Hook System
Plugins can register hooks to listen to Claude Code lifecycle events. Supported events include:
- SessionStart / SessionEnd — Session begins and ends
- PreToolUse / PostToolUse — Before and after tool calls
- UserPromptSubmit — When users submit messages
- PreCompact / PostCompact — Before and after context compression
- Stop — When Claude stops responding
Hook configuration example:
{
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"name": "lint-before-bash",
"command": "echo 'Running pre-check...'"
}
]
}
]
}
Troubleshooting
Plugin failed to load? Use the /doctor command to see detailed information about all plugin errors.
Common error types:
- plugin-not-found — Plugin not found in marketplace
- manifest-parse-error —
plugin.jsonformat error - dependency-unsatisfied — Required plugin dependency not enabled
- mcp-config-invalid — MCP server configuration error
Real-World Scenarios
Scenario 1: Team-Shared Commands
Your team has a standard deployment workflow. Package it as a plugin, add it to .claude/settings.json (project scope), and everyone who clones the repo automatically gets the /deploy command.
Scenario 2: Internal Tool Integration
Your company has an internal MCP server connected to databases and monitoring systems. Declare the MCP configuration through a plugin, and team members can let Claude query production data directly after installation.
Scenario 3: Custom Code Checks
Write a hook plugin that automatically runs your lint and type-check every time Claude modifies a file. Catch issues immediately, instead of waiting until commit time.
Scenario 4: Development and Debugging
When developing your own plugin, use the --plugin-dir flag to temporarily load a local directory:
claude --plugin-dir ./my-local-plugin
Publish to a marketplace once debugging is complete.
Final Thoughts
/plugin transforms Claude Code from a “fixed-feature tool” into an extensible platform.
You’re no longer limited to what Claude Code ships with — if you need a feature, just write a plugin. And through the marketplace and installation scope mechanisms, plugins can be easily shared across teams.
A great tool isn’t one that does everything — it’s one that lets you do anything.
More Articles
- Why AI-First Startups Only Need One Programming Language
- cc-ping: Ping All Your Claude Code Configs in One Command
- Shocking! This Tool Lets Programmers Finish 95 Minutes of Work in 4 Minutes! 24x Efficiency Boost
- CCBot - 24x Development Efficiency Boost
- Claude Code /add-dir: The Monorepo Command You Miss
- Claude Code Token-Saving Tip: The Power of the Exclamation Mark
- I Built a Bot That Runs Claude Code From Chat
- Claude Code /btw Command Explained: Quick Side Questions Without Breaking Flow
- Claude Code /compact: Free Up Context, Keep Progress
- Claude Code /config: Every Setting Explained
- Claude Code /context: What's Eating Your Context Window?
- Claude Code /diff: See Exactly What Changed, Turn by Turn
- Claude Code /fast: Same Opus, 2x Speed — Worth It?
- Best Practice for External Knowledge in Claude Code: GitHub MCP + Context7
- Claude Code /hooks: Make AI Follow Your Rules
- Claude Code /init: Generate CLAUDE.md in 10 Seconds
- Claude Code MCP: Give Your AI Access to Any Tool
- Claude Code /memory Explained: Make AI Truly Remember Your Project
- Claude Code /model: Opus vs Sonnet vs Haiku Guide
- Claude Code /permissions: Fine-Grained Control Over What AI Can Do
- Claude Code /plan Explained: Think Before You Code
- Claude Code + Playwright MCP: AI Can Finally "See" the Page
- Claude Code /resume Command Explained: Don't Let Your Conversations Go to Waste
- Claude Code /review: Let AI Do Your Code Review
- Claude Code Skills Explained: Build Your Custom Command Library
- Claude Code /stats: See How Much AI Does For You
- Claude Code /status Command Explained: Your Session Dashboard
- Claude Code /tasks Command Explained: Master Your Background Tasks
- Claude Code /usage Command Explained: Know Your Remaining Quota
- Claude Code /vim: Vim Keybindings in Your AI Coding Assistant
- Claude Code in 2026: The Only Setup Guide You Need
- The Complete Guide to Claude: From Chat to Code to Automation
- Claude Code /agents Explained: Custom AI Sub-Agents, Each with Their Own Role
- Claude Code /doctor Explained: One-Click Diagnostics for Your Dev Environment
- Claude Code /effort Explained: Control How Hard Your AI Thinks
- Claude Code /cost Explained: How Much Is Your AI Coding Really Costing?
- Claude Code /export Explained: Take Your AI Conversations With You
- Claude Code /rewind Explained: AI Made a Mistake? Undo It Instantly
- Claude Code /theme Explained: Give Your Terminal a New Look
- Claude Code /insights: Using AI to Analyze How You Use AI
- Claude Code /rename Explained: Give Your Sessions Meaningful Names
- Claude Code settings.json Explained (1): Where Config Files Live and Who Wins
- Claude Code settings.json Deep Dive (Part 2): The Permissions System
- Claude Code settings.json Deep Dive (Part 3): The Hooks System
- Claude Code settings.json Deep Dive (4): env, Models, Auth, and Other Useful Fields