fix: update hooks.json to Claude Code plugin format (v0.6.1)#82
Conversation
- Add top-level 'hooks' wrapper key as required by Claude Code plugin spec - Add description field explaining hook purpose - Update version to 0.6.1 - Update CHANGELOG.md with fix details Fixes validation error: 'expected record, received undefined' This change aligns with the official plugin hooks format documented in Claude Code's plugin-dev/skills/hook-development guide, which requires plugin hooks.json to use wrapper format with top-level 'hooks' key. Resolves hook loading failures in Claude Code 2.1.51+.
📝 WalkthroughWalkthroughThis PR updates the Claude Code plugin from version 0.6.0 to 0.6.1, restructuring hooks.json to include a top-level "hooks" wrapper key and description field, updating the version number in plugin.json, and documenting changes in the CHANGELOG. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nowledge-mem-claude-code-plugin/CHANGELOG.md`:
- Line 8: The changelog entry header "## [0.6.1] - 2026-02-28" uses a future
date; update that header (the "## [0.6.1] - 2026-02-28" line) to either use
today's date "2026-02-27" or remove the date and mark it as "Unreleased" so
release chronology remains correct.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
nowledge-mem-claude-code-plugin/CHANGELOG.mdnowledge-mem-claude-code-plugin/hooks/hooks.jsonnowledge-mem-claude-code-plugin/plugin.json
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [0.6.1] - 2026-02-28 |
There was a problem hiding this comment.
Use a non-future release date (or keep it unreleased until cut).
Line 8 is dated 2026-02-28, which is in the future relative to this PR date (2026-02-27). This can confuse release chronology.
🛠️ Suggested adjustment
-## [0.6.1] - 2026-02-28
+## [0.6.1] - 2026-02-27📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## [0.6.1] - 2026-02-28 | |
| ## [0.6.1] - 2026-02-27 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@nowledge-mem-claude-code-plugin/CHANGELOG.md` at line 8, The changelog entry
header "## [0.6.1] - 2026-02-28" uses a future date; update that header (the "##
[0.6.1] - 2026-02-28" line) to either use today's date "2026-02-27" or remove
the date and mark it as "Unreleased" so release chronology remains correct.
|
THANKS SO MUCH for the contribution!!! |
问题描述
当前
nowledge-mem-claude-code-plugin/hooks/hooks.json的格式不符合 Claude Code 插件系统规范,导致插件加载时报错:根本原因
根据 Claude Code 官方文档,插件的
hooks.json必须使用顶层"hooks"包裹键:当前格式直接将事件名(
SessionStart)放在顶层,这是用户settings.json的格式,不是插件格式。修复内容
"hooks"键包裹所有事件配置"description"字段说明 hooks 用途兼容性
测试
在 Claude Code 2.1.62 上测试通过:
参考
Summary by CodeRabbit
Release Notes
Bug Fixes
Documentation
Chores