2026-01-02 12:41:08 +11:00
|
|
|
#!/bin/bash
|
2026-01-02 17:09:39 +11:00
|
|
|
set -uo pipefail
|
|
|
|
|
|
|
|
|
|
command -v jq &>/dev/null || exit 0
|
|
|
|
|
|
2026-01-02 12:41:08 +11:00
|
|
|
INPUT=$(cat)
|
2026-01-02 17:09:39 +11:00
|
|
|
|
|
|
|
|
if ! echo "$INPUT" | jq empty 2>/dev/null; then
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // empty')
|
|
|
|
|
if [[ -z "$SESSION_ID" || ! "$SESSION_ID" =~ ^[a-zA-Z0-9_-]+$ ]]; then
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
2026-01-02 12:41:08 +11:00
|
|
|
HUD_DIR="$HOME/.claude/hud"
|
|
|
|
|
EVENT_FIFO="$HUD_DIR/events/$SESSION_ID.fifo"
|
|
|
|
|
|
2026-01-02 22:08:34 +11:00
|
|
|
# Only clean up the FIFO, not the HUD process
|
|
|
|
|
# HUD persists across sessions for /new and /resume
|
2026-01-02 12:41:08 +11:00
|
|
|
rm -f "$EVENT_FIFO"
|
|
|
|
|
|
|
|
|
|
exit 0
|