Stop hooks: non-blocking exit reported as 'error' in UI

Resolved 💬 3 comments Opened Mar 27, 2026 by brohirrim Closed Mar 31, 2026

Bug

Stop hooks that exit cleanly without blocking are displayed as errors in the UI:

● Ran 2 stop hooks (ctrl+o to expand)
  ⎿  Stop hook error: Failed with non-blocking status code: No stderr output

Expected behavior

A stop hook that exits 0 without outputting {"decision": "block"} should be reported as successful, not as an error. The hook did its job — it evaluated whether to block and decided not to.

Reproduction

  1. Register any stop hook (e.g. via a plugin hooks.json)
  2. Have it exit 0 with no output, or exit 0 with {"decision": "approve"}
  3. End a session

Both cases produce the same "Stop hook error" message.

Impact

  • Every plugin that registers a Stop hook (e.g. ralph-loop) causes a spurious error on every session end when the hook isn't actively blocking
  • Users see red "error" text on every session exit, creating alert fatigue
  • We spent significant debugging time chasing this before realizing the "error" is cosmetic

Suggested fix

If a stop hook exits 0 and either:

  • Produces no output (implicit allow), or
  • Returns {"decision": "approve"}

It should display as a successful hook run, not an error.

Reserve "Stop hook error" for actual failures: non-zero exit, invalid JSON, schema validation errors.

---
🤖 Generated with Claude Code

View original on GitHub ↗

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