fix: replace invalid notification hook type with command hooks - #1
Open
ocrlegal wants to merge 1 commit into
Open
fix: replace invalid notification hook type with command hooks#1ocrlegal wants to merge 1 commit into
ocrlegal wants to merge 1 commit into
Conversation
hooks/hooks.json used "type": "notification" for PreToolUse and Stop hooks, which isn't a valid hook action type in the Claude Code schema (only "command" is supported). This caused the plugin to fail to load entirely on install. Replaced both with small command hooks that print the same reminder messages to stderr. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ibkcEcHyfcbXe7ErXQBUS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hooks/hooks.json used "type": "notification" for the PreToolUse and Stop hooks, which isn't a valid hook action type in the Claude Code hooks schema (only "command" is supported). This caused the entire plugin to fail to load after install (invalid_union / "No matching discriminator" on hooks.PreToolUse[0].hooks[0].type and hooks.Stop[0].hooks[0].type).
Replaced both with "type": "command" entries pointing at two new small scripts (scripts/hooks/pretooluse-reminder.js and scripts/hooks/session-end-reminder.js) that print the same reminder messages to stderr, following the existing convention used by the other hook scripts in this repo.
Type
Marketing Discipline
Testing
Installed the plugin locally via claude plugin marketplace add + claude plugin install and confirmed it failed to load with the schema validation error above. After this fix, reinstalling from the patched marketplace loads without error.
Checklist