Title is self explanatory, input notification don't tell you which session needs you help, I actually build this warp claude notifcation by myself as well for work use.
Sharing the code:
#!/bin/bash
INPUT=$(cat)
TRANSCRIPT=$(echo "$INPUT" | jq -r '.transcript_path')
# Get first ~100 words of the last assistant text response
MSG=$(jq -r 'select(.type=="assistant") | .message.content[] | select(.type=="text") | .text' \
"$TRANSCRIPT" 2>/dev/null | tail -1 | tr '
' ' ' | \
awk '{for(i=1;i<=100&&i<=NF;i++) printf "%s ", $i; print ""}' | sed 's/ $//')
terminal-notifier -title 'Claude Code' -message "${MSG:-Prompt finished}" -sound Glass -timeout 0
This was my bash script that activates on hooks, I spend some time but was not able to make it completely work (to print which terminal neded my attention), though it still did the job to some extent.
Title is self explanatory, input notification don't tell you which session needs you help, I actually build this warp claude notifcation by myself as well for work use.
Sharing the code:
This was my bash script that activates on hooks, I spend some time but was not able to make it completely work (to print which terminal neded my attention), though it still did the job to some extent.