Skip to main content

Plugins & Skills

Two extension mechanisms: Plugins for full CLI extensions, and Skills for lightweight AI prompt templates. For how plugin tools and skills feed into the tool pipeline, see Tool Sources.

Skills

Skills are the simpler extension — markdown files that inject prompt content when invoked as slash commands.

Skill Format

---
name: my-skill
description: What this skill does
context: inline # or 'fork' to run in a sub-agent
effort: balanced
paths: ["src/**"] # Glob patterns for auto-activation
---

Your skill prompt content here.
This becomes the instruction sent to the model.

How Skills Work

📋
User types /skill-name
📥
Load skill file
Context type?
inline
Inject content as user message
🤖
Model processes in current conversation
fork
Spawn sub-agent
🤖
Sub-agent processes independently
📤
Result returned to main conversation

Skill Sources

  1. Bundled skills — shipped with Claude Code in src/skills/bundled/
  2. User skills — stored in ~/.claude/skills/
  3. Project skills — in .claude/skills/ within a repo

Bundled Skills

Claude Code ships with several built-in skills including:

  • /commit — create a git commit
  • /review-pr — review a pull request
  • /simplify — simplify recently changed code
  • And more...

These are PromptCommands — they inject specialized instructions into the conversation.

Plugins

Plugins are full CLI extensions that can add commands, tools, and hooks.

Plugin Manifest

{
"name": "my-plugin",
"version": "1.0.0",
"commands": [
{ "name": "my-command", "description": "...", "handler": "./commands/my-command.js" }
],
"tools": [
{ "name": "MyTool", "handler": "./tools/my-tool.js" }
],
"hooks": [
{ "event": "pre_tool_use", "handler": "./hooks/validate.js" }
]
}

Plugin Capabilities

FeatureDescription
CommandsCustom slash commands (any type)
ToolsCustom tools available to the model
HooksLifecycle hooks (pre/post query, pre/post tool use)
SettingsCustom configuration options
PermissionsCustom permission rules

Plugin Lifecycle

🚀
CLI Startup
🔍
Discover plugins in ~/.claude/plugins/
📥
Load and validate manifests
Invalid — log warning, skip plugin
Valid — register capabilities
🔌
Register commands, tools, hooks
Plugin active — responding to events
Command Invoked
⌨️
User runs /plugin-cmd
Handler executes
Tool Called
🔧
Model calls plugin tool
Tool handler runs
Hook Fires
🪝
pre/post tool or query
Hook logic runs

Plugin vs Skill

AspectSkillPlugin
ComplexityLow (just markdown)High (JavaScript/TypeScript)
What it can doInject promptsCommands, tools, hooks, settings
FormatYAML frontmatter + markdownJSON manifest + JS handlers
InstallationDrop a file in ~/.claude/skills/Install in ~/.claude/plugins/
Use casePrompt templates, workflowsFull-featured extensions

Key Source Files

FilePurpose
src/skills/Skill system (20 files)
src/skills/bundled/Built-in skills
src/plugins/Plugin system
src/services/plugins/Plugin discovery and management
src/tools/SkillTool/Skill execution tool