diff options
Diffstat (limited to 'bin/__claude-code-notify')
| -rwxr-xr-x | bin/__claude-code-notify | 11 |
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 |
