[BUG] claude plugin validate passes a marketplace entry with hooks as a path or array, but the installed plugin fails to load

Open Beginner friendly
#108,218 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli, tooling

Research direction

Start at the claude plugin validate marketplace entry validation path and compare its handling of hooks with the loader error described in the issue. Find the validator tests for marketplace entries, then add coverage for string and array values. Done means validation reports the unsupported forms as errors with the loader’s message.

Written by the indexing model from the issue text.

Description

area:plugins bug has repro platform:linux
What's wrong?

claude plugin validate passes a marketplace entry whose hooks field is a file path (or an array). claude plugin install then succeeds, but the installed plugin fails to load:

Status: ✘ failed to load
Error: Hook load failed: hooks: the file-path and array forms are not yet supported in a marketplace entry. Define hooks in the plugin's own hooks/hooks.json (or its plugin.json), or inline them here as an object mapping hook event names to matcher arrays.

The loader already knows these forms are unsupported. The validator should report the same thing as an error, so authors find out before they publish instead of after users install.

Steps to reproduce

.claude-plugin/marketplace.json:

{
  "name": "hooks-repro",
  "owner": {"name": "Example"},
  "plugins": [
    {
      "name": "greeter",
      "source": "./plugins/greeter",
      "description": "Says hello at session start",
      "hooks": "./hooks/hooks.json"
    }
  ]
}

plugins/greeter/hooks/hooks.json:

{"hooks": {"SessionStart": [{"hooks": [{"type": "command", "command": "echo hello"}]}]}}

Then:

claude plugin validate .                       # ✔ Validation passed with warnings (only: no marketplace description)
claude plugin marketplace add "$PWD"
claude plugin install greeter@hooks-repro      # ✔ Successfully installed
claude plugin list                             # Status: ✘ failed to load (error above)

An array value ("hooks": ["./hooks/hooks.json"]) behaves the same way.

Expected

claude plugin validate fails on an entry hooks that is a string or an array, with the same message the loader gives.

Environment
  • Claude Code 2.1.319
  • Linux

Related: #54810 (the "Will install" preview lists a string hooks path as character indices).

Dominant language
TypeScript
Stars
154k
Forks
25.6k
Avg merge
12h 27m
Merged PRs (30d)
4

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.