aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin/__claude-code-notify
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-28 15:38:32 +0900
committernsfisis <nsfisis@gmail.com>2026-06-28 15:38:32 +0900
commit8a49977396e93a7ec67cee3bd54ff085f9781d34 (patch)
tree363de231cbc3c1310904fe0f757d027a42f0b1c0 /bin/__claude-code-notify
parent8074c9f88bfbc2432fc320bd3ec0ae94f76fb650 (diff)
downloaddotfiles-8a49977396e93a7ec67cee3bd54ff085f9781d34.tar.gz
dotfiles-8a49977396e93a7ec67cee3bd54ff085f9781d34.tar.zst
dotfiles-8a49977396e93a7ec67cee3bd54ff085f9781d34.zip
claude: suppress notification while waiting for background tasks
Diffstat (limited to 'bin/__claude-code-notify')
-rwxr-xr-xbin/__claude-code-notify11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/__claude-code-notify b/bin/__claude-code-notify
index c499861..351f0d5 100755
--- a/bin/__claude-code-notify
+++ b/bin/__claude-code-notify
@@ -1,11 +1,20 @@
#!/usr/bin/env bash
-message="$(jq -r '.message // "Task completed"')"
+input="$(cat)"
+
+message="$(jq -r '.message // "Task completed"' <<<"$input")"
if [ "$message" = "Claude is waiting for your input" ]; then
exit # it's annoying
fi
+# Skip notification if any background task is still running.
+if [ "$1" = "Stop" ]; then
+ if jq -e '.background_tasks // [] | length > 0' >/dev/null 2>&1 <<<"$input"; then
+ exit
+ fi
+fi
+
if [ "$(uname)" = "Darwin" ]; then
if [ "$1" = "Stop" ]; then
sound=Glass