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.0.tar.gz (10.8 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.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: claudehub_hooks-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 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.0.tar.gz
Algorithm Hash digest
SHA256 46140ee223c88d23a212c0adbb775f509a6d3cde155aa4ce33646003ba2e964a
MD5 f6513c54af980037919258e3447f5745
BLAKE2b-256 45a541c41861057a485851f088663cabf079cd0b9a4bbfd0d4d41fa2c7324b40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for claudehub_hooks-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 479dfadf4c32c942a64fc16294af20a9dacf20eaf4e31bc0ac3d8b452599fc9e
MD5 048afbce8d01812abe9305a4cc70e1eb
BLAKE2b-256 a1aa9e77ac46c3ee590e3ee4023a059e46b9847fd832cf5644d63d30e22ead02

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