Skip to content

Input Notification don't tell you which session needs your help #5

@dsinghjassal

Description

@dsinghjassal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions