From fb00b517c0eff642875def7b3a44561ec1c78272 Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Sun, 26 Oct 2025 00:06:53 -0400 Subject: [PATCH] Fix: Silence npm output in SessionStart hook to fix context injection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: npm install outputs "up to date in Xms" to stdout, which prepends non-JSON text to the hook output. Claude Code expects pure JSON and cannot parse the output, causing context injection to fail silently. Solution: Changed npm install flag from --loglevel=error to --loglevel=silent to completely suppress stdout output, ensuring clean JSON output for hook. Impact: SessionStart hook will now properly inject recent context into sessions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- plugin/hooks/hooks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/hooks/hooks.json b/plugin/hooks/hooks.json index 9cf7fae8..d2dcc37f 100644 --- a/plugin/hooks/hooks.json +++ b/plugin/hooks/hooks.json @@ -6,7 +6,7 @@ "hooks": [ { "type": "command", - "command": "cd \"${CLAUDE_PLUGIN_ROOT}/..\" && npm install --prefer-offline --no-audit --no-fund --loglevel=error && node ${CLAUDE_PLUGIN_ROOT}/scripts/context-hook.js", + "command": "cd \"${CLAUDE_PLUGIN_ROOT}/..\" && npm install --prefer-offline --no-audit --no-fund --loglevel=silent && node ${CLAUDE_PLUGIN_ROOT}/scripts/context-hook.js", "timeout": 300 } ]