Documentation: Stop/SubagentStop hooks show incorrect JSON schema

Resolved 💬 3 comments Opened Jan 9, 2026 by AgileInnov8tor Closed Jan 10, 2026

Summary

The hooks documentation at https://code.claude.com/docs/en/hooks shows an incorrect JSON response schema for Stop and SubagentStop hooks, causing schema validation errors for users following the documentation.

Current Documentation (Incorrect)

The docs currently show:

To allow stopping:

{}

To prevent stopping:

{"decision": "block", "reason": "explanation"}

Actual Required Schema

Through testing, we discovered the actual schema validator expects:

To allow stopping:

{"ok": true}

To prevent stopping:

{"ok": false, "reason": "explanation"}

Error When Following Documentation

When using the documented {} format, users receive this error:

Stop hook error: Schema validation failed: [
  {
    "expected": "boolean",
    "code": "invalid_type",
    "path": ["ok"],
    "message": "Invalid input: expected boolean, received undefined"
  }
]

The error message clearly indicates the validator expects an "ok" field with a boolean value, which contradicts the current documentation.

Steps to Reproduce

  1. Configure a Stop or SubagentStop prompt hook following the current documentation
  2. Use {} to allow stopping or {"decision": "block", "reason": "..."} to prevent
  3. Trigger the hook by ending a Claude Code session
  4. Observe schema validation error

Expected Behavior

Documentation should match the actual schema validator expectations.

Environment

  • Claude Code CLI (latest as of 2026-01-08)
  • macOS Darwin 25.2.0

Workaround

Use {"ok": true} or {"ok": false, "reason": "..."} instead of the documented format.

Additional Context

This was discovered during Epic 1 of a hooks bug fix project. Full details in our retrospective notes. The fix was verified to work correctly after updating to the {"ok": boolean} schema.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗