From 8a49977396e93a7ec67cee3bd54ff085f9781d34 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 28 Jun 2026 15:38:32 +0900 Subject: claude: suppress notification while waiting for background tasks --- bin/__claude-code-notify | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin') 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 -- cgit v1.3.1