From bcd3163ad070c2fe5c752a3b969dccf8613d1110 Mon Sep 17 00:00:00 2001 From: n24q02m Date: Fri, 20 Mar 2026 14:02:44 +0700 Subject: [PATCH] fix: use valid PostToolUse hooks and remove duplicate MCP config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two plugin issues that cause errors in Claude Code /doctor: 1. hooks/hooks.json used PostEdit and PostGit event types which are not valid Claude Code hook events. Replace with PostToolUse — the standard event for post-tool callbacks. PostEdit (matcher: Write|Edit) maps directly; PostGit (matcher: commit) maps to PostToolUse with Bash matcher since git commits go through the Bash tool. 2. .mcp.json at repo root duplicates the MCP server already declared in .claude-plugin/plugin.json mcpServers field. When installed as a plugin, Claude Code loads both and logs "MCP server skipped — same command/URL as already-configured". Remove .mcp.json since plugin.json is the canonical source. The CLI install command creates .mcp.json in the user's project root (not this repo), so non-plugin installs are unaffected. Closes #25 Closes #23 Co-Authored-By: Claude Opus 4.6 (1M context) --- .mcp.json | 8 -------- hooks/hooks.json | 10 ++++------ 2 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 .mcp.json diff --git a/.mcp.json b/.mcp.json deleted file mode 100644 index b38c21d..0000000 --- a/.mcp.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "mcpServers": { - "code-review-graph": { - "command": "uvx", - "args": ["code-review-graph", "serve"] - } - } -} diff --git a/hooks/hooks.json b/hooks/hooks.json index 6ea91e7..4ee8137 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -1,5 +1,5 @@ { - "_comment": "PostEdit and PostGit are custom Claude Code hook events (confirmed working as of v1.6.4).", + "_comment": "Auto-update knowledge graph after file edits and git commits via PostToolUse hooks.", "hooks": { "SessionStart": [ { @@ -11,7 +11,7 @@ ] } ], - "PostEdit": [ + "PostToolUse": [ { "matcher": "Write|Edit", "hooks": [ @@ -20,11 +20,9 @@ "command": "code-review-graph update 2>/dev/null || true" } ] - } - ], - "PostGit": [ + }, { - "matcher": "commit", + "matcher": "Bash", "hooks": [ { "type": "command",