From b6723ee5118a5ff4cedadbd8b63d1047b525a671 Mon Sep 17 00:00:00 2001 From: Minsu Lee Date: Wed, 11 Feb 2026 22:07:37 +0900 Subject: [PATCH] fix(gatekeeper): remove duplicate hooks reference from plugin.json Remove "hooks": "./hooks/hooks.json" from plugin.json as Claude Code automatically loads hooks/hooks.json. The explicit reference was causing a duplicate hooks warning. Also update CLAUDE.md to document this auto-loading behavior and add best practices for plugin development. Changes: - Remove duplicate hooks field from gatekeeper plugin.json - Add plugins/ directory to CLAUDE.md structure - Document hooks auto-loading in best practices - Remove hooks anti-pattern from plugin.json example --- CLAUDE.md | 9 ++++++++- plugins/gatekeeper/.claude-plugin/plugin.json | 3 +-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index ef6a5f60..d0e1b4a3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,6 +27,10 @@ claude-code-plugins/ │ ├── mcp-neo4j/ # Neo4j MCP server │ ├── chrome-devtools-mcp/ # Chrome DevTools automation │ └── context7/ # Up-to-date library documentation +├── plugins/ # Built-in plugins (maintained in this repo) +│ ├── gatekeeper/ # Auto-approve safe commands +│ ├── plugin-dev/ # Plugin development tools +│ └── ... # Framework-specific plugins (antfu, nuxt, vue, etc.) ├── apps/web/ # Marketplace website ├── .claude-plugin/ # Marketplace configuration └── hooks/ # Session hooks @@ -169,7 +173,6 @@ When integrating an existing MCP server or tool as a Claude Code plugin: "repository": "https://github.com/org/tool-repo", "license": "MIT", "keywords": ["keyword1", "keyword2"], - "hooks": "./hooks/hooks.json", "mcpServers": { "server-name": { "command": "npx", @@ -322,6 +325,10 @@ When integrating an existing MCP server or tool as a Claude Code plugin: - `hooks/`, `commands/`, `agents/` directories at plugin root - Use `${CLAUDE_PLUGIN_ROOT}` for all path references +**Hooks Auto-Loading:** +- `hooks/hooks.json` is auto-loaded by Claude Code — do NOT reference it in `plugin.json`'s `hooks` field +- `plugin.json`'s `hooks` field should only reference ADDITIONAL hook files beyond the standard path + **Documentation:** - Include Claude Code installation in plugin README - Explain automatic features (SessionStart hooks) diff --git a/plugins/gatekeeper/.claude-plugin/plugin.json b/plugins/gatekeeper/.claude-plugin/plugin.json index 09cc10c6..c8ad9e99 100644 --- a/plugins/gatekeeper/.claude-plugin/plugin.json +++ b/plugins/gatekeeper/.claude-plugin/plugin.json @@ -8,6 +8,5 @@ }, "repository": "https://github.com/pleaseai/claude-code-plugins", "license": "MIT", - "keywords": ["security", "permissions", "gatekeeper", "hook"], - "hooks": "./hooks/hooks.json" + "keywords": ["security", "permissions", "gatekeeper", "hook"] }