Skills
Reusable instruction sets Claude invokes automatically or on demand.
Anthropic · Claude Code · Extension architecture
A plugin is a self-contained, installable bundle of capabilities (skills, agents, hooks, MCP servers and more) that Claude can load, understand, and act on. This is the field guide, drawn out in full.
$ /plugin install @official/code-review
✓ manifest registered · skills mounted · hooks armed
Claude can now review PRs, audit diffs & enforce standards.
A reusable “capability bundle” Claude can load, understand, and invoke on your behalf. It’s a lot more than a prompt wrapper.
is the operating system
are the applications
They extend what Claude can perceive, decide, and act on, so you don’t have to re-explain your context every session.
A single plugin can compose any of these:
Reusable instruction sets Claude invokes automatically or on demand.
Custom sub-agents with their own system prompts and tool access.
Event-driven shell scripts that fire on lifecycle events.
External tool integrations via the Model Context Protocol.
Real-time code intelligence for specific languages.
Persistent watchers that stream context to Claude as events arrive.
.claude//hello.claude-plugin/plugin.json/my-plugin:helloEvery plugin is just a directory. Its power comes from what you put inside it: nine components, each with a home.
plugin.json lives under .claude-plugin/..claude-plugin/plugin.jsonThe single required file. It declares your plugin’s identity: name (your skill namespace prefix), version, and description.
{
"name": "my-plugin",
"version": "1.0.0",
"description": "Automates code review"
}
skills/<name>/SKILL.mdThe lightest-weight primitive: a markdown file with YAML frontmatter giving Claude a reusable instruction set. The description tells Claude when to invoke it.
agents/<name>.mdSpecialized Claude instances with their own system prompt and restricted tools. For security, hooks, mcpServers and permissionMode are deliberately unsupported inside agents.
hooks/hooks.jsonThey react to lifecycle events by running shell commands automatically. This is the backbone for enforcing policy and running checks.
.mcp.jsonTools backed by external APIs or local processes. Bundle them so users get the integration automatically on install.
.lsp.jsonReal-time code intelligence for specific languages: completions, diagnostics, and go-to-definition.
monitors/monitors.jsonPersistent background processes that stream context to Claude as events arrive. Started automatically when the plugin is active.
settings.jsonShip default Claude Code settings. The supported keys are agent and subagentStatusLine, which let you activate a named agent as the main thread.
bin/Added to the Bash tool’s PATH while the plugin is active, so Claude gets your CLI utilities without anyone touching their PATH.
.claude-plugin/
plugin.json ← manifest (only file here)
skills/
code-review/
SKILL.md
reference.md
agents/security-reviewer.md
hooks/hooks.json
.mcp.json ← MCP server configs
.lsp.json ← LSP server configs
monitors/monitors.json
bin/ ← executables added to PATH
settings.json
README.md
From a marketplace install to a hot reload. Understanding the lifecycle helps you build plugins that behave predictably.
The manifest is read; the plugin’s identity is registered.
Skills are discovered and added to Claude’s command list.
Agents are loaded into the agent registry.
Hooks are registered for lifecycle events.
MCP servers start as child processes.
LSP servers are initialized.
Monitors begin streaming.
/plugin-name:skill-name [args]
Direct, deterministic. You decide.
Claude decides based on the task at hand, which is why a precise, trigger-aware description is the most important part of any skill.
Every plugin skill is prefixed /plugin-name:skill-name, preventing conflicts. The prefix comes from name in the manifest.
Run /reload-plugins to pick up changes without restarting. It reloads skills, agents, hooks, MCP, and LSP, and monitors restart on their own.
Answer these before writing a single line. They determine whether you’re building the right thing.
Start standalone. Convert to a plugin when sharing becomes necessary.
Finish this sentence: “With this plugin, Claude can now ____.” Be specific. “Developer productivity” is too broad to be useful.
Which tools? What should it explicitly not do? Persistent state? Network access? Scope creep breaks trust.
External binaries, API keys, network domains, other plugins. Write them all down, and fail gracefully when one is missing.
Pick a unique, organization-scoped name. Prefer acme-code-review over code-review.
Explicit version = stable, disciplined updates. No version = every commit ships. Pick explicit for anything beyond yourself.
Local dir · private git marketplace · community submission · enterprise marketplace behind your auth.
Seven reasons a plugin beats re-explaining yourself every session.
“The way we do things” becomes permanently available and automatically applied, instead of sitting in a wiki Claude can’t read.
A PostToolUse hook running your linter means style-violating code never gets committed. No human review step for mechanical checks.
The background you retype every session (architecture, file layout, conventions) belongs in a skill that sets Claude up at the start.
A security reviewer that only thinks vulnerabilities; a doc writer that only writes docs. Specialization produces better outputs.
MCP turns Claude Code into a hub that talks to your issue tracker, CI, and observability, so there’s no copy-paste from Datadog.
One install gives every engineer the same baseline. One update propagates everywhere.
Solve a general problem elegantly and there’s a real user base waiting on the community marketplace.
Claude Code is an orchestrator. Plugins extend what it knows and what it can do.
reads descriptions → decides which to invoke
sees available tools → decides which to call
spawns sub-agents → delegates focused subtasks
intercept tool calls → shell scripts run
When a skill is invoked, its SKILL.md drops into Claude’s working context at exactly the right moment. Put the critical info near the top, and load the detail only when it’s needed.
MCP tools appear right alongside Read, Write, and Bash. Claude routes by description, so your tool descriptions matter just as much as your skill descriptions.
The orchestrator delegates to an agent that runs with its own prompt and restricted tools, then returns findings to be synthesized.
Monitors pipe stdout to Claude as notifications, giving it a quiet awareness of test failures, error logs, and status changes without being asked.
This is the section that separates thoughtful authors from the ones who create real risk. Plugins are powerful, and that power needs constraints.
Installing a plugin means implicitly trusting every component inside it. Trust is transitive and often opaque.
Remote code execution via malicious hooks planted in a repository’s settings file.
API-key exfiltration by overriding environment variables through a rogue MCP server.
Request only the tools you actually need. Reading logs? tools: Read, Glob, and nothing more.
Give every agent an explicit tool list. A doc writer needs Read, Write, Glob, not Bash.
Always quote variables "$FILE". Validate & sanitize input. Never pipe user content to sh. Allowlist, don’t blocklist.
Each is a trust boundary. Ship only audited servers. Reference secrets via env. Scope tokens minimally; prefer read-only.
# Extract and validate; treat stdin as untrusted
FILE_PATH=$(echo "$STDIN" | jq -r '.tool_input.file_path // empty')
if [ -z "$FILE_PATH" ]; then exit 0; fi
# Ensure no path traversal
case "$FILE_PATH" in *../*) exit 1 ;; esac
claude plugin validate passes with no warningsThis is where plugins pay off the most, turning high-friction, multi-step work into a single command.
/pr-tools:full-review PR-456
Sets Claude up with everything it needs at the start. No action, just context.
Runs a multi-step process in order (fetch, analyze, act, report) and stops the moment a step fails.
Checks external state through MCP tools and acts conditionally: classify a ticket, then branch.
A skill paired with hooks for continuous improvement: write the test, run it, implement, verify, refactor.
The key insight: hooks return their stdout to Claude. A TypeScript error in the hook output gets read by Claude, which then fixes it, all without anyone stepping in. Design hooks to auto-correct, auto-verify, auto-document, and auto-notify.
Lessons from building production-grade plugins. Treat plugin development like production code.
Write audit logs from hooks. Add a :status skill reporting MCP health and recent hook activity.
Missing dependency? Surface it on stderr with a fix, don’t silently degrade. Give skills explicit fallbacks.
Core instructions in SKILL.md (100 to 200 lines), with the deep detail in a reference.md loaded on demand.
Safe to run twice. Ask: “What happens if this runs twice on the same input?” The answer: nothing bad.
Resist the Swiss-army knife. Three focused plugins beat one that does everything.
Plugin → skills → MCP servers → agents all share a coherent namespace.
Bump version, write a changelog entry, document migrations for breaking changes.
Clean install, upgrade, missing deps, co-installed plugins, concurrent invocations, local override.
The problem solved, what changes in Claude’s behavior, required setup, known limitations.
Git from day one, tested hook scripts, CI validation, tagged releases, security review before publish.
What the internet doesn’t tell you: the things you actually need to build plugins that work at scale.
description and routes the task to the one that fits. That’s why the description is your most important code.Claude’s decision to use a skill rests entirely on its description. Test it: describe a scenario without naming the skill, and see if Claude reaches for it. If it doesn’t, rewrite the description. Add negative constraints too, because saying what the skill is not for keeps Claude from over-applying it.
Underused. Hooks that return rich, structured context (JSON lint results) tell Claude exactly what to fix and where.
Every tool description is Claude’s decision criterion for calling it. Write them with skill-level care.
Skill: linear, fast, no tool isolation. Agent: strict isolation, a distinct persona, and deep focus, at the cost of some spawn overhead.
Any line of stdout can be a monitor: git commits, API polling, fswatch, slow-query logs. Sessions start to feel proactive.
The most underused feature: a default agent gives Claude Code organizational identity for the session.
A marketplace.json in a private git repo: centralized, version-pinned, audited plugins with a review gate.
A skill that reads its own files, checks them against the codebase, and proposes updates. A knowledge base that stays alive.
The cheat sheet: locations, events, and commands.
.claude-plugin/plugin.jsonskills/<name>/SKILL.mdagents/<name>.mdhooks/hooks.json.mcp.json.lsp.jsonmonitors/monitors.jsonsettings.jsonbin/PreToolUsePostToolUseConfigChangeSessionStartSessionEnd# scaffold
claude plugin init my-plugin
# load locally
claude --plugin-dir ./my-plugin
# load from URL
claude --plugin-url …/my-plugin.zip
# validate before publish
claude plugin validate
# reload during dev
/reload-plugins