diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-28 15:38:32 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-28 15:38:32 +0900 |
| commit | 8a49977396e93a7ec67cee3bd54ff085f9781d34 (patch) | |
| tree | 363de231cbc3c1310904fe0f757d027a42f0b1c0 | |
| parent | 8074c9f88bfbc2432fc320bd3ec0ae94f76fb650 (diff) | |
| download | dotfiles-8a49977396e93a7ec67cee3bd54ff085f9781d34.tar.gz dotfiles-8a49977396e93a7ec67cee3bd54ff085f9781d34.tar.zst dotfiles-8a49977396e93a7ec67cee3bd54ff085f9781d34.zip | |
claude: suppress notification while waiting for background tasks
| -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 |
