diff --git a/gitnexus-claude-plugin/hooks/gitnexus-hook.js b/gitnexus-claude-plugin/hooks/gitnexus-hook.js index cd65750ba..4c549e82a 100644 --- a/gitnexus-claude-plugin/hooks/gitnexus-hook.js +++ b/gitnexus-claude-plugin/hooks/gitnexus-hook.js @@ -104,7 +104,8 @@ function findGitNexusDir(startDir) { function isGitNexusServerCommand(command) { const hasServerMode = /(?:^|\s)(mcp|serve)(?:\s|$)/.test(command); - const hasGitNexus = /(?:^|[/\\\s])gitnexus(?:\.cmd)?(?:\s|$)/.test(command) || + const hasGitNexus = + /(?:^|[/\\\s])gitnexus(?:\.cmd)?(?:\s|$)/.test(command) || /node_modules[/\\]gitnexus[/\\]/.test(command); return hasServerMode && hasGitNexus; } diff --git a/gitnexus/hooks/claude/gitnexus-hook.cjs b/gitnexus/hooks/claude/gitnexus-hook.cjs index 6ec8bd3ee..981bed2ab 100755 --- a/gitnexus/hooks/claude/gitnexus-hook.cjs +++ b/gitnexus/hooks/claude/gitnexus-hook.cjs @@ -104,7 +104,8 @@ function findGitNexusDir(startDir) { function isGitNexusServerCommand(command) { const hasServerMode = /(?:^|\s)(mcp|serve)(?:\s|$)/.test(command); - const hasGitNexus = /(?:^|[/\\\s])gitnexus(?:\.cmd)?(?:\s|$)/.test(command) || + const hasGitNexus = + /(?:^|[/\\\s])gitnexus(?:\.cmd)?(?:\s|$)/.test(command) || /node_modules[/\\]gitnexus[/\\]/.test(command); return hasServerMode && hasGitNexus; }