Skip to content

hooks/hooks.json fails schema validation: matcher entries missing nested "hooks" array #2

@takekaraka

Description

@takekaraka

Claude Code /doctor reports a hook load failure for this plugin (v2.1.0 / latest):

Hook load failed: expected array, received undefined
  path: ["hooks","PreToolUse",0,"hooks"]
  path: ["hooks","PreToolUse",1,"hooks"]
  path: ["hooks","PostToolUse",0,"hooks"]
  path: ["hooks","PostToolUse",1,"hooks"]

Cause

In hooks/hooks.json, each matcher entry places type/command/timeout directly on the matcher object. The current Claude Code hooks schema requires those to be nested inside a hooks array per matcher entry. Because the hooks key is missing, validation fails and none of the plugin hooks load.

Current (invalid)

"PreToolUse": [
  {
    "matcher": "generate_tts|generate_music|...",
    "type": "command",
    "command": "sh scripts/check-mcp-server.sh remotion-media KIE_API_KEY",
    "timeout": 5000
  }
]

Fix (valid)

"PreToolUse": [
  {
    "matcher": "generate_tts|generate_music|...",
    "hooks": [
      {
        "type": "command",
        "command": "sh scripts/check-mcp-server.sh remotion-media KIE_API_KEY",
        "timeout": 5000
      }
    ]
  }
]

Same wrapping is needed for both PreToolUse entries and both PostToolUse entries.

Environment

  • Claude Code on macOS (Darwin 23.6.0)
  • Plugin: remotion-superpowers @ dojocodinglabs, v2.1.0

Happy to open a PR if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions