874815770a
All 4 hook entry point scripts were missing process.exit(0) after successful
execution, causing Node processes to hang indefinitely instead of returning
control to Claude Code with exit code 0.
Root cause: In commit 6f62a56, process.exit(0) calls were removed from the
hook functions but were never added to the entry point scripts that wrap them.
Fixed files:
- src/bin/hooks/save-hook.ts (PostToolUse)
- src/bin/hooks/new-hook.ts (UserPromptSubmit)
- src/bin/hooks/summary-hook.ts (Stop)
- src/bin/hooks/context-hook.ts (SessionStart)
This restores proper hook exit behavior and prevents Claude Code from waiting
indefinitely for hook completion.
24 lines
597 B
TypeScript
24 lines
597 B
TypeScript
|
|
/**
|
|
* Save Hook Entry Point - PostToolUse
|
|
* Standalone executable for plugin hooks
|
|
*/
|
|
|
|
import { saveHook } from '../../hooks/save.js';
|
|
import { stdin } from 'process';
|
|
|
|
// Read input from stdin
|
|
let input = '';
|
|
stdin.on('data', (chunk) => input += chunk);
|
|
stdin.on('end', async () => {
|
|
try {
|
|
const parsed = input.trim() ? JSON.parse(input) : undefined;
|
|
await saveHook(parsed);
|
|
process.exit(0);
|
|
} catch (error: any) {
|
|
console.error(`[claude-mem save-hook error: ${error.message}]`);
|
|
console.log('{"continue": true, "suppressOutput": true}');
|
|
process.exit(0);
|
|
}
|
|
});
|