Skip to content

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

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

Activity

  1. added a commit that references this issue on Apr 9, 2026
    8f3b957
  2. zzbcode commented on Jul 16, 2026

    @zzbcode

    I would like to work on this. I am investigating a runtime, cross-process deduplication guard keyed by Claude session/tool invocation IDs so duplicate scope handlers replay the same policy decision without duplicating evaluation, activity, or telemetry. I will include concurrency coverage and run the full CONTRIBUTING.md gate before opening a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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