Stop hook intermittently stops firing mid-session

Resolved 💬 3 comments Opened Mar 8, 2026 by NoEndsNoGains Closed Mar 11, 2026

Description

The Stop hook (configured in settings.json under hooks.Stop) intermittently stops being invoked mid-session. The hook works correctly for several assistant turns, then silently stops being called. No error, no crash — it just stops firing.

Steps to reproduce

  1. Configure a Stop hook in ~/.claude/settings.json:
{
  "hooks": {
    "Stop": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "python C:/Users/User/.claude/hooks/speak.py"
      }]
    }]
  }
}
  1. Start a Claude Code session
  2. The hook fires correctly for multiple responses (verified via debug log timestamps)
  3. After ~10-15 assistant turns, the hook silently stops being invoked
  4. Manual invocation via echo '{"session_id":"test",...}' | python speak.py still works perfectly
  5. Starting a new session restores hook functionality

Expected behavior

The Stop hook should fire on every assistant turn for the entire session.

Actual behavior

Hook fires correctly for the first ~10-15 turns, then stops being called. No error output. No crash log. The hook process isn't stuck (no orphaned python/ffplay processes).

Environment

  • Claude Code version: 2.1.71
  • OS: Windows 11
  • Hook type: command (python script)
  • Hook event: Stop (no matcher filter)

View original on GitHub ↗

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