{"version":"2.1.304","anchor":"hook-registration-dedupes-by-matching-hook","canonical_anchor":"hook-registration-dedupes-by-matching-hook","heading":"Adding a hook that already exists replaces it instead of running it twice","tier":"notice","area":"Hooks","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304\/e\/hook-registration-dedupes-by-matching-hook","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304","markdown":"### Adding a hook that already exists replaces it instead of running it twice\n\nRegistering a hook that is already set up for a matcher now updates the existing hook instead of adding a second copy\n\n**What**\n\nA hook is a command or function that Claude Code runs automatically at a set point, for example before or after a tool runs. Each hook sits under a matcher, the pattern that decides which actions it applies to.\n\nWhen a hook is added under a matcher, Claude Code now looks for the same hook already registered there. If it finds one, it replaces that hook's settings and keeps its `onHookSuccess` handler, instead of adding a second copy. Before, only function hooks that carried an id were replaced this way. Every other kind of hook was added again as a new entry.\n\n**Why**\n\nRegistering the same hook more than once no longer makes it run several times for one event.\n\n- Area: Hooks\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}