Task Completion Sound Hook
Plays a completion chime when Claude finishes a task, with optional transcript logging. Distinct from notification sounds -- this one signals 'done' so you know the task is complete without checking.
Hook Type
PostToolUse -- Runs after Claude completes tool usage (configured to trigger on stop/completion events).
Description
Plays a distinct completion sound when Claude finishes a task, differentiating it from the notification sound that plays when input is needed. Optionally logs a timestamped transcript of the conversation for audit purposes.
Patterns/Rules
- Plays a different sound than the notification hook so you can distinguish "done" from "needs input"
- Optional transcript logging captures the full interaction for review
- Sound plays asynchronously to avoid blocking
- Log files are timestamped and stored in a configurable directory
Configuration
Add to .claude/settings.json:
Basic (Sound Only)
{ "hooks": { "Stop": [ { "matcher": "", "hooks": [ { "type": "command", "command": "afplay /System/Library/Sounds/Purr.aiff &" } ] } ] } }
Advanced (Sound + Transcript Logging)
{ "hooks": { "Stop": [ { "matcher": "", "hooks": [ { "type": "command", "command": ".claude/hooks/completion.sh" } ] } ] } }
Action
Completion script (.claude/hooks/completion.sh):
#!/bin/bash # Play completion sound and optionally log transcript LOG_DIR="$HOME/.claude/logs" mkdir -p "$LOG_DIR" # Play a distinctive completion sound (different from notification) if [[ "$OSTYPE" == "darwin"* ]]; then afplay /System/Library/Sounds/Purr.aiff & elif command -v paplay &>/dev/null; then paplay /usr/share/sounds/freedesktop/stereo/complete.oga & fi # Log completion timestamp TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S') PROJECT=$(basename "$PWD") echo "[$TIMESTAMP] Task completed in $PROJECT" >> "$LOG_DIR/completions.log"
Recommended Sound Pairing
| Event | macOS Sound | Purpose |
|---|---|---|
| Needs input | Glass.aiff | "Hey, look at me" |
| Task done | Purr.aiff | "All finished" |
| Error | Sosumi.aiff | "Something went wrong" |
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Pre-Commit Security Scanner
Pre-commit hook that scans staged files for hardcoded secrets, API keys, passwords, and sensitive data patterns before allowing commits.
Agents Md Watcher
Streamline your workflow with this automatically, loads, agents, configuration. Includes structured workflows, validation checks, and reusable patterns for automation.
Automated Build Inspector
Boost productivity using this automatically, trigger, build, processes. Includes structured workflows, validation checks, and reusable patterns for automation.