Claude Code Hooks Integration Guide
Description
This guide explains how to integrate the bridge app with Claude Code hooks to stream events to the monitoring server.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Claude Code Hooks Integration Guide
This guide explains how to integrate the bridge app with Claude Code hooks to stream events to the monitoring server.
Prerequisites
Ensure the server is running:
cd server npm startEnsure Node.js is installed and accessible in your PATH
Integration Steps
1. Configure Claude Code Settings
Add hooks configuration to your Claude Code settings file (`~/.claude/settings.json`):
{
"hooks": {
"PreToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "/absolute/path/to/MadameClaude/server/bridge.js"
}
]
}
]
}
}
2. Hook Event Types
You can configure different hooks for different events:
- PreToolUse: Fires before a tool is executed
- PostToolUse: Fires after a tool completes
- Notification: Fires when Claude sends notifications
- Stop: Fires when the main agent finishes
- SubagentStop: Fires when a subagent finishes
3. Filtering by Tool Type
Use matcher patterns to filter which tools trigger hooks:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "/path/to/MadameClaude/server/bridge.js"
}
]
}
]
}
}
Common matcher patterns:
"Bash"- Only Bash commands"Write"- Only Write operations"Edit|MultiEdit"- Edit operations (regex)""- All tools (empty string matches everything)
4. Hook Input Format
When Claude Code executes a hook, it pipes JSON data to stdin:
{
"event": "PreToolUse",
"tool": "Bash",
"parameters": {
"command": "ls -la",
"description": "List files"
},
"timestamp": "2025-01-03T10:00:00Z"
}
5. Testing the Integration
Start the server:
cd server && npm startIn another terminal, test the bridge directly:
echo '{"test": "message"}' | node server/bridge.jsConfigure Claude Code with the hook and run any command
6. Monitoring Output
The server will log all received messages to the console. Future UI development will display these in a web interface.
Important Notes
- Absolute Paths: Always use absolute paths in hooks configuration
- Permissions: Ensure the hook script has execute permissions
- Error Handling: stdio2http always exits with code 0 to prevent blocking Claude Code
- Performance: Hooks run synchronously, so keep processing minimal
Example Use Cases
Development Monitoring
Track all file changes during a coding session:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "/path/to/MadameClaude/server/bridge.js"
}
]
}
]
}
}
Command Auditin
Related Skills
Awesome Go
A curated list of awesome Go frameworks, libraries and software
Development next.js
| The React Framework | 138360 | 1503 | 1 |
Development sharing-skills
skill for guidance.
Development root-cause-tracing
Use when errors occur deep in execution and you need to trace back to find the original trigger.
Development Template Skill
Minimal skeleton for a new skill project structure.
Development Third-party Notices
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THI
Development