fix(fp-check): use correct JSON response format in stop hooks#129
Open
jonathanreedmevs wants to merge 1 commit intotrailofbits:mainfrom
Open
fix(fp-check): use correct JSON response format in stop hooks#129jonathanreedmevs wants to merge 1 commit intotrailofbits:mainfrom
jonathanreedmevs wants to merge 1 commit 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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