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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claudehub_hooks-0.1.1.tar.gz.
File metadata
- Download URL: claudehub_hooks-0.1.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a8d8920711e6e0be19a4fb281a01225832f9d45f94c23d4c08c4be380e0ada2
|
|
| MD5 |
7f8817010dc95c28e95c9d75339e9841
|
|
| BLAKE2b-256 |
7e563bd0522b7e56b7f008e1060ab0790d3d7a70f2e298cbbad7e16eff6d0975
|
File details
Details for the file claudehub_hooks-0.1.1-py3-none-any.whl.
File metadata
- Download URL: claudehub_hooks-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f234f7b42715525aacd68bac3d1f261468ca60944fa53b281cbe3fc0e7662a88
|
|
| MD5 |
17a7362e390c44df2b608cbce1518ef5
|
|
| BLAKE2b-256 |
ea88d14a540a1fc3fa671e574fe739d4b7651c7960681d4d344d31d194f55e6e
|