surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
| 1 | # Minimal Plugin Example |
| 2 | |
| 3 | A bare-bones plugin with a single command. |
| 4 | |
| 5 | ## Directory Structure |
| 6 | |
| 7 | ``` |
| 8 | hello-world/ |
| 9 | ├── .claude-plugin/ |
| 10 | │ └── plugin.json |
| 11 | └── commands/ |
| 12 | └── hello.md |
| 13 | ``` |
| 14 | |
| 15 | ## File Contents |
| 16 | |
| 17 | ### .claude-plugin/plugin.json |
| 18 | |
| 19 | ```json |
| 20 | { |
| 21 | "name": "hello-world" |
| 22 | } |
| 23 | ``` |
| 24 | |
| 25 | ### commands/hello.md |
| 26 | |
| 27 | ```markdown |
| 28 | --- |
| 29 | name: hello |
| 30 | description: Prints a friendly greeting message |
| 31 | --- |
| 32 | |
| 33 | # Hello Command |
| 34 | |
| 35 | Print a friendly greeting to the user. |
| 36 | |
| 37 | ## Implementation |
| 38 | |
| 39 | Output the following message to the user: |
| 40 | |
| 41 | > Hello! This is a simple command from the hello-world plugin. |
| 42 | > |
| 43 | > Use this as a starting point for building more complex plugins. |
| 44 | |
| 45 | Include the current timestamp in the greeting to show the command executed successfully. |
| 46 | ``` |
| 47 | |
| 48 | ## Usage |
| 49 | |
| 50 | After installing the plugin: |
| 51 | |
| 52 | ``` |
| 53 | $ claude |
| 54 | > /hello |
| 55 | Hello! This is a simple command from the hello-world plugin. |
| 56 | |
| 57 | Use this as a starting point for building more complex plugins. |
| 58 | |
| 59 | Executed at: 2025-01-15 14:30:22 UTC |
| 60 | ``` |
| 61 | |
| 62 | ## Key Points |
| 63 | |
| 64 | 1. **Minimal manifest**: Only the required `name` field |
| 65 | 2. **Single command**: One markdown file in `commands/` directory |
| 66 | 3. **Auto-discovery**: Claude Code finds the command automatically |
| 67 | 4. **No dependencies**: No scripts, hooks, or external resources |
| 68 | |
| 69 | ## When to Use This Pattern |
| 70 | |
| 71 | - Quick prototypes |
| 72 | - Single-purpose utilities |
| 73 | - Learning plugin development |
| 74 | - Internal team tools with one specific function |
| 75 | |
| 76 | ## Extending This Plugin |
| 77 | |
| 78 | To add more functionality: |
| 79 | |
| 80 | 1. **Add commands**: Create more `.md` files in `commands/` |
| 81 | 2. **Add metadata**: Update `plugin.json` with version, description, author |
| 82 | 3. **Add agents**: Create `agents/` directory with agent definitions |
| 83 | 4. **Add hooks**: Create `hooks/hooks.json` for event handling |