Video 01
You're babysitting Claude Code: the 3 settings
A sound when Claude needs you, a timer for every turn, and a status line with your limits. Five minutes to set up. Tested with Claude Code 2.1.
1 The timer script
Save it as ~/.claude/turn-time.sh. On Linux, use the paplay line from the comment instead of afplay.
Save it as C:\Users\YOUR-NAME\.claude\turn-time-windows.sh. Claude Code runs hooks in Git Bash on Windows, so it is a shell script here too.
After every answer it shows took 6m 12s, adds one line to ~/.claude/turns.csv
(date, seconds), and plays a sound only when the turn took longer than 30 seconds.
#!/bin/sh
# Stop hook: how long the last turn took (macOS / Linux). Video: "You're babysitting Claude Code" by Purrfect AI Labs.
# 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 (macOS sound; on Linux use: paplay /usr/share/sounds/freedesktop/stereo/complete.oga &)
[ "$t" -gt 30 ] && afplay /System/Library/Sounds/Glass.aiff &
printf '{"systemMessage": "took %dm %ds"}' $((t/60)) $((t%60))
#!/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))
2 The hooks
Open ~/.claude/settings.json (it applies to every project) and add the "hooks" part.
If your file already has a "hooks" part, add the three events into it.
{
"hooks": {
"Notification": [
{ "hooks": [{ "type": "command", "command": "afplay /System/Library/Sounds/Ping.aiff &" }] }
],
"UserPromptSubmit": [
{ "hooks": [{ "type": "command", "command": "date +%s > /tmp/turn_start" }] }
],
"Stop": [
{ "hooks": [{ "type": "command", "command": "sh ~/.claude/turn-time.sh" }] }
]
}
}
{
"hooks": {
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "powershell.exe -NoProfile -c \"[Media.SoundPlayer]::new('C:\\Windows\\Media\\Windows Notify System Generic.wav').PlaySync()\" &"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "date +%s > /tmp/turn_start"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "sh ~/.claude/turn-time-windows.sh"
}
]
}
]
}
}
- Notification: a sound when Claude needs your permission, or after about a minute of waiting for you.
Only permission prompts: add
"matcher": "permission_prompt". - UserPromptSubmit: saves the start time of the turn.
- Stop: runs the timer script.
Type /hooks in Claude Code to see that they are active.
The trick almost everybody gets wrong: Claude Code does not show plain text from a Stop hook.
Print JSON with a "systemMessage" instead. The timer script does this.
3 The status line
Type this in Claude Code. Claude writes the script and adds statusLine to your settings.
/statusline show model, context %, cost and the 5-hour limit
Turn it off
"disableAllHooks": true in settings.json turns every hook off.
/statusline delete removes the status line.
Docs: hooks · status line