OmniscioGuidesCreate a Claude Code plugin
How to create a Claude Code plugin: layout, loading and testing
A plugin is a directory of skills, agents, hooks and MCP servers, plus a plugin.json manifest that names it. Claude Code loads the directory as one unit, which is what makes a setup shareable, installable in several projects, and releasable as a version.
This page owns building one. The plugins guide owns installing someone else's from a marketplace, the publish guide owns versioning and distribution, and the skills guide owns what goes inside a single skill.
Sources read November 26, 2026. By the Omniscio team. Updated .
When a plugin is worth building
Skills, agents, hooks and MCP servers all work standalone in a project or home directory. Keep that standalone setup while it serves one project or only you. Build a plugin when you want to share the setup with others, install it in several projects, or publish versioned releases.
Moving a setup into a plugin changes two things. The files move under the plugin's own directory — the plugin root — as skills/, agents/, hooks/hooks.json and .mcp.json. And the names gain a prefix: plugin skills and agents are called /my-plugin:hello, so two plugins can each ship a hello skill without colliding.
Create your first plugin
The smallest useful example has one skill, because a skill shows the layout without hiding it behind anything else. Run these from the folder where you want to keep the plugin; you can keep a plugin anywhere, because you pass its path to Claude Code when you start a session.
1. Make the directory
mkdir -p my-first-plugin/.claude-plugin2. Write the manifest
Save this as my-first-plugin/.claude-plugin/plugin.json. name is required, becomes the prefix on every skill and agent, and takes no spaces. description is the text users see in /plugin, version keeps people who install it on that version until you change it, and author takes a required name with optional email and url.
{
"name": "my-first-plugin",
"description": "A greeting plugin to learn the basics",
"version": "1.0.0",
"author": {
"name": "Your Name"
}
}3. Add a skill
Each skill is a directory under skills/ holding a SKILL.md. Save this one as my-first-plugin/skills/hello/SKILL.md. The disable-model-invocation: true line keeps Claude from running the skill on its own; remove it from a skill you want Claude to pick up by itself.
---
name: hello
description: Greet the user with a friendly message
disable-model-invocation: true
---
Greet the user warmly and ask how you can help them today.4. Validate it
claude plugin validate ./my-first-pluginThe command checks the manifest and the frontmatter of every skill, agent and command file. It prints the manifest path it checked and ✔ Validation passed; when it prints ✘ Validation failed, each line above that result names the field to fix. Add --strict to fail on warnings too.
5. Run it
claude --plugin-dir ./my-first-pluginInside the session, type /my-first-plugin:hello. It loads only in sessions you start with that flag, which is the point: nothing is installed until you decide it should.
The plugin layout
Each kind of component has a fixed directory under the plugin root — the directory you pass to --plugin-dir. Add only the ones you use.
| Location | Contents |
|---|---|
.claude-plugin/plugin.json | The manifest. A plugin loaded with --plugin-dir that has no manifest takes its directory's name |
skills/ | One <name>/SKILL.md directory per skill |
commands/ | Flat Markdown files, the older form of skills; use skills/ for new plugins |
agents/ | One Markdown file per subagent |
hooks/hooks.json | A top-level "hooks" key with the same shape as one in a settings file |
.mcp.json | MCP server definitions |
One warning from the docs is worth repeating, because it is the mistake that produces a plugin with no components: only plugin.json goes inside .claude-plugin/, and components saved there do not load. The plugin root is the plugin's own directory, not ~/.claude/ — a .mcp.json saved at ~/.claude/.mcp.json does not load.
Developing without a marketplace
You do not need a marketplace to run a plugin you are writing. Load it from disk or a URL, or scaffold one that loads in every session.
A directory or zip, for one session
Pass --plugin-dir when you start claude, and repeat it to load several plugins. A zip archive of the plugin root works the same way.
claude --plugin-dir ./my-first-plugin --plugin-dir ./other-plugin.zipA folder of plugins also loads: each immediate subfolder that has a .claude-plugin/plugin.json and no leading . in its name becomes its own plugin. That needs Claude Code v2.1.265 or later, and loading from a folder that also keeps a .claude-plugin/marketplace.json needs v2.1.281 or later — nothing is installed from that file, because it is not read.
A URL, when CI builds the archive
claude --plugin-url https://example.com/my-first-plugin.zipClaude Code downloads the archive at startup. Point the flag only at archives you control or trust. If the archive cannot be fetched or is invalid, the session starts without the plugin and records a load error you can read in the /plugin manager's Errors tab.
Every session, from your skills directory
A folder under ~/.claude/skills/ that holds a .claude-plugin/plugin.json is a skills-directory plugin: Claude Code loads it at the start of every session with no flag and no install step, unless your administrator has blocked those plugins. claude plugin init my-tool scaffolds one and prints ✔ Created plugin "my-tool" at ~/.claude/skills/my-tool with instructions to run /reload-plugins now.
One naming quirk follows from that: the root skill at ~/.claude/skills/my-tool/SKILL.md is also a personal skill, so you invoke it as /my-tool, not /my-tool:my-tool. Skills you add under skills/ inside the plugin do get the prefix, such as /my-tool:example.
Test and debug it
When a change does not show up, work through these in order. Each one says what Claude Code did with the plugin.
- In your shell, run
claude plugin validate <path>. It checks the manifest and the frontmatter of every skill, agent and command file, and exits0onValidation passed. - In the session, run
/reload-pluginsto apply edits you made on disk. It prints oneReloaded:line with counts. - Run
/plugin. The Installed tab lists your plugin with the components Claude Code found, and the Errors tab lists what failed to load and why. - Back in the shell,
claude plugin listprints session-only and skills-directory plugins withStatus: ✔ loadedor the load error.
The three failures you will actually hit
A component path is not found message in the Errors tab means a path in the manifest points at nothing: fix the path or create the directory, then /reload-plugins. Pointing --plugin-dir at a marketplace root loads nothing, because the flag takes one plugin's root and the marketplace file is not read. And a plugin whose skills are missing usually has skills/ inside .claude-plugin/, or a manifest skills entry pointing at a file instead of a directory that contains SKILL.md.
To check a server, run /mcp in the session: a healthy one is listed as connected. To check a hook, turn on debug logging and trigger the event it matches, for example by asking Claude to edit a file to fire a PostToolUse hook. A plugin that loads cleanly can still fail to steer Claude, and claude plugin eval runs your test cases with and without the plugin to score the difference — the plugin evals guide covers writing them.
Convert an existing .claude setup
If your skills, agents or hooks already live under a project's .claude/, you can move them into a plugin without rewriting them. From the project root, create the plugin directory and its manifest alongside .claude/, copy the directories you have to the plugin root, and move the hooks object out of settings.json into my-plugin/hooks/hooks.json, under the same top-level "hooks" key it has in the settings file.
Then load it with --plugin-dir and check each component under its new name: /deploy becomes /my-plugin:deploy, and the reviewer agent becomes my-plugin:reviewer. While the originals stay under .claude/, the two sets coexist — the prefixed skills and agents do not collide. Hooks have no prefix, so a hook present in both places runs twice each time its event fires.
Once the plugin works, delete the originals and remove the hooks object from the settings file.
Sources
Every line on this page rests on one of these. The date beside each one is the day we read it.
- Create a Claude Code plugin, for the walkthrough, the layout table, local loading, testing, debugging and the migration steps. Read November 26, 2026.
- Add components to a plugin, for what each component directory holds and the manifest fields the walkthrough uses. Read November 26, 2026.
No plugin was built for this page. Every command, path and message is transcribed from those pages.
Common questions
What is the smallest Claude Code plugin you can build?
A folder with .claude-plugin/plugin.json and one skill under skills/. No component is required; a plugin loaded with --plugin-dir and no manifest is named after its directory, though every real plugin carries one. Anthropic's walkthrough uses a single greeting skill to show the layout.
Where does plugin.json go?
In .claude-plugin/ inside the plugin root. Only plugin.json belongs there; skills, agents, commands, hooks and .mcp.json sit at the plugin root, next to that folder, and components saved inside .claude-plugin/ do not load.
How do I test a Claude Code plugin without a marketplace?
Start Claude Code with claude --plugin-dir ./my-plugin, which also accepts a .zip of the plugin; for an archive hosted at a URL use --plugin-url. Neither installs anything; both load the plugin for one session, and /reload-plugins applies edits you make during it.
Why do my plugin's skills have a colon in the name?
A plugin's skills and agents carry the plugin name as a prefix, so a hello skill in my-first-plugin runs as /my-first-plugin:hello. The prefix keeps two plugins from colliding when they both ship a skill with the same name.
Can I turn my existing .claude setup into a plugin?
Yes. Copy commands, agents and skills from .claude/ to the plugin root, move the hooks object from settings.json into hooks/hooks.json, and test with --plugin-dir. While both copies exist, the prefixed skills and agents coexist and a duplicated hook runs twice.
Every session, one window
Omniscio runs several agent sessions side by side in one window, each with its own context and its own diff view. Any model, any harness: Claude Code, Codex, OpenCode, Devin, Pi, and Hermes all supported.