anthropics / anthropics/financial-services

financial-analysis@0.1.0: hooks/hooks.json contains `[]` which fails Claude Code schema validation (expects object)

Offen
#109 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
34.8k
Forks
5.2k
Ø Merge
2 Std. 2 Min.
Gemergte PRs (30 T.)
3

Beschreibung

## Summary

The `financial-analysis` plugin (v0.1.0) fails to load in Claude Code because `hooks/hooks.json` contains a literal empty array `[]`, but Claude Code's plugin loader validates that the root of `hooks.json` must be an object.

## Steps to reproduce

```bash
claude plugin marketplace add anthropics/financial-services-plugins
claude plugin install financial-analysis@claude-for-financial-services
claude plugin list
```

## Observed behavior

```
❯ financial-analysis@claude-for-financial-services
Version: 0.1.0
Scope: user
Status: ✘ failed to load
Error: Hook load failed: [
{
"expected": "object",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected object, received array"
}
]
```

The other agents installed alongside (`pitch-agent`, `model-builder`, `market-researcher`) load fine — they don't ship a `hooks.json`.

## Root cause

`plugins/vertical-plugins/financial-analysis/hooks/hooks.json` is currently:

```json
[]
```

Working plugins (e.g., `vercel@claude-plugins-official`) use the form:

```json
{ "hooks": { /* ... */ } }
```

So the `[]` is rejected at the root by the loader's schema.

## Suggested fix

Either:

**(a)** Replace the file content with an empty hooks object:

```json
{ "hooks": {} }
```

**(b)** Remove `hooks/hooks.json` entirely if `financial-analysis` is not intended to register any hooks (the loader treats absent files as "no hooks").

I can confirm that swapping `[]` to `{}` *alone* is **not** sufficient — the loader appears to additionally require the `hooks` key, and only `{ \"hooks\": {} }` (or a populated form) lets the plugin reach `Status: ✔ enabled`.

## Environment

- Claude Code: `2.1.132`
- OS: Windows 11 (Git Bash / mingw)
- Plugin: `financial-analysis@0.1.0`
- Marketplace: `claude-for-financial-services` (cloned from `anthropics/financial-services-plugins`)

## Workaround applied locally

Edited both copies (the marketplace clone and the install cache):

- `~/.claude/plugins/cache/claude-for-financial-services/financial-analysis/0.1.0/hooks/hooks.json`
- `~/.claude/plugins/marketplaces/claude-for-financial-services/plugins/vertical-plugins/financial-analysis/hooks/hooks.json`

Both replaced with `{ "hooks": {} }`. Both edits are needed because reinstall re-copies from the marketplace tree into the cache.

Happy to send a small PR if useful.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.