- Skills: capabilities Claude invokes autonomously when relevant. You can also invoke a plugin skill directly with
/plugin-name:skill-name. - Agents: specialized subagents for specific tasks
- Hooks: event handlers that respond to tool use and other events
- MCP servers: external tool integrations via Model Context Protocol
Loading plugins
Load plugins by providing their local file system paths in your options configuration. Thetype field must be "local", the only value the SDK accepts. The SDK supports loading multiple plugins from different locations.
To use a plugin distributed through a marketplace or remote repository, download it first and provide the local directory path. For the directory layout a plugin needs, see the Plugin structure reference below.
Path specifications
Plugin paths can be:- Relative paths: resolved relative to your current working directory (for example,
"./plugins/my-plugin") - Absolute paths: full file system paths (for example,
"/home/user/plugins/my-plugin")
The path should point to the plugin’s root directory: the parent of
skills/, agents/, hooks/, commands/, or .claude-plugin/.Verifying plugin installation
When plugins load successfully, they appear in the system initialization message. You can verify that your plugins are available:Using plugin skills
Skills from plugins are automatically namespaced with the plugin name to avoid conflicts. To invoke one directly, send/plugin-name:skill-name as the prompt.
If you installed a plugin via the CLI (for example,
/plugin install my-plugin@marketplace), you can still use it in the SDK by providing its installation path. Check ~/.claude/plugins/ for CLI-installed plugins.Complete example
Here’s a full example demonstrating plugin loading and usage:Plugin structure reference
A plugin directory typically contains a.claude-plugin/plugin.json manifest file. The manifest is optional. When omitted, Claude Code auto-discovers components from the directory layout. The directory can include:
The
commands/ directory holds skills as flat Markdown files. Use skills/ for new plugins. Claude Code supports both locations.Multiple plugin sources
Combine plugins from different locations:The SDK doesn’t expand tilde paths like
~/plugins. If a plugin path doesn’t exist, the SDK skips that plugin and the session continues, so check the plugins list in the init message to confirm each plugin loaded.Troubleshooting
Plugin not loading
If your plugin doesn’t appear in the init message:- Check the path: ensure the path points to the plugin root directory, the parent of
skills/,agents/,hooks/,commands/, or.claude-plugin/ - Validate plugin.json: if your plugin includes a manifest, ensure it has valid JSON syntax
- Check file permissions: ensure the plugin directory is readable
- Confirm the directory exists: the SDK skips a nonexistent path, and the plugin doesn’t appear in the init message’s
pluginslist
Skills not appearing
If plugin skills don’t work:- Use the namespace: invoke plugin skills as
/plugin-name:skill-name - Check init message: verify the skill appears in the
skillslist with the correct namespace - Validate skill files: ensure each skill has a
SKILL.mdfile in its own subdirectory underskills/, for exampleskills/my-skill/SKILL.md
See also
- Plugins - Complete plugin development guide
- Plugins reference - Technical specifications
- Commands - Using commands in the SDK
- Subagents - Working with specialized agents
- Skills - Using Agent Skills