fix: use valid PostToolUse hooks and remove duplicate MCP config#35
fix: use valid PostToolUse hooks and remove duplicate MCP config#35n24q02m wants to merge 1 commit intotirth8205:mainfrom
Conversation
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 tirth8205#25 Closes tirth8205#23 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Note: The plugin marketplace version ( This doesn't affect runtime behavior since the MCP server binary is resolved via
Happy to add this to the PR if you'd like. |
|
Thank you for the PR! The hooks fix was already merged via #26. The |
…#22) Squash-merge of PR #22 by @clls1-stinger with fixups: - Use RETRIEVAL_QUERY task type for search queries (not RETRIEVAL_DOCUMENT) - Require explicit opt-in (no auto-detecting GOOGLE_API_KEY) - Keep lazy model loading for LocalEmbeddingProvider - Make embedding dimension dynamic per model - Move google-generativeai to separate [google-embeddings] optional extra - Fix tests to work with new provider-based architecture - Restore _check_available() for backward compatibility - Remove duplicate .mcp.json (credit: @n24q02m from #35) Co-Authored-By: clls1-stinger <clls1-stinger@users.noreply.github.com> Co-Authored-By: n24q02m <n24q02m@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tirth8205#22) Squash-merge of PR tirth8205#22 by @clls1-stinger with fixups: - Use RETRIEVAL_QUERY task type for search queries (not RETRIEVAL_DOCUMENT) - Require explicit opt-in (no auto-detecting GOOGLE_API_KEY) - Keep lazy model loading for LocalEmbeddingProvider - Make embedding dimension dynamic per model - Move google-generativeai to separate [google-embeddings] optional extra - Fix tests to work with new provider-based architecture - Restore _check_available() for backward compatibility - Remove duplicate .mcp.json (credit: @n24q02m from tirth8205#35) Co-Authored-By: clls1-stinger <clls1-stinger@users.noreply.github.com> Co-Authored-By: n24q02m <n24q02m@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
This PR is superseded by current state: the invalid PostEdit/PostGit events were fixed, and PostToolUse is now used. However, the hooks schema is STILL broken (missing nested hooks array). PR #203 addresses the remaining schema issue. This PR is partially integrated but the deeper hooks schema fix still needs PR #203. |
Summary
Fixes two plugin issues that cause errors in Claude Code
/doctor:PostEditandPostGitare not valid Claude Code hook event types. Replaced withPostToolUse— the standard event for post-tool callbacks..mcp.jsonat repo root duplicates the MCP server already declared in.claude-plugin/plugin.jsonmcpServersfield. Removed.mcp.jsonsinceplugin.jsonis the canonical source for plugin installs. The CLIinstallcommand creates.mcp.jsonin the user's project root (not this repo), so non-plugin installs are unaffected.Closes #25
Closes #23
Details
Hook event mapping
PostEditPostToolUseWrite|EditPostGitPostToolUseBashWhy .mcp.json removal is safe
When installed as a plugin (`/plugin install`), Claude Code reads MCP server config from `plugin.json` → `mcpServers` field. The standalone `.mcp.json` is only needed for non-plugin installs via `code-review-graph install`, which creates `.mcp.json` in the user's project directory, not from this repo's copy.
Having both causes Claude Code to log:
```
MCP server "code-review-graph" skipped — same command/URL as already-configured "code-review-graph"
```
Supersedes
This PR supersedes #26 by also fixing the duplicate MCP issue in addition to the hooks fix.
Test plan
🤖 Generated with Claude Code