# Hook JSON Output

> A JSON reply from a hook. It can say more than an exit code.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** hookSpecificOutput, decision block, continue false

## Think of it like

It is like you fill in a form. You do not just say yes or no.

## Definition

Hook JSON output is a JSON object a hook prints to stdout, with exit 0, to give a richer answer than an exit code. Some fields work on every event, such as continue set to false to stop Claude. Some events read decision and reason. PreToolUse and a few others use a hookSpecificOutput object. The JSON must be the only thing printed.

## Example

Jack's hook printed a JSON answer, but nothing happened. His shell profile echoed a line first. He silences it, and the JSON works.

## Example code

```json
{
  "continue": false,
  "stopReason": "Build failed. Fix the errors before you go on."
}
```

Stop Claude, and say why.

## Why it matters

Exit codes can only block or pass. JSON can allow, ask, add context or change input.

## Common mistake

Printing other text along with the JSON. Then it is read as plain text, not as JSON.

## Three principles

- **Exit 0 and print.** One object.
- **Shared and event fields.** continue, decision.
- **Nothing else on stdout.** Or it is text.

## Related terms

- [Hook Exit Code](https://learn.benibix.com/term/ai/hook-exit-code)
- [additionalContext](https://learn.benibix.com/term/ai/hook-additional-context)
- [PreToolUse Hook](https://learn.benibix.com/term/ai/pretooluse-hook)

---

Source: https://learn.benibix.com/term/ai/hook-json-output
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
