What
When a hook prints something Claude Code cannot read as JSON, the message now says which failure it was and includes the hook's exit code and stderr.
Details
- Parsing distinguishes plain text, valid JSON, several JSON documents run together, and output that looks like JSON but is not.
- The last case advises using a real encoder: "Emit the payload with a JSON encoder (jq, ConvertTo-Json, json.dumps) rather than string concatenation so backslashes and quotes inside strings are escaped."
Evidence
Emit the payload with a JSON encoder (jq, ConvertTo-Json, json.dumps) rather than string concatenation so backslashes and quotes inside strings are escaped.
Strings lifted out of the shipped bundle, so the claim above can be checked against them.