From a909bdfcb25f825d5b77a45a6378a618a2e10746 Mon Sep 17 00:00:00 2001 From: Ousama Ben Younes Date: Fri, 13 Mar 2026 14:46:26 +0000 Subject: [PATCH 1/2] fix: point Setup hook to smart-install.js instead of deleted setup.sh (#1268) The Setup hook referenced scripts/setup.sh which was deleted in commit 74d94aa2 but the hooks.json reference was never updated. This caused the Setup hook to fail silently on Claude Code updates, making claude-mem appear disconnected. smart-install.js already handles all the same setup tasks (Bun/uv installation, dependency checks, CLI install). Adds 3 tests verifying the Setup hook references an existing script. Co-Authored-By: Claude Opus 4.6 --- plugin/hooks/hooks.json | 2 +- tests/smart-install.test.ts | 38 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/plugin/hooks/hooks.json b/plugin/hooks/hooks.json index 6f044d9b5..a3b5233e7 100644 --- a/plugin/hooks/hooks.json +++ b/plugin/hooks/hooks.json @@ -7,7 +7,7 @@ "hooks": [ { "type": "command", - "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; \"$_R/scripts/setup.sh\"", + "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/smart-install.js\"", "timeout": 300 } ] diff --git a/tests/smart-install.test.ts b/tests/smart-install.test.ts index 7c3f5f6d4..68d7d4b19 100644 --- a/tests/smart-install.test.ts +++ b/tests/smart-install.test.ts @@ -163,3 +163,41 @@ describe('smart-install verifyCriticalModules logic', () => { expect(missing).toEqual(['@chroma-core/other-pkg']); }); }); + +describe('hooks.json Setup hook (#1268)', () => { + const hooksJsonPath = join(__dirname, '..', 'plugin', 'hooks', 'hooks.json'); + + it('should reference an existing script in the Setup hook', () => { + const hooksJson = JSON.parse(readFileSync(hooksJsonPath, 'utf-8')); + const setupHooks = hooksJson.hooks?.Setup; + expect(setupHooks).toBeDefined(); + expect(setupHooks.length).toBeGreaterThan(0); + + const setupCommand: string = setupHooks[0].hooks[0].command; + + // Extract the script path from the hook command. + // Format: _R="..."; [ -z "$_R" ] && _R="..."; node "$_R/scripts/