From 984b5881f44c6e7cd2303a79d3a7ac117dbb90c5 Mon Sep 17 00:00:00 2001 From: Tony Casey Date: Thu, 12 Feb 2026 22:37:07 +0000 Subject: [PATCH] fix: rename SessionStop to Stop for valid Claude Code hook event (GIT-62) SessionStop is not a valid Claude Code hook event name. The correct name is Stop. This fix ensures the stop hook actually fires. Co-Authored-By: Claude Opus 4.6 --- src/commands/init-hooks.ts | 6 +++--- tests/unit/commands/init-hooks.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/init-hooks.ts b/src/commands/init-hooks.ts index 9996012a..07acb788 100644 --- a/src/commands/init-hooks.ts +++ b/src/commands/init-hooks.ts @@ -21,7 +21,7 @@ interface IInitHooksOptions { } // ── Git-mem event types managed by init-hooks ──────────────────────── -const GIT_MEM_EVENT_TYPES = ['SessionStart', 'SessionStop', 'UserPromptSubmit'] as const; +const GIT_MEM_EVENT_TYPES = ['SessionStart', 'Stop', 'UserPromptSubmit'] as const; // ── Fingerprint detection ──────────────────────────────────────────── @@ -171,7 +171,7 @@ export function buildHooksConfig(): Record { hooks: [{ type: 'command', command: 'git-mem hook session-start' }], }, ], - SessionStop: [ + Stop: [ { matcher: '', hooks: [{ type: 'command', command: 'git-mem hook session-stop' }], @@ -274,7 +274,7 @@ export async function initHooksCommand(options: IInitHooksOptions, logger?: ILog console.log('\nHooks configured:'); console.log(' SessionStart — Load memories into Claude context on startup'); - console.log(' SessionStop — Capture memories from session commits on exit'); + console.log(' Stop — Capture memories from session commits on exit'); console.log(' UserPromptSubmit — Surface relevant memories per prompt (disabled by default)'); console.log('\nNext steps:'); diff --git a/tests/unit/commands/init-hooks.test.ts b/tests/unit/commands/init-hooks.test.ts index 673617bd..138ce9f5 100644 --- a/tests/unit/commands/init-hooks.test.ts +++ b/tests/unit/commands/init-hooks.test.ts @@ -175,14 +175,14 @@ describe('removeGitMemHooks', () => { it('should remove git-mem entries from all three event types', () => { const hooks = { SessionStart: [gitMemMatcher('session-start')], - SessionStop: [gitMemMatcher('session-stop')], + Stop: [gitMemMatcher('session-stop')], UserPromptSubmit: [gitMemMatcher('prompt-submit')], }; const result = removeGitMemHooks(hooks); assert.equal(result.SessionStart, undefined); - assert.equal(result.SessionStop, undefined); + assert.equal(result.Stop, undefined); assert.equal(result.UserPromptSubmit, undefined); });