Skip to content

[fix] deduplicate hook handler invocations when installed in multiple scopes #58

@yashexosphere

Description

@yashexosphere

When hooks are installed in multiple Claude Code scopes (user + project + local), Claude Code spawns one handler process per scope for every tool call. Each process receives the identical stdin payload and independently writes a duplicate dashboard entry, fires duplicate PostHog telemetry, and adds ~2x latency. The install-time warning detects this but there was no runtime guard.

Symptoms:

Dashboard shows 2× or 3× entries per tool call
totalEvents / denyCount stats inflated by scope count
Double latency per tool call

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions