Bug: winsound.PlaySound missing SND_SYNC flag causes sounds to be cut off on Windows
Description
In .claude/hooks/scripts/hooks.py, the play_sound() function on Windows calls winsound.PlaySound without the SND_SYNC flag. The code comment explicitly says SND_SYNC should be used, but the flag is omitted from the actual call.
Affected Code
winsound.PlaySound(str(file_path),
winsound.SND_FILENAME | winsound.SND_NODEFAULT)
# Missing: | winsound.SND_SYNC
Code Comment vs Reality
The comment directly above this call reads:
# Note: Using SND_SYNC instead of SND_ASYNC because the script exits immediately after this call, which would terminate async playback before it completes
Despite this comment, SND_SYNC is not included in the flags. Without SND_SYNC, winsound.PlaySound defaults to asynchronous playback. Since the script exits right after, the sound is cut off immediately and never plays completely on Windows.
Fix
winsound.PlaySound(str(file_path),
winsound.SND_FILENAME | winsound.SND_NODEFAULT | winsound.SND_SYNC)
Impact
Hook sounds never play to completion on Windows — the script exits before the async audio thread finishes.
Bug:
winsound.PlaySoundmissingSND_SYNCflag causes sounds to be cut off on WindowsDescription
In
.claude/hooks/scripts/hooks.py, theplay_sound()function on Windows callswinsound.PlaySoundwithout theSND_SYNCflag. The code comment explicitly saysSND_SYNCshould be used, but the flag is omitted from the actual call.Affected Code
Code Comment vs Reality
The comment directly above this call reads:
Despite this comment,
SND_SYNCis not included in the flags. WithoutSND_SYNC,winsound.PlaySounddefaults to asynchronous playback. Since the script exits right after, the sound is cut off immediately and never plays completely on Windows.Fix
Impact
Hook sounds never play to completion on Windows — the script exits before the async audio thread finishes.