Misleading 'Failed with non-blocking status code' message for successful SessionStart hooks

Open 💬 1 comment Opened Jun 10, 2026 by pascals-ager

Description

When a SessionStart hook exits with code 0 (success), Claude Code displays:

Failed with non-blocking status code: 🔍 Claude Code Trust Preflight...

This is confusing because nothing actually failed — the hook succeeded and the session continued.

Expected behavior

Show a success message like:

  • ✅ "Session ready"
  • ✅ "Trust validation complete"
  • ✅ "Preflight checks passed"

Actual behavior

Shows "Failed with non-blocking status code" even though exit code 0 = success

Hook script details

  • Script exits with exit 0 after all validations pass
  • stderr shows ✅ All trust validations passed
  • Session continues correctly (no actual failure)

Impact

Users think something went wrong when everything is working correctly. The word "Failed" implies an error state that doesn't exist.

Suggested fix

Display different messages based on exit code:

  • Exit 0 → "✅ Session ready" or similar success message
  • Exit 2 → "❌ Blocked: [reason]" for actual failures

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗