#!/bin/bash
# Task completion notification hook for Claude Code
# Plays a sound when Claude Code completes a task

# Play system sound (Glass sound on macOS)
if [[ "$OSTYPE" == "darwin"* ]]; then
    # macOS
    afplay /System/Library/Sounds/Glass.aiff 2>/dev/null || echo "Task completed!"
elif command -v paplay &> /dev/null; then
    # Linux with PulseAudio
    paplay /usr/share/sounds/freedesktop/stereo/complete.oga 2>/dev/null || echo "Task completed!"
else
    # Fallback - just echo
    echo "🎉 Task completed!"
fi

# Optional: Show notification (requires terminal-notifier on macOS)
if command -v terminal-notifier &> /dev/null; then
    terminal-notifier -title "Claude Code" -message "Task completed!" -sound Glass
elif command -v notify-send &> /dev/null; then
    notify-send "Claude Code" "Task completed!"
fi