Created
June 16, 2026 23:41
-
-
Save orlenko/bc4e8b2eceb8a03dc1537e8a598289a2 to your computer and use it in GitHub Desktop.
Voice mute/unmute for claude stop voice hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # voice β control the Claude Code voice-stop hook. | |
| # Presence of ~/.claude/voice.muted disables spoken output; muted turns | |
| # pop a macOS notification with the same text instead. | |
| set -e | |
| FLAG="$HOME/.claude/voice.muted" | |
| cmd="${1:-status}" | |
| print_status() { | |
| if [ -f "$FLAG" ]; then | |
| echo "π muted (notifications still shown)" | |
| else | |
| echo "π unmuted" | |
| fi | |
| } | |
| case "$cmd" in | |
| mute|off) | |
| mkdir -p "$(dirname "$FLAG")" | |
| touch "$FLAG" | |
| print_status | |
| ;; | |
| unmute|on) | |
| rm -f "$FLAG" | |
| print_status | |
| ;; | |
| toggle) | |
| if [ -f "$FLAG" ]; then | |
| rm -f "$FLAG" | |
| else | |
| mkdir -p "$(dirname "$FLAG")" | |
| touch "$FLAG" | |
| fi | |
| print_status | |
| ;; | |
| status|"") | |
| print_status | |
| ;; | |
| -h|--help|help) | |
| cat <<'EOF' | |
| voice β mute/unmute the Claude Code voice hook | |
| usage: | |
| voice show current state | |
| voice status show current state | |
| voice mute silence voice; still pops macOS notifications | |
| voice unmute restore voice | |
| voice toggle flip current state | |
| state file: ~/.claude/voice.muted | |
| hook: ~/.claude/hooks/voice-stop.sh | |
| EOF | |
| ;; | |
| *) | |
| echo "voice: unknown command '$cmd' (try: voice help)" >&2 | |
| exit 1 | |
| ;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment