Skip to main content

Plugin & Skill Extension System

Claude Code offers two extension mechanisms: plugins for structured feature extensions, and skills for reusable prompt workflows.

Plugin System​

Plugins are versioned installable packages contributing commands, skills, MCP servers, hooks, and settings. Loaded via pluginLoader.ts, merged with session and enterprise sources.

Plugin Lifecycle​

Plugin commands merge into getCommands(), MCP servers into getClaudeCodeMcpConfigs(), hooks via loadPluginHooks.ts.

Skill System​

Skills are model-invokable prompt workflows, implemented as Command objects with type: 'prompt'. Not a separate runtime -- they're loaded into the command registry and executed via SkillTool.

Skill Types​

TypeSourceFormat
BundledTypeScript modulesCompiled into binary, optional disk file extraction
Diskskills/ directorySKILL.md (Markdown + frontmatter)
PluginPlugin skills/ pathsMarkdown files
MCPMCP promptsSynthesized commands (feature-gated)

SkillTool Execution​

SkillTool finds the target skill from available commands, determines execution method (fork vs inline), and runs it.

Command Priority Chain​

Bundled skills > Built-in plugin skills > Disk skills > Workflows
> Plugin commands > Plugin skills > Built-in slash commands

Key Source Files​

FileResponsibility
src/utils/plugins/pluginLoader.tsPlugin loading and merging
src/skills/bundledSkills.tsBundled skill definitions
src/skills/loadSkillsDir.tsDisk skill loading
src/tools/SkillTool/SkillTool.tsSkill execution engine
src/commands.tsCommand registry (includes skills)

Next​

Go to 12-api-streaming.md to learn about API calls and streaming.

Hands-on Experiment​

This chapter has a corresponding Python experiment:

Lab 11 — Plugin/Skill System

Covers: SKILL.md parsing, plugin lifecycle, command priority chain

cd experiments && python -m exp_11_plugin_skill.main --mock