mirror of
https://github.com/jarrodwatts/claude-hud.git
synced 2026-05-04 19:42:40 +00:00
Phase 1 of v2 upgrade: - Add PreToolUse hook for true "running" state before tool execution - Add UserPromptSubmit hook to track user prompts and idle state - Add Stop hook for idle detection when Claude finishes responding - Add PreCompact hook to track context compaction events - Enrich capture-event.sh with permission_mode, transcript_path, cwd - Add CostTracker for session cost estimation - Add SessionInfo type for tracking session state - Show idle indicator (💤/⚡) and permission mode in header - Show cost estimate when significant - Show compaction count warning - Show last user prompt preview 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
23 lines
535 B
Bash
Executable File
23 lines
535 B
Bash
Executable File
#!/bin/bash
|
|
INPUT=$(cat)
|
|
SESSION_ID=$(echo "$INPUT" | jq -r '.session_id')
|
|
EVENT_FIFO="$HOME/.claude/hud/events/$SESSION_ID.fifo"
|
|
|
|
if [ -p "$EVENT_FIFO" ]; then
|
|
echo "$INPUT" | jq -c '{
|
|
event: .hook_event_name,
|
|
tool: .tool_name,
|
|
toolUseId: .tool_use_id,
|
|
input: .tool_input,
|
|
response: .tool_response,
|
|
session: .session_id,
|
|
permissionMode: .permission_mode,
|
|
transcriptPath: .transcript_path,
|
|
cwd: .cwd,
|
|
prompt: .prompt,
|
|
ts: (now | floor)
|
|
}' >> "$EVENT_FIFO" 2>/dev/null || true
|
|
fi
|
|
|
|
exit 0
|