Stop hook does not fire consistently - intermittent triggering in same session

Resolved 💬 5 comments Opened Feb 3, 2026 by michaelaye Closed Apr 10, 2026

Description

The Stop hook configured in settings.json fires intermittently rather than after every assistant response. In the same session, some responses trigger the hook while others do not, with no apparent pattern.

Environment

  • Claude Code version: 2.1.30
  • OS: macOS (Darwin 25.2.0)
  • Shell: zsh

Configuration

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "${PAI_DIR}/hooks/StopOrchestrator.hook.ts"
          }
        ]
      }
    ]
  }
}

Steps to Reproduce

  1. Configure a Stop hook that logs to a file with timestamp
  2. Have a conversation with multiple back-and-forth exchanges
  3. Check the log file after each response

Expected Behavior

Stop hook should fire after every assistant response, logging an entry each time.

Actual Behavior

  • Hook fires for some responses but not others
  • Gaps of 4+ minutes between logged events despite multiple responses in that time
  • When hook does fire later, audio/notifications from old responses play, overlapping with current context
  • No errors in hook script - it works correctly when manually tested

Evidence

Voice event log showing gaps (timestamps in PST):

14:01:22 - "Removed tableofcontents extension..."
[4 minute gap with multiple responses - no events logged]

Hook script tested manually - works correctly:

echo '{"session_id":"test","transcript_path":"/tmp/test"}' | bun run StopOrchestrator.hook.ts
# Executes successfully

Workaround

None found. Restarting Claude Code temporarily improves reliability but issue recurs.

Impact

High - Stop hooks are used for voice notifications, session capture, and other post-response automation. Intermittent firing makes these features unreliable.

View original on GitHub ↗

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