fix(fp-check): use correct JSON response format in stop hooks#129
fix(fp-check): use correct JSON response format in stop hooks#129jonathanreedmevs wants to merge 2 commits intotrailofbits:mainfrom
Conversation
Prompt-type stop hooks must respond with JSON. The previous prompts
instructed Claude to return plain text ('block' or 'approve'), causing
'Stop hook error: JSON validation failed' on every session end.
Updated both Stop and SubagentStop hook prompts to respond with:
- {"decision": "block", "reason": "..."} to prevent stopping
- {} to allow stopping (omitting decision field per Claude Code docs)
Bug discovered by Claude while debugging the JSON validation error
during active use of the fp-check skill.
Automated Review — PR #129Flagged for human review (touches hooks) Review Findings1. BLOCKER: marketplace.json deletes dimensional-analysis entry This branch is based on 2. Hook JSON response format is correct The fix correctly addresses a real bug. Per Claude Code docs, prompt-type Stop hooks must return JSON. The old prompts instructed Claude to return plain text ( The new format uses:
3. Overlap with PR #137 PR #137 fixes the same bug with a slightly different approach:
Both are valid per the docs. PR #137 also includes the These two PRs will conflict — they both modify the same lines in 4. Version bump is correct
5. No security concerns The change is prompt text only. No executable code, no path changes, no new dependencies. Validation
Action Items
Changes MadeNone — review only. Reviewed by Claude Code |
Summary
StopandSubagentStophook prompts were instructing Claude to return plain text ('block'or'approve')Stop hook error: JSON validation failedon every session end{"decision": "block", "reason": "..."}to block, or{}to allow stoppingRoot Cause
The hook prompts on line 10 and line 22 ended with:
Claude Code parses the hook response as JSON. Plain text fails JSON validation, producing the error even though the hook logic itself was correct.
Fix
Replace plain-text return instructions with explicit JSON response format matching the Claude Code stop hook schema (
decisionfield). Bump version to1.0.1so installed clients receive the update.Same change applies to the
SubagentStopprompt on line 22.Discovery
Bug discovered by Claude while debugging the
Stop hook error: JSON validation failederror during active use of the fp-check skill.Bug Replication
Stop hook error: JSON validation failedappears