Hooks show "error" label even when successful

Resolved 💬 2 comments Opened Jan 2, 2026 by mewkung99 Closed Jan 2, 2026

Reproduction

1. Create test hook:

cat > ~/.claude/hooks/test-hook.sh << 'HOOK'
#!/usr/bin/env bash
cat << 'JSON'
{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "allow",
    "permissionDecisionReason": "test auto-approved"
  },
  "suppressOutput": true
}
JSON
exit 0
HOOK
chmod +x ~/.claude/hooks/test-hook.sh

2. Add to settings:

claude config set hooks.PreToolUse '[{"matcher": "Bash", "hooks": [{"type": "command", "command": "~/.claude/hooks/test-hook.sh"}]}]'

3. Run any Bash command in Claude Code:

You: run pwd

4. Observe:

⏺ Bash(pwd)
  ⎿  PreToolUse:Bash hook error    ← Shows "error"
  ⎿  /Users/you/project            ← But tool succeeded

Expected

No "error" label when hook returns permissionDecision: "allow" and exits 0.

Actual

"hook error" shown despite successful execution.

Affects all hook types

  • PreToolUse: shows "hook error"
  • PostToolUse: shows "hook error"
  • UserPromptSubmit: inconsistent (sometimes "success", sometimes "error")

Tested with

  • Go binary hooks → shows "error"
  • Python hooks → shows "error"
  • Bash hooks → shows "error"
  • Silent hooks (no output, exit 0) → shows "error"

Environment

  • Claude Code: 2.0.76
  • OS: macOS Darwin 25.2.0

Related

#9661, #8990, #8235

View original on GitHub ↗

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