#!/bin/sh # Stop hook: how long the last turn took (Windows: Claude Code runs hooks in Git Bash). # Needs the UserPromptSubmit hook that writes the start time: date +%s > /tmp/turn_start t=$(( $(date +%s) - $(cat /tmp/turn_start) )) echo "$(date '+%F %T'),$t" >> ~/.claude/turns.csv # the ding only for turns longer than 30 s [ "$t" -gt 30 ] && powershell.exe -NoProfile -c "[Media.SoundPlayer]::new('C:\Windows\Media\notify.wav').PlaySync()" & printf '{"systemMessage": "took %dm %ds"}' $((t/60)) $((t%60))