disler/claude-code-hooks-multi-agent-observability
Real-time monitoring for Claude Code agents through simple hook event tracking.
npx skills add disler/claude-code-hooks-multi-agent-observabilityREADME
Multi-Agent Observability System
Real-time monitoring and visualization for Claude Code agents through comprehensive hook event tracking. You can watch the full breakdown here and watch the latest enhancement where we compare Haiku 4.5 and Sonnet 4.5 here.
šÆ Overview
This system provides complete observability into Claude Code agent behavior by capturing, storing, and visualizing Claude Code Hook events in real-time. It enables monitoring of multiple concurrent agents with session tracking, event filtering, and live updates.
šļø Architecture
Claude Agents ā Hook Scripts ā HTTP POST ā Bun Server ā SQLite ā WebSocket ā Vue Client

š Setup Requirements
Before getting started, ensure you have the following installed:
- Claude Code - Anthropic's official CLI for Claude
- Astral uv - Fast Python package manager (required for hook scripts)
- Bun, npm, or yarn - For running the server and client
- Anthropic API Key - Set as
ANTHROPIC_API_KEYenvironment variable - OpenAI API Key (optional) - For multi-model support with just-prompt MCP tool
- ElevenLabs API Key (optional) - For audio features
Configure .claude Directory
To setup observability in your repo,we need to copy the .claude directory to your project root.
To integrate the observability hooks into your projects:
-
Copy the entire
.claudedirectory to your project root:cp -R .claude /path/to/your/project/ -
Update the
settings.jsonconfiguration:Open
.claude/settings.jsonin your project and modify thesource-appparameter to identify your project:{ "hooks": { "PreToolUse": [{ "matcher": "", "hooks": [ { "type": "command", "command": "uv run .claude/hooks/pre_tool_use.py" }, { "type": "command", "command": "uv run .claude/hooks/send_event.py --source-app YOUR_PROJECT_NAME --event-type PreToolUse --summarize" } ] }], "PostToolUse": [{ "matcher": "", "hooks": [ { "type": "command", "command": "uv run .claude/hooks/post_tool_use.py" }, { "type": "command", "command": "uv run .claude/hooks/send_event.py --source-app YOUR_PROJECT_NAME --event-type PostToolUse --summarize" } ] }], "UserPromptSubmit": [{ "hooks": [ { "type": "command", "command": "uv run .claude/hooks/user_prompt_submit.py --log-only" }, { "type": "command", "command": "uv run .claude/hooks/send_event.py --source-app YOUR_PROJECT_NAME --event-type UserPromptSubmit --summarize" } ] }] // ... (similar patterns for Notification, Stop, SubagentStop, PreCompact, SessionStart, SessionEnd) } }Replace
YOUR_PROJECT_NAMEwith a unique identifier for your project (e.g.,my-api-server,react-app, etc.). -
Ensure the observability server is running:
# From the observability project directory (this codebase) ./scripts/start-system.sh
Now your project will send events to the observability system whenever Claude Code performs actions.
š Quick Start
You can quickly view how this works by running this repositories .claude setup.
# 1. Start both server and client
./scripts/start-system.sh
# 2. Open http://localhost:5173 in your browser
# 3. Open Claude Code and run the following command:
Run git ls-files to understand the codebase.
# 4. Watch events stream in the client
# 5. Copy the .claude folder to other projects you want to emit events from.
cp -R .claude <directory of your codebase you want to emit events from>
š Project Structure
claude-code-hooks-multi-agent-observability/
ā
āāā apps/ # Application components
ā āāā server/ # Bun TypeScript server
ā ā āāā src/
ā ā ā āāā index.ts # Main server with HTTP/WebSocket endpoints
ā ā ā āāā db.ts # SQLite database management & migrations
ā ā ā āāā types.ts # TypeScript interfaces
ā ā āāā package.json
ā ā āāā events.db # SQLite database (gitignored)
ā ā
ā āāā client/ # Vue 3 TypeScript client
ā āāā src/
ā ā āāā App.vue # Main app with theme & WebSocket management
ā ā āāā components/
ā ā ā āāā EventTimeline.vue # Event list
...