Skip to main content

Claudehub Monitor

A desktop and LAN web dashboard that shows what Claude Code is doing in real time — across every repo and machine on your network.

claudehub-monitor is the central collector: Claude Code hooks POST lifecycle events to it over HTTP, and it surfaces them as an animated desktop card, system sounds, a scrolling history, a usage quota toast, and a live web page you can open from your phone.

  Claude Code (any repo / any machine)
        │  hook fires  →  claudehub-hooks  →  HTTP POST /event
        ▼
  claudehub-monitor  ──►  desktop flash card + toasts + sounds + history (SQLite)
        │
        └─►  web dashboard  ◄── browser on the LAN (SSE live updates)

Quick start

  1. Start the monitor (once per machine):
pip install claudehub-monitor
claudehub          # short alias
claudehub-monitor  # full name (same command)
  1. Wire hooks into each repo you use with Claude Code:
pip install claudehub-hooks
claudehub-hooks install
claudehub-hooks install --url http://192.168.1.50:7070/event   # remote monitor
  1. Open Claude Code in that repo — events flow to the monitor automatically.

Test hook connectivity:

python .claude/hooks/claude_hook.py --test

Install

Monitor (claudehub-monitor):

pip install claudehub-monitor
claudehub          # short alias
claudehub-monitor  # full name (same command)

Hooks (claudehub-hooks — separate package, stdlib only):

pip install claudehub-hooks
claudehub-hooks install

Components

Package / path Role
claudehub-monitor (claudehub/monitor.py) Monitor: HTTP server, desktop UI, web dashboard, SQLite store.
claudehub-hooks Pip installer that writes .claude/hooks/claude_hook.py + settings.json entries.
claudehub/dashboard.html Web dashboard page (served at /).
monitor_config.json Example monitor config (copy to ~/.claude/monitor_config.json).
.claude/hooks/monitor_config.json Per-repo hook transport config (written by claudehub-hooks install).
~/.claude/claude_events.db SQLite history + per-session status (auto-created).

Hook events

claudehub-hooks install registers these Claude Code hooks:

Event When it fires Monitor behavior
SessionStart Session begins Card shows “Session Started”; history entry
UserPromptSubmit User sends a message Thinking — ring animation, persistent toast
PostToolUse Tool used (matcher: Edit|Write|NotebookEdit|MultiEdit|Read) Reading (Read) or Editing (others); brief flash → back to thinking
Stop Turn completes Done — green tick, ding, clears session
StopFailure API / runtime error Error — red card, pong sound
Notification Claude needs input Waiting — persistent ask toast
PermissionRequest Allow/deny dialog shown Waiting — permission toast + orange card
PermissionGranted User approved a tool Resumes Thinking; history shows “Allowed ✓”
PermissionDenied User denied a tool Resumes Thinking; history shows “Denied ✗”
PreToolUse Tool about to run Resolves pending permission → Thinking (implicit allow for sub-tools)

Hook self-test (claude_hook.py --test) sends __test__ — shown on the card as a purple “Test” flash (not recorded in history).

Event payload (from hooks)

Hooks POST JSON to POST /event:

{
  "event": "PostToolUse",
  "datetime": "<ISO-8601 UTC>",
  "session_id": "<str>",
  "host": "<hostname>",
  "client": "<launcher>",        // CLAUDE_CODE_ENTRYPOINT, e.g. "claude-vscode"; "" if unset
  "cwd": "<working dir>",
  "files": ["<path>"],           // PostToolUse
  "prompt": "<first 500 chars>", // UserPromptSubmit
  "tool_name": "<tool>",         // PostToolUse / Permission* / PreToolUse
  "command": "<cmd>",            // Permission* / PreToolUse
  "notification_type": "<type>", // Notification
  "error_type": "<type>",        // StopFailure
  "error_message": "<msg>"       // StopFailure
}

Status model

Each surfaced status maps to colour, icon, and animation on the desktop:

Status Trigger (hook event) Colour Desktop animation
Thinking UserPromptSubmit blue rotating arc ring
Reading PostToolUse (Read) teal sweeping scan bar
Editing PostToolUse (Edit/Write/…) blue rippling bars
Waiting PermissionRequest / Notification amber persistent ask toast
Allowed PermissionGranted / PreToolUse (after approve) green ding; back to thinking
Denied PermissionDenied red thud; back to thinking
Done Stop green ✓ tick + ding
Error StopFailure red pong

Read/Edit briefly flash, then the card returns to Thinking until the turn ends (Stop) — mirroring how Claude actually works. The desktop card shows the status name; the history table and web feed show the matching icon.

Usage toast

When Claude Code OAuth credentials exist (~/.claude/.credentials.json), a fixed top-right toast shows subscription quota:

  • 5-hour session and 7-day weekly utilization (%)
  • Reset times for each window
  • Refreshed every 5 minutes (one minimal Haiku probe call per refresh)
  • VS Code (W): N active session(s) (T total) and Claude Desktop: Running, both refreshed every 2 seconds (independent of the 5-minute quota refresh above, since this changes far more often than quota). Each row is hidden entirely when there is nothing to report.

If credentials are missing, the toast is skipped.

Where those numbers come from

The three session numbers are deliberately from two different sources, because neither alone is correct:

Number Source Why
(W) windows Local window scan Counts open VS Code windows. Not a process count: VS Code spawns ~24 Code.exe processes for 2 windows (one per renderer, extension host, GPU process…), so windows are enumerated by title instead.
N active Hooks Sessions that fired a hook event within the last minute — i.e. genuinely mid-turn right now. Only hooks know this.
T total Local process scan One running Claude Code CLI process is one session. Works with no hooks installed at all, which is the point: hooks only exist in repos where claudehub-hooks install was run, so a hook-derived total silently omits every session in every other repo.

Claude Desktop: Running is also a local process scan. The native Claude Desktop app talks to Claude over MCP, not through Claude Code's hook system, so it can never report to this monitor over HTTP — the only way to know it is open is to look at the OS process list on the machine the monitor itself runs on. That also means it reports only on local Claude Desktop, never on a remote machine sending hook events here.

Both apps ship an executable named claude.exe, so they are told apart by executable path (the VS Code extension's bundled native-binary path versus the app's WindowsApps install), never by process name. All of these scans are Windows-only and fail closed: if a scan cannot run, the row is hidden rather than showing a misleading 0 or not running.

Run it

claudehub
claudehub-monitor
python -m claudehub

The app starts hidden in the system tray by default (the HTTP server and web dashboard run regardless). Double-click the tray icon to open the window; "Minimize to Tray" or closing the window hides it again; the tray menu's Quit exits. Only one instance runs per machine.

Web dashboard (view on the go)

With the monitor running, open from any device on the LAN:

http://<monitor-ip>:7070/

It shows a live grid of active sessions, the last prompt, and a recent-activity feed — pushed over Server-Sent Events (auto-reconnecting), with a JSON snapshot for the initial load.

Group by repo: check "Group by repo" in the header to re-arrange the session grid into one section per repository (derived from each hook's reported cwd), rather than one flat grid. Useful once several repos are reporting to the same monitor at once — a session with no cwd on record groups under "(unknown)" rather than being dropped.

History & search: the collapsed "History & search" panel below the recent- activity feed queries the full event history (not just the last few events), filterable by host, repo, event type, and date range. It only fetches once opened, so a normal dashboard view pays nothing for it.

Subagent count: when a session launches one or more subagents (Claude Code's Task tool), its card shows a small "+N agents running" badge for as long as any are still in flight. This is a count, not a breakdown — see "Subagent visibility" below for why the hook payload doesn't support more.

Open TCP 7070 on the monitor machine's firewall:

New-NetFirewallRule -DisplayName "Claude Monitor" -Direction Inbound `
  -Protocol TCP -LocalPort 7070 -Action Allow

HTTP API

Method / path Purpose
POST /event Ingest one hook event (from claudehub-hooks dispatcher).
GET / The web dashboard.
GET /api/status Active sessions snapshot + last prompt (JSON).
GET /api/events Recent events feed (JSON).
GET /api/history Paginated event history with filters — see below (JSON).
GET /events/stream Live event stream (SSE).
GET /health {"status":"ok"}.

GET /api/history query parameters

Queries the full events table directly, not the small capped in-memory feed /api/events reads from.

Param Meaning
host Exact match on reporting hostname.
repo Exact match on the derived repo label (see per-repo grouping above).
event Exact match on event name, e.g. PostToolUse.
session_id Exact match on session id.
since / until ISO-8601 UTC bounds on when the event was received.
limit Rows per page, default 50, capped at 500.
offset Rows to skip, for paging.

Response: {"events": [...], "total": <int>, "limit": <int>, "offset": <int>}.

Note: since/until filter on a column (received_at_iso) added in 0.2.0. Events recorded by an older version have it unset and are excluded from any date-filtered query rather than matching incorrectly — the older received_at column is local time-of-day only (no date), so it cannot support a range filter at all.

Configuration

Monitor (claudehub-monitor)

Copy monitor_config.json to ~/.claude/monitor_config.json, or set CLAUDE_MONITOR_CONFIG to point at a file:

{
  "transport": { "http": { "enabled": true, "url": "http://127.0.0.1:7070/event", "timeout_s": 2.0 } },
  "monitor":   { "http_host": "0.0.0.0", "http_port": 7070, "history_max": 50, "start_hidden": true },
  "logging":   { "level": "INFO", "file": "", "max_bytes": 1048576, "backup_count": 5 },
  "sounds":    { "enabled": true },
  "notifications": { "enabled": false }
}

notifications.enabled (default false) turns on Windows action-center notifications for Waiting and Error states, in addition to — not instead of — the existing sound and in-app toast. Uses the tray icon already created for the system-tray feature, so there's no extra dependency; it is a no-op if there's no system tray available.

Monitor env vars (override the file): CLAUDE_MONITOR_CONFIG, CLAUDE_MONITOR_PORT, CLAUDE_MONITOR_HOST, CLAUDE_MONITOR_SOUNDS, CLAUDE_MONITOR_NOTIFY, CLAUDE_MONITOR_LOG_LEVEL, CLAUDE_MONITOR_LOG_FILE.

Logs and the SQLite database default to ~/.claude/.

Hooks (claudehub-hooks)

Per-repo transport config lives at .claude/hooks/monitor_config.json (created by claudehub-hooks install). Point hooks at a monitor on another machine:

{
  "transport": {
    "http": { "url": "http://192.168.1.50:7070/event" }
  }
}

Hook env vars (override the file):

Variable Default Meaning
CLAUDE_HUB_URL http://127.0.0.1:7070/event Monitor endpoint
CLAUDE_HUB_TIMEOUT 2.0 HTTP timeout (seconds)
CLAUDE_HUB_HTTP_ENABLED true Set to false to silence all hooks
CLAUDE_HUB_CONFIG Path to a monitor_config.json override
CLAUDE_HOOK_LOG_LEVEL INFO Dispatcher log level
CLAUDE_HOOK_LOG_FILE ~/.claude/claude_hook.log Dispatcher log path

Subagent visibility

The card and dashboard show a count of subagents currently in flight under a session ("+2 agents running") — incremented on the PreToolUse for Claude Code's Task tool, decremented on the matching PostToolUse.

This is deliberately a count, not a per-subagent breakdown. A subagent's own inner tool calls (its own Reads, Edits, etc.) do not reach this monitor's hooks at all — only the outer call, the parent session invoking the Task tool, produces a PreToolUse/PostToolUse pair. Building true nested visibility (each subagent's own activity, individually) is not something the current Claude Code hook contract supports from the monitor side; it would need a change on that side, not here.

Multi-instance & reopen recovery

The monitor tracks status per session in SQLite, so:

  • Several Claude instances (local or remote) can report at once — the card shows the latest, the history/web distinguish by host + session.
  • If you close and reopen the monitor mid-turn, it restores the in-progress state from session_status; a 2-second watchdog idles a session that goes silent.

Requirements

  • Python 3.11+ (monitor); Python 3.10+ (hooks)
  • claudehub-monitor: PySide6 and anthropic (installed automatically)
  • claudehub-hooks: stdlib only
  • Windows for sounds (winsound); silently disabled elsewhere.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claudehub_monitor-0.3.1.tar.gz (51.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claudehub_monitor-0.3.1-py3-none-any.whl (52.4 kB view details)

Uploaded Python 3

File details

Details for the file claudehub_monitor-0.3.1.tar.gz.

File metadata

  • Download URL: claudehub_monitor-0.3.1.tar.gz
  • Upload date:
  • Size: 51.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for claudehub_monitor-0.3.1.tar.gz
Algorithm Hash digest
SHA256 9b1dc35b9517d49e620b546c6a0b8f22b80d09107d53aaf7ccb6235b47c62b8e
MD5 69b9daab6780d3b43ac086ab1df8e1bb
BLAKE2b-256 b77a0594c15e823779519f8193c0a54923238c7d5126d6ce63fb2a58219bcfc6

See more details on using hashes here.

File details

Details for the file claudehub_monitor-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for claudehub_monitor-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6725d0365c4204d7c4195ded0fc10632b927728395d1010f1eeeef2125802ac0
MD5 77dfee9dc639882b07cecab04fe06120
BLAKE2b-256 2fb6d9f382f1a76e5af39ce52ab221cb2fda37e1d83e7a806e19b293e0ae5886

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page