### Example Plugin Details Output Source: https://code.claude.com/docs/en/plugins-reference This example illustrates the output format for 'claude plugin details', showing component inventory and token cost projections for a plugin with two skills. ```text dependency-guard 1.2.0 Dependency analysis for Claude Code sessions Source: dependency-guard@example-marketplace Component inventory Skills (2) scan-dependencies, review-changes Agents (0) Hooks (1) (harness-only — no model context cost) MCP servers (0) LSP servers (0) Projected token cost Always-on: ~180 tok added to every session Per-component (rounded) component always-on on-invoke scan-dependencies ~100 ~2400 review-changes ~80 ~1800 On-invoke cost is paid each time a skill or agent fires. Token counts are estimates and may differ from actual usage. ``` -------------------------------- ### Install a Plugin Source: https://code.claude.com/docs/en/plugins-reference Installs a plugin from available marketplaces. Specify the plugin name and optionally the marketplace. The scope determines where the plugin is installed: 'user' (default), 'project', or 'local'. ```bash claude plugin install [options] ``` ```bash # Install to user scope (default) claude plugin install formatter@my-marketplace ``` ```bash # Install to project scope (shared with team) claude plugin install formatter@my-marketplace --scope project ``` ```bash # Install to local scope (gitignored) claude plugin install formatter@my-marketplace --scope local ``` -------------------------------- ### List Installed Claude Plugins Source: https://code.claude.com/docs/en/plugins-reference List installed plugins, showing their version, source marketplace, and enable status. Use the --json option for machine-readable output. The interactive session accepts --enabled or --disabled flags. ```bash claude plugin list [options] ``` -------------------------------- ### Plugin Directory Structure Example Source: https://code.claude.com/docs/en/plugins-reference Illustrates the correct placement of plugin components. Ensure components like commands, agents, and hooks are at the root level, with only `plugin.json` inside the `.claude-plugin/` directory. ```text my-plugin/ ├── .claude-plugin/ │ └── plugin.json ← Only manifest here ├── commands/ ← At root level ├── agents/ ← At root level └── hooks/ ← At root level ``` -------------------------------- ### Install Dependencies with CLAUDE_PLUGIN_DATA Source: https://code.claude.com/docs/en/plugins-reference This hook installs node_modules on the first run or when package.json changes. It uses CLAUDE_PLUGIN_ROOT for the bundled package.json and CLAUDE_PLUGIN_DATA for persistent storage and installation. ```json { "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "diff -q \"${CLAUDE_PLUGIN_ROOT}/package.json\" \"${CLAUDE_PLUGIN_DATA}/package.json\" >/dev/null 2>&1 || (cd \"${CLAUDE_PLUGIN_DATA}\" && cp \"${CLAUDE_PLUGIN_ROOT}/package.json\" . && npm install) || rm -f \"${CLAUDE_PLUGIN_DATA}/package.json\"" } ] } ] } } ``` -------------------------------- ### plugin list Source: https://code.claude.com/docs/en/plugins-reference Lists all installed plugins, displaying their version, source marketplace, and current enable status. This command helps users understand their current plugin environment. ```APIDOC ## claude plugin list ### Description List installed plugins with their version, source marketplace, and enable status. ### Method CLI Command ### Endpoint `claude plugin list [options]` ### Parameters #### Options - **`--json`** - Optional - Output as JSON - **`--available`** - Optional - Include available plugins from marketplaces. Requires `--json` - **`-h, --help`** - Optional - Display help for command ### Notes Within an interactive session, `/plugin list` prints the same listing inline. The interactive form accepts `--enabled` or `--disabled` to show only plugins in that state, and `ls` as a shorthand for `list`. ``` -------------------------------- ### Plugin Manifest Path Configuration Source: https://code.claude.com/docs/en/plugins-reference Example of specifying custom paths for commands and agents in a plugin manifest. These paths replace the default directories. ```json { "commands": [ "./specialized/deploy.md", "./utilities/batch-process.md" ], "agents": [ "./custom-agents/reviewer.md", "./custom-agents/tester.md" ] } ``` -------------------------------- ### Run Node.js Server with Persistent Dependencies Source: https://code.claude.com/docs/en/plugins-reference Configure an MCP server to run a Node.js script, pointing NODE_PATH to the node_modules installed in the persistent CLAUDE_PLUGIN_DATA directory. ```json { "mcpServers": { "routines": { "command": "node", "args": ["${CLAUDE_PLUGIN_ROOT}/server.js"], "env": { "NODE_PATH": "${CLAUDE_PLUGIN_DATA}/node_modules" } } } } ``` -------------------------------- ### Configure MCP Servers in Plugin Source: https://code.claude.com/docs/en/plugins-reference Define MCP servers within your plugin's configuration. These servers are automatically started when the plugin is enabled and appear as standard tools in Claude's toolkit. Use `${CLAUDE_PLUGIN_ROOT}` to reference plugin directories. ```json { "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}" } } } ``` -------------------------------- ### Enable a Disabled Plugin Source: https://code.claude.com/docs/en/plugins-reference Enables a disabled plugin. If the plugin has dependencies, they will be enabled transitively at the same scope. The command fails if a dependency is not installed. ```bash claude plugin enable [options] ``` -------------------------------- ### Declare Plugin Monitors in JSON Source: https://code.claude.com/docs/en/plugins-reference Define background monitors for a plugin using a JSON array. Each entry specifies a command to run, a unique name, and a description. The 'when' field controls the start condition, defaulting to 'always'. Requires Claude Code v2.1.105 or later. ```json [ { "name": "deploy-status", "command": ""${CLAUDE_PLUGIN_ROOT}"/scripts/poll-deploy.sh ${user_config.api_endpoint}", "description": "Deployment status changes" }, { "name": "error-log", "command": "tail -F ./logs/error.log", "description": "Application error log", "when": "on-skill-invoke:debug" } ] ``` -------------------------------- ### Uninstall a Plugin Source: https://code.claude.com/docs/en/plugins-reference Removes an installed plugin. You can specify the scope to uninstall from and options to keep data or prune dependencies. Aliases include 'remove' and 'rm'. ```bash claude plugin uninstall [options] ``` -------------------------------- ### Prune Plugin Dependencies Source: https://code.claude.com/docs/en/plugins-reference Removes auto-installed plugin dependencies that are no longer required by any installed plugin. This command requires Claude Code v2.1.121 or later. Aliases include 'autoremove'. ```bash claude plugin prune [options] ``` -------------------------------- ### Initialize a New Plugin Source: https://code.claude.com/docs/en/plugins-reference Use `claude plugin init` to scaffold a new plugin. Specify the plugin name and optionally include components like skills and hooks. The `--force` option can overwrite existing plugin files. ```bash claude plugin init [options] ``` ```bash # Scaffold a minimal plugin claude plugin init my-helper ``` ```bash # Scaffold with skill and hook folders claude plugin init my-helper --with skills hooks ``` ```bash # Overwrite an existing scaffold claude plugin init my-helper --force ``` -------------------------------- ### Configure LSP Server in .lsp.json Source: https://code.claude.com/docs/en/plugins-reference Use this format to configure an LSP server in a dedicated `.lsp.json` file. Ensure the LSP binary is in your PATH. ```json { "go": { "command": "gopls", "args": ["serve"], "extensionToLanguage": { ".go": "go" } } } ``` -------------------------------- ### Show Claude Plugin Details Source: https://code.claude.com/docs/en/plugins-reference Display a plugin's component inventory and projected token cost. The output includes skills, agents, hooks, and servers, along with always-on and on-invoke token cost estimates. ```bash claude plugin details ``` -------------------------------- ### Validate Plugin Manifest Source: https://code.claude.com/docs/en/plugins-reference Run this command to check your `plugin.json` file, as well as skill/agent/command frontmatter and `hooks.json` for syntax and schema errors. This is crucial for ensuring your plugin loads correctly. ```bash claude plugin validate ``` -------------------------------- ### Skill Directory Structure Source: https://code.claude.com/docs/en/plugins-reference Illustrates the file organization for skills within a plugin. Skills can be placed in 'skills/' or 'commands/' directories, or as a single 'SKILL.md' at the root. ```text skills/ ├── pdf-processor/ │ ├── SKILL.md │ ├── reference.md (optional) │ └── scripts/ (optional) └── code-reviewer/ └── SKILL.md ``` -------------------------------- ### Enable Debugging Output Source: https://code.claude.com/docs/en/plugins-reference Use the `--debug` flag with the `claude` command to view detailed plugin loading information, including which plugins are being loaded, manifest errors, and registration details. ```bash claude --debug ``` -------------------------------- ### plugin details Source: https://code.claude.com/docs/en/plugins-reference Displays a plugin's component inventory and projected token cost. It lists all components contributed by the plugin, such as Skills, Agents, and Hooks, along with an estimated token cost per session. ```APIDOC ## claude plugin details ### Description Show a plugin's component inventory and projected token cost. The output lists all components the plugin contributes, grouped as Skills, Agents, Hooks, MCP servers, and LSP servers, along with an estimate of how many tokens it adds to each session. ### Method CLI Command ### Endpoint `claude plugin details ` ### Parameters #### Arguments - **``** (string) - Required - Plugin name or `plugin-name@marketplace-name` #### Options - **`-h, --help`** - Optional - Display help for command ### Response Details The output shows two cost figures for each component: - **Always-on:** tokens added to every session by the plugin's listing text, such as skill descriptions, agent descriptions, and command names, regardless of whether any component fires. - **On-invoke:** tokens a component costs when it fires. Shown per component, not as a plugin total, because a typical session invokes only a subset of components. ### Example Output ``` dependency-guard 1.2.0 Dependency analysis for Claude Code sessions Source: dependency-guard@example-marketplace Component inventory Skills (2) scan-dependencies, review-changes Agents (0) Hooks (1) (harness-only — no model context cost) MCP servers (0) LSP servers (0) Projected token cost Always-on: ~180 tok added to every session Per-component (rounded) component always-on on-invoke scan-dependencies ~100 ~2400 review-changes ~80 ~1800 On-invoke cost is paid each time a skill or agent fires. Token counts are estimates and may differ from actual usage. ``` ### Notes The always-on total is computed via the `count_tokens` API for your active model. Per-component numbers are proportionally scaled from that total. If the API is unreachable, the command falls back to a character-based estimate. ``` -------------------------------- ### Tag Plugin Release Source: https://code.claude.com/docs/en/plugins-reference Create a git tag for a plugin release. Run this command from within the plugin's directory. The `--push` option pushes the tag to the remote. Use `--dry-run` to see what would be tagged without making changes. The `-f` or `--force` option creates the tag even if the working tree is dirty or the tag already exists. ```bash claude plugin tag [options] ``` -------------------------------- ### Create Symlink to Shared Skill Source: https://code.claude.com/docs/en/plugins-reference Use this command to create a symbolic link from within a marketplace plugin to a shared skill defined by a sibling plugin. On Windows, use `mklink /D` from an elevated Command Prompt or enable Developer Mode. ```bash ln -s ../../shared-plugin/skills/foo ./skills/foo ``` -------------------------------- ### Standard Plugin Directory Structure Source: https://code.claude.com/docs/en/plugins-reference This is the standard layout for a complete Claude plugin. It includes directories for metadata, skills, commands, agents, output styles, themes, monitors, hooks, executables, settings, and scripts. ```text enterprise-plugin/ ├── .claude-plugin/ # Metadata directory (optional) │ └── plugin.json # plugin manifest ├── skills/ # Skills │ ├── code-reviewer/ │ │ └── SKILL.md │ └── pdf-processor/ │ ├── SKILL.md │ └── scripts/ ├── commands/ # Skills as flat .md files │ ├── status.md │ └── logs.md ├── agents/ # Subagent definitions │ ├── security-reviewer.md │ ├── performance-tester.md │ └── compliance-checker.md ├── output-styles/ # Output style definitions │ └── terse.md ├── themes/ # Color theme definitions │ └── dracula.json ├── monitors/ # Background monitor configurations │ └── monitors.json ├── hooks/ # Hook configurations │ ├── hooks.json # Main hook config │ └── security-hooks.json # Additional hooks ├── bin/ # Plugin executables added to PATH │ └── my-tool # Invokable as bare command in Bash tool ├── settings.json # Default settings for the plugin ├── .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 ``` -------------------------------- ### Make Hook Script Executable Source: https://code.claude.com/docs/en/plugins-reference Ensure your hook scripts have execute permissions by running `chmod +x`. This is a common requirement for scripts to run correctly when triggered by hooks. ```bash chmod +x ./scripts/your-script.sh ``` -------------------------------- ### Configure LSP Server Inline in plugin.json Source: https://code.claude.com/docs/en/plugins-reference Embed LSP server configuration directly within your `plugin.json` file. This is an alternative to using a separate `.lsp.json` file. ```json { "name": "my-plugin", "lspServers": { "go": { "command": "gopls", "args": ["serve"], "extensionToLanguage": { ".go": "go" } } } } ``` -------------------------------- ### Agent Configuration Frontmatter Source: https://code.claude.com/docs/en/plugins-reference Defines the metadata for a plugin agent. Key fields include name, description, model, and effort. Ensure 'isolation' is set to 'worktree' if used. ```markdown --- name: agent-name description: What this agent specializes in and when Claude should invoke it model: sonnet effort: medium maxTurns: 20 disallowedTools: Write, Edit --- Detailed system prompt for the agent describing its role, expertise, and behavior. ``` -------------------------------- ### Hook Configuration for PostToolUse Event Source: https://code.claude.com/docs/en/plugins-reference Configures a hook to trigger a script when 'Write' or 'Edit' tools are used. The script path is dynamically set using CLAUDE_PLUGIN_ROOT. ```json { "hooks": { "PostToolUse": [ { "matcher": "Write|Edit", "hooks": [ { "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/scripts/format-code.sh" } ] } ] } } ``` -------------------------------- ### Define User Configuration for a Plugin Source: https://code.claude.com/docs/en/plugins-reference Use `userConfig` to declare values Claude Code prompts the user for when a plugin is enabled. This avoids manual editing of `settings.json`. Sensitive values are masked and stored securely. ```json { "userConfig": { "api_endpoint": { "type": "string", "title": "API endpoint", "description": "Your team's API endpoint" }, "api_token": { "type": "string", "title": "API token", "description": "API authentication token", "sensitive": true } } } ``` -------------------------------- ### Declare Message Channels for a Plugin Source: https://code.claude.com/docs/en/plugins-reference The `channels` field allows a plugin to declare message channels that inject content into the conversation, binding to an MCP server. Per-channel `userConfig` can prompt for specific credentials like bot tokens. ```json { "channels": [ { "server": "telegram", "userConfig": { "bot_token": { "type": "string", "title": "Bot token", "description": "Telegram bot token", "sensitive": true }, "owner_id": { "type": "string", "title": "Owner ID", "description": "Your Telegram user ID" } } } ] } ``` -------------------------------- ### Define a Plugin Color Theme Source: https://code.claude.com/docs/en/plugins-reference Create a custom color theme for Claude Code by defining a JSON object. Specify a 'name', a 'base' theme ('dark' or 'light'), and an 'overrides' map for specific color tokens. ```json { "name": "Dracula", "base": "dark", "overrides": { "claude": "#bd93f9", "error": "#ff5555", "success": "#50fa7b" } } ``` -------------------------------- ### Reference Plugin Root in Hooks Source: https://code.claude.com/docs/en/plugins-reference Use CLAUDE_PLUGIN_ROOT to reference scripts or binaries bundled with your plugin. Ensure it's quoted in shell-form hooks and monitor commands. ```json { "hooks": { "PostToolUse": [ { "hooks": [ { "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/process.sh" } ] } ] } } ``` -------------------------------- ### Test Hook Script Manually Source: https://code.claude.com/docs/en/plugins-reference Before relying on hooks, manually test your script to ensure it functions as expected. This helps isolate issues related to the script itself. ```bash ./scripts/your-script.sh ``` -------------------------------- ### Complete Plugin Manifest Schema Source: https://code.claude.com/docs/en/plugins-reference This JSON object represents the complete schema for a Claude plugin manifest file, including all supported fields and their typical values. ```json { "name": "plugin-name", "displayName": "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"], "skills": "./custom/skills/", "commands": ["./custom/commands/special.md"], "agents": ["./custom/agents/reviewer.md"], "hooks": "./config/hooks.json", "mcpServers": "./mcp-config.json", "outputStyles": "./styles/", "lspServers": "./.lsp.json", "experimental": { "themes": "./themes/", "monitors": "./monitors.json" }, "dependencies": [ "helper-lib", { "name": "secrets-vault", "version": "~2.1.0" } ] } ``` -------------------------------- ### Disable a Skills-Directory Plugin Source: https://code.claude.com/docs/en/plugins-reference Use this command to stop loading a skills-directory plugin. This is an alternative to deleting the plugin's folder. ```bash claude plugin disable my-tool@skills-dir ``` -------------------------------- ### Update a Claude Plugin Source: https://code.claude.com/docs/en/plugins-reference Update a plugin to its latest version. Specify the plugin name or its marketplace identifier. ```bash claude plugin update [options] ``` -------------------------------- ### Validate Plugin with Strict Mode Source: https://code.claude.com/docs/en/plugins-reference Use the `claude plugin validate` command with the `--strict` flag to treat unrecognized fields as errors during validation. This is useful in CI environments to catch potential issues before publishing. ```bash claude plugin validate ./my-plugin --strict ``` -------------------------------- ### plugin update Source: https://code.claude.com/docs/en/plugins-reference Updates a plugin to its latest available version. This command is used to ensure plugins are running the most recent release. ```APIDOC ## claude plugin update ### Description Update a plugin to the latest version. ### Method CLI Command ### Endpoint `claude plugin update [options]` ### Parameters #### Arguments - **``** (string) - Required - Plugin name or `plugin-name@marketplace-name` #### Options - **`-s, --scope `** (string) - Optional - Scope to update: `user`, `project`, `local`, or `managed`. Default: `user` - **`-h, --help`** - Optional - Display help for command ``` -------------------------------- ### plugin disable Source: https://code.claude.com/docs/en/plugins-reference Disables a plugin without uninstalling it. This command will fail if another enabled plugin depends on the target plugin. The error message will include a chained command to disable all dependent plugins first. ```APIDOC ## claude plugin disable ### Description Disable a plugin without uninstalling it. Fails when another enabled plugin depends on the target. The error message includes a chained command that disables every dependent first. ### Method CLI Command ### Endpoint `claude plugin disable [options]` ### Parameters #### Arguments - **``** (string) - Required - Plugin name or `plugin-name@marketplace-name` #### Options - **`-s, --scope `** (string) - Optional - Scope to disable: `user`, `project`, or `local`. Default: `user` - **`-h, --help`** - Optional - Display help for command ``` -------------------------------- ### Disable a Claude Plugin Source: https://code.claude.com/docs/en/plugins-reference Use this command to disable a plugin without uninstalling it. It fails if another enabled plugin depends on the target, providing a chained command to disable dependents first. ```bash claude plugin disable [options] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.