Commit Graph

16 Commits

Author SHA1 Message Date
felix.zoesch
78d4a9d3c0 Add diagnostic tools for hook debugging
Added two helper scripts:
- debug_hook.sh: Logs hook calls and connectivity tests
- diagnose.sh: Comprehensive diagnostic tool for troubleshooting

The diagnose script checks:
- Config file existence and content
- Backend connectivity
- Hook installation and permissions
- Manual hook testing
- settings.json configuration
- Debug logs

Usage: bash .claude/hooks/diagnose.sh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-16 08:18:18 +01:00
felix.zoesch
4582ead572 Add config file support for hook backend URL
Hooks now read backend URL from ~/.claude/monitor_url config file,
making it easier to configure for remote/VM deployments without
relying on environment variables.

Priority order:
1. Config file (~/.claude/monitor_url)
2. Environment variable (CLAUDE_MONITOR_URL)
3. Default (http://localhost:8000)

This fixes the issue where Claude Code doesn't see environment
variables when not started from a configured shell.

Usage:
  echo "http://your-vm:8000" > ~/.claude/monitor_url
  cp .claude/hooks/*.sh ~/.claude/hooks/
  chmod +x ~/.claude/hooks/*.sh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-16 08:06:14 +01:00
felix.zoesch
8b35d95e9b Make hooks configurable for remote/VM deployments
All hooks now use CLAUDE_MONITOR_URL environment variable to allow
configuration for remote deployments. Defaults to http://localhost:8000
for local development.

Changes:
- All hooks now read CLAUDE_MONITOR_URL from environment
- Added README.md with installation instructions for local and remote setups
- Includes troubleshooting guide for common issues

Usage:
  export CLAUDE_MONITOR_URL="http://vm-ip:8000"
  cp -r .claude/hooks/* ~/.claude/hooks/
  chmod +x ~/.claude/hooks/*.sh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 16:16:43 +01:00
felix.zoesch
e19f500fb0 Add nginx reverse proxy for VM deployment
Configure nginx to proxy API and WebSocket requests to backend.
This allows the frontend to work on VMs without hardcoded localhost URLs.

Changes:
- nginx.conf: Added proxy rules for /api/, /ws, and /health
- client.ts: Use relative URLs in production mode
- websocket.ts: Dynamically construct WebSocket URL based on current host

This fixes ERR_BLOCKED_BY_CLIENT and connection issues on VMs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 16:03:44 +01:00
felix.zoesch
267425806d Fix tool_input JSON parsing for text prompts
The backend was always trying to parse tool_input as JSON, which
failed for UserPromptSubmit events that contain plain text prompts.
This caused 500 errors when creating or fetching UserPromptSubmit events.

Fixed by adding try-except blocks that gracefully handle both JSON
and plain text tool_input values.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 12:24:21 +01:00
felix.zoesch
d842bc02ad Remove unused imports in EventFeed.tsx 2025-12-15 12:14:42 +01:00
felix.zoesch
d9459b1107 Fix duplicate event filtering in EventFeed
The EventFeed component was filtering events twice:
1. First in useEvents hook (backend query with event_types filter)
2. Then again in EventFeed component (client-side filter)

This caused filter issues where switching between filters would show
incorrect events (e.g., switching from SESSIONS to ALL would only show
session events).

Fixed by removing the duplicate client-side filter, as useEvents already
provides correctly filtered events from the backend.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 12:10:15 +01:00
8404f499f3 CLAUDE.md gelöscht 2025-12-15 11:51:58 +01:00
felix.zoesch
48d2caf57c Add user prompt text display and agents graph tab
Features:
- User prompt hook now captures and displays actual prompt text
- Added tab switching between Event Feed and Agents Graph
- Created AgentsGraph component with placeholder
- Added CSS styling for agents graph view

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 10:51:38 +01:00
felix.zoesch
8adeece5c3 Fix SQLAlchemy 2.0 compatibility
- Wrap PRAGMA statement with text() for SQLAlchemy 2.0
- Fixes ObjectNotExecutableError on database initialization
2025-12-15 10:19:03 +01:00
felix.zoesch
e8af18114f Fix TypeScript build errors
- Remove unused Event import from client.ts
- Fix fractionalSecondDigits incompatibility in EventCard.tsx
- Manually format milliseconds for timestamp display
2025-12-15 10:04:55 +01:00
felix.zoesch
1328d6287f Add package-lock.json for reproducible builds
- Generated package-lock.json for frontend dependencies
- Fixes Docker build issue with npm ci
- Ensures consistent dependency versions across environments
2025-12-15 10:00:42 +01:00
73f021e38f Bildschirmfoto 2025-12-15 um 08.28.44.png gelöscht 2025-12-15 10:53:08 +01:00
183d69dc8b Bildschirmfoto 2025-12-15 um 08.28.35.png gelöscht 2025-12-15 10:53:04 +01:00
5ce4a19edd Bildschirmfoto 2025-12-15 um 08.28.17.png gelöscht 2025-12-15 10:52:59 +01:00
felix.zoesch
f6ef7ff5d3 Initial commit: Claude Code Monitor v1.0.0
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>
2025-12-15 09:49:06 +01:00