diff --git a/.claude/hooks/notify.ps1 b/.claude/hooks/notify.ps1 new file mode 100644 index 000000000..20b49a249 --- /dev/null +++ b/.claude/hooks/notify.ps1 @@ -0,0 +1,9 @@ +Add-Type -AssemblyName System.Windows.Forms +$n = New-Object System.Windows.Forms.NotifyIcon +$n.Icon = [System.Drawing.SystemIcons]::Information +$n.Visible = $true +$n.BalloonTipTitle = "Claude Code" +$n.BalloonTipText = "Awaiting your input" +$n.ShowBalloonTip(5000) +Start-Sleep -Milliseconds 5100 +$n.Dispose() diff --git a/.claude/hooks/notify.py b/.claude/hooks/notify.py new file mode 100644 index 000000000..d839ea66f --- /dev/null +++ b/.claude/hooks/notify.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +import os +import platform +import subprocess + +system = platform.system() +script_dir = os.path.dirname(os.path.abspath(__file__)) + +if system == "Darwin": + subprocess.run([ + "osascript", "-e", + 'display notification "Awaiting your input" with title "Claude Code"' + ]) +elif system == "Windows": + ps1_path = os.path.join(script_dir, "notify.ps1") + subprocess.run([ + "powershell", "-NoProfile", "-ExecutionPolicy", "Bypass", + "-File", ps1_path + ]) diff --git a/.claude/settings.json b/.claude/settings.json index 86e70b686..f6c5b8ec9 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -9,7 +9,7 @@ "hooks": [ { "type": "command", - "command": "osascript -e 'display notification \"Awaiting your input\" with title \"Claude Code\"'" + "command": "python3 .claude/hooks/notify.py 2>/dev/null || python .claude/hooks/notify.py" } ] } @@ -20,7 +20,7 @@ "hooks": [ { "type": "command", - "command": "python3 .claude/hooks/post-edit-check.py" + "command": "python3 .claude/hooks/post-edit-check.py 2>/dev/null || python .claude/hooks/post-edit-check.py" } ] }