67f9d631bd
Three issues fixed: 1. session-init handler: Worker 500 errors caused `throw`, which hook-command.ts caught and exited with code 2 (blocking error). This blocked the user's prompt entirely with: "Hook error: Error: Session initialization failed: 500" Fix: Log the failure and return SUCCESS so the prompt proceeds. 2. user-message handler: Referenced nonexistent constant HOOK_EXIT_CODES.USER_MESSAGE_ONLY (undefined). Also used console.error() for informational output, which Claude Code may flag as an error. Fix: Use process.stderr.write() and return HOOK_EXIT_CODES.SUCCESS explicitly. 3. Both handlers threw on HTTP errors from the worker, causing exit code 2 (blocking). Memory plugin failures should never prevent users from using Claude Code. All worker HTTP failures now log and return gracefully. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>