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
- Configure a Stop hook in
~/.claude/settings.json:
{
"hooks": {
"Stop": [{
"matcher": "",
"hooks": [{
"type": "command",
"command": "python C:/Users/User/.claude/hooks/speak.py"
}]
}]
}
}
- Start a Claude Code session
- The hook fires correctly for multiple responses (verified via debug log timestamps)
- After ~10-15 assistant turns, the hook silently stops being invoked
- Manual invocation via
echo '{"session_id":"test",...}' | python speak.pystill works perfectly - 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)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗