Complete real-time monitoring dashboard for Claude Code Features: - FastAPI backend with REST API and WebSocket - React + TypeScript frontend with dark theme - SQLite database for event storage - 6 hook scripts for Claude Code events - Docker deployment setup - Real-time event tracking and statistics - Event filtering (ALL, TOOLS, AGENTS, PROMPTS, SESSIONS) - Connection status indicator - Reset stats functionality Tech Stack: - Backend: Python 3.11, FastAPI, SQLAlchemy, WebSockets - Frontend: React 18, TypeScript, Vite - Database: SQLite - Deployment: Docker, Docker Compose 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
35 lines
824 B
Bash
Executable File
35 lines
824 B
Bash
Executable File
#!/bin/bash
|
|
# Session End Hook for Claude Code Monitor
|
|
# Captures session termination events
|
|
|
|
# Read JSON from stdin
|
|
INPUT=$(cat)
|
|
|
|
# Extract fields using jq
|
|
SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // "unknown"')
|
|
TIMESTAMP=$(echo "$INPUT" | jq -r '.timestamp // (now | tonumber)')
|
|
|
|
# Build payload for backend
|
|
PAYLOAD=$(jq -n \
|
|
--arg session_id "$SESSION_ID" \
|
|
--arg event_type "SessionEnd" \
|
|
--arg timestamp "$TIMESTAMP" \
|
|
'{
|
|
session_id: $session_id,
|
|
event_type: $event_type,
|
|
timestamp: ($timestamp | tonumber)
|
|
}')
|
|
|
|
# Send to backend API (asynchronous, non-blocking)
|
|
curl -X POST \
|
|
-H "Content-Type: application/json" \
|
|
-d "$PAYLOAD" \
|
|
http://localhost:8000/api/events \
|
|
--max-time 2 \
|
|
--silent \
|
|
--show-error \
|
|
> /dev/null 2>&1 &
|
|
|
|
# Exit immediately (don't wait for curl)
|
|
exit 0
|