mirror of
https://github.com/jarrodwatts/claude-hud.git
synced 2026-05-17 13:02:42 +00:00
25 lines
486 B
Bash
Executable File
25 lines
486 B
Bash
Executable File
#!/bin/bash
|
|
set -uo pipefail
|
|
|
|
command -v jq &>/dev/null || exit 0
|
|
|
|
INPUT=$(cat)
|
|
|
|
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
|
|
|
|
HUD_DIR="$HOME/.claude/hud"
|
|
EVENT_FIFO="$HUD_DIR/events/$SESSION_ID.fifo"
|
|
|
|
# Only clean up the FIFO, not the HUD process
|
|
# HUD persists across sessions for /new and /resume
|
|
rm -f "$EVENT_FIFO"
|
|
|
|
exit 0
|