From 96daa99207966960ec20082b72cd1821b8ac4258 Mon Sep 17 00:00:00 2001 From: sunnyadn Date: Mon, 29 Jun 2026 05:10:18 +0800 Subject: [PATCH] fix: warn at SessionStart when EVERMEM_API_KEY is unset instead of failing silently When the key isn't configured, all hooks no-op silently and the user gets no signal that memory is disabled. Surface it once per session at SessionStart (non-blocking). Configured sessions are unchanged. --- hooks/scripts/session-context.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hooks/scripts/session-context.js b/hooks/scripts/session-context.js index 116cbb9..4456120 100755 --- a/hooks/scripts/session-context.js +++ b/hooks/scripts/session-context.js @@ -123,8 +123,16 @@ async function main() { } if (!config.isConfigured) { - // Silently skip if not configured - console.log(JSON.stringify({ continue: true })); + // Warn once per session instead of failing silently: when the key is unset the + // Stop/inject hooks also no-op invisibly, so the user assumes memory works. + // SessionStart runs once, so this won't spam. + console.log(JSON.stringify({ + continue: true, + systemMessage: + '⚠️ EverMem: EVERMEM_API_KEY not set — memory is disabled (nothing saved or ' + + 'recalled). Set the key in your environment and restart Claude Code; verify ' + + 'with /evermem:help.' + })); return; }