From claudetracker
Tests ClaudeTracker's hooks integration end-to-end by sending 21 hook events via PowerShell script through HookBridge and verifying delivery in logs and notifications.
npx claudepluginhub tobiint/claudetrackerThis skill uses the workspace's default tool permissions.
Orchestrate end-to-end testing of ClaudeTracker's hooks integration by sending all 21 hook events through HookBridge and verifying delivery via log inspection.
Guides creating, configuring, and debugging Claude Code hooks for event-driven automation, command validation, workflow customization, and notifications on events like PreToolUse and UserPromptSubmit.
Develops Claude Code plugin hooks for event-driven automation, validating tool use with prompt-based, command, and agent types for events like PreToolUse, Stop, and SessionStart.
Creates, validates, and refines Claude Code plugin hooks for workflow automation. Supports command hooks (shell scripts), prompt hooks (LLM decisions), event matching, decision schemas, and production safety validation.
Share bugs, ideas, or general feedback.
Orchestrate end-to-end testing of ClaudeTracker's hooks integration by sending all 21 hook events through HookBridge and verifying delivery via log inspection.
Two components work together:
scripts/test-hooks.ps1 — Standalone PowerShell script that sends synthetic hook events through HookBridge with realistic payloadsThe script can also be run independently for quick smoke tests without Claude Code.
Before running, verify:
dotnet build --configuration ReleaseRun from the project root:
# All events, automated mode
powershell -ExecutionPolicy Bypass -File scripts/test-hooks.ps1
# Interactive mode — pauses on PermissionRequest and Elicitation popups
powershell -ExecutionPolicy Bypass -File scripts/test-hooks.ps1 -Interactive
# Test specific events only
powershell -ExecutionPolicy Bypass -File scripts/test-hooks.ps1 -Events "PermissionRequest,Elicitation,Stop"
After running the script, verify delivery by checking the ClaudeTracker log:
# Get today's log file
$logFile = "$env:APPDATA\ClaudeTracker\logs\claudetracker-$(Get-Date -Format 'yyyyMMdd').log"
# Check which events were received
Select-String -Path $logFile -Pattern "\[HookIpc\] Received event:" | Select-Object -Last 30
For each event sent by the script, you should see a corresponding [HookIpc] Received event: <EventName> log entry.
These events should trigger notification popups (if no permission popup is blocking):
| Event | Notification Condition |
|---|---|
Stop / TaskCompleted | Settings > Hooks > Notify on task complete |
PostToolUseFailure | Settings > Hooks > Notify on tool error |
Notification (permission keyword) | Settings > Hooks > Notify on permission wait AND permission popups disabled |
Notification (idle keyword) | Settings > Hooks > Notify on idle |
Check for Notification sent: entries in the log to confirm.
These events show popup UI when permission popups are enabled:
| Event | Expected UI |
|---|---|
PermissionRequest | Permission popup with Allow/Deny buttons and "Always Allow" suggestion |
Elicitation | Input form with text field, dropdown (single-select), and checklist (multi-select) |
The script sends events in dependency order (24 sends covering all 21 event types, including 2 Notification variants and paired Pre/Post events):
SessionStart — Registers test session with console window handleSessionEnd — Cleanup (sent last)PreToolUse (Read) — Passthrough handlerPostToolUse (Read) — Observer onlyPreToolUse (Bash) — Passthrough handlerPermissionRequest (Bash) — Interactive: shows permission popupPostToolUse (Bash) — Observer onlyPostToolUseFailure — Triggers error notificationUserPromptSubmit — Passthrough handlerSubagentStart — Registers test subagentSubagentStop — Interactive: passthrough handlerElicitation — Interactive: shows input form with 3 field typesElicitationResult — Observer: carries answers backPreCompact — Observer onlyPostCompact — Observer onlyWorktreeCreate — Observer onlyWorktreeRemove — Observer onlyInstructionsLoaded — Observer onlyConfigChange — Interactive: passthrough handlerNotification (permission) — Triggers permission-wait notificationNotification (idle) — Triggers idle notificationTeammateIdle — Observer onlyTaskCompleted — Triggers completion notificationStop — Interactive: triggers completion notificationAfter verification, present results as:
Event Delivered Notification Response
-------------------------------------------------------------
SessionStart pass - -
PermissionRequest pass - allow
Elicitation pass - submit
Notification (perm) pass pass -
Stop pass pass -
...
-------------------------------------------------------------
Result: 21/21 passed
| Symptom | Cause | Fix |
|---|---|---|
| No events in log | ClaudeTracker not running or hooks disabled | Start app, enable hooks in Settings |
[FAIL] in script output | HookBridge can't connect to named pipe | Ensure ClaudeTracker is running |
| Notifications missing | Permission popup blocking from another session | Close pending popups first |
| Elicitation popup empty | Schema fields not parsed | Check log for parse errors |
| Script hangs on interactive | Waiting for Enter key press | Press Enter after interacting with popup |
| Parameter | Type | Default | Description |
|---|---|---|---|
-Interactive | Switch | Off | Pause on PermissionRequest and Elicitation for manual popup testing |
-Bridge | String | Auto-detect | Custom path to ClaudeTracker.HookBridge.exe |
-Timeout | Int | 10 | Seconds to wait for interactive popups |
-Events | String | All | Comma-separated list of specific events to test |