Skip to content

Commit e4747e8

Browse files
committed
fix(plugin): use substring match in _is_hook_in_settings for backward compat
Existing installations store the old ~ format in settings.json. Exact string comparison against the new $HOME format would fail, causing duplicate hook registration. Match by HOOK_FILENAME substring instead.
1 parent a35264c commit e4747e8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/claude-code-plugin/hooks/session-start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def _is_hook_in_settings(settings: dict) -> bool:
271271
user_prompt_hooks = settings.get("hooks", {}).get("UserPromptSubmit", [])
272272
for hook_group in user_prompt_hooks:
273273
for hook in hook_group.get("hooks", []):
274-
if hook.get("command") == HOOK_COMMAND:
274+
if HOOK_FILENAME in hook.get("command", ""):
275275
return True
276276
return False
277277

0 commit comments

Comments
 (0)