ralph-loop plugin: hooks.json has invalid schema (causes Stop hook JSON validation error)
Resolved 💬 5 comments Opened Mar 5, 2026 by IanVand Closed Apr 4, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The ralph-loop plugin's hooks/hooks.json has an invalid structure that fails JSON schema validation at session end, producing:
Stop hook error: JSON validation failed
The current hooks.json is:
{
"description": "Ralph Loop plugin stop hook for self-referential loops",
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh"
}
]
}
]
}
}
Three problems:
- Extra
"description"field — not part of the hooks.json schema - Nested
"hooks"wrapper — the Stop array is inside{ "hooks": { "Stop": [...] } }instead of at the top level{ "Stop": [...] } - Missing
"matcher"field — each hook entry requires a"matcher"(e.g.,"*")
What Should Happen?
The hooks.json should match the valid schema:
{
"Stop": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh"
}
]
}
]
}
Error Messages/Logs
Stop hook error: JSON validation failed
Steps to Reproduce
- Install the
ralph-loopplugin fromclaude-plugins-official - Start a Claude Code session
- End the session (the Stop hook fires)
- Observe "Stop hook error: JSON validation failed"
Claude Model
Opus
Is this a regression?
I don't know
Claude Code Version
2.3.1
Platform
Direct API
Operating System
Windows 11
Terminal/Shell
Git Bash (MSYS2)
Additional Information
Workaround: manually edit both ~/.claude/plugins/marketplaces/claude-plugins-official/plugins/ralph-loop/hooks/hooks.json and the corresponding file in ~/.claude/plugins/cache/claude-plugins-official/ralph-loop/*/hooks/hooks.json to the corrected schema above.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗