Skip to main content

Claude Code hook dispatcher — forwards lifecycle events to Claude Monitor

Project description

claudehub-hooks

Pip-installable Claude Code hook dispatcher. Install once, then wire any repository to a Claude Monitor HTTP endpoint in one command — no manual script copying or JSON editing.

Events flow: Claude Code → claudehub-hooks dispatcher → Claude Monitor.

Install

pip install claudehub-hooks

Requires Python 3.10+. No third-party runtime dependencies (stdlib only).

Quick start

claudehub-hooks install

Run from a repository root (or pass --repo). The command is idempotent — safe to re-run.

claudehub-hooks install --repo /path/to/repo
claudehub-hooks install --url http://192.168.1.50:7070/event
claudehub-hooks install --dry-run

What it writes

File Purpose
.claude/hooks/claude_hook.py Hook dispatcher (invoked by Claude Code)
.claude/hooks/monitor_config.json Transport config with the monitor URL
.claude/settings.json Nine hook entries merged in (existing entries kept)

Change the monitor URL

Edit .claude/hooks/monitor_config.json in the repo:

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

Or set an environment variable (overrides the file):

export CLAUDE_HUB_URL="http://192.168.1.50:7070/event"

On Windows (persistent):

setx CLAUDE_HUB_URL "http://192.168.1.50:7070/event"

Test connectivity

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

Hooks installed

Event Trigger
SessionStart Claude session begins
UserPromptSubmit User sends a message
Notification Claude needs input
PostToolUse File read/edited (Edit · Write · NotebookEdit · MultiEdit · Read)
Stop Turn completes
StopFailure API error
PermissionRequest Allow/deny dialog shown
PermissionDenied User denied a tool
PreToolUse Tool about to run (resolves permission)

Configuration

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_HOOK_LOG_LEVEL INFO Dispatcher log level
CLAUDE_HOOK_LOG_FILE ~/.claude/claude_hook.log Override log path
CLAUDE_HUB_CONFIG Path to a monitor_config.json override

License

MIT — see LICENSE.

Author: Pandiyaraj Karuppasamy · pandiyarajk@live.com

Project details


Download files

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

Source Distribution

claudehub_hooks-0.1.2.tar.gz (11.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_hooks-0.1.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file claudehub_hooks-0.1.2.tar.gz.

File metadata

  • Download URL: claudehub_hooks-0.1.2.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for claudehub_hooks-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2aade7a63934039fbde5cb67fde632bdceaedf7e3dce6afa187b987935907562
MD5 92ce81690f59ba6922105497cddcb740
BLAKE2b-256 6df4f6cd3896b4f370a5a022d40e1f0c5d0d2295332cd18ef67d130d9da5ab91

See more details on using hashes here.

File details

Details for the file claudehub_hooks-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for claudehub_hooks-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 64666f3108877d17247da29640a80872b32c4a6896402ae3423df8dfd42430cc
MD5 9385eea6bbed239d8a332a3f2ecda82a
BLAKE2b-256 8935e3456f0531625fe33c4a73166db00388955e76e7fca3e1dec10c9e7fe0d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page