diff --git a/src/cli/handlers/observation.ts b/src/cli/handlers/observation.ts index b498976f..bee81bac 100644 --- a/src/cli/handlers/observation.ts +++ b/src/cli/handlers/observation.ts @@ -24,7 +24,8 @@ export const observationHandler: EventHandler = { const { sessionId, cwd, toolName, toolInput, toolResponse } = input; if (!toolName) { - throw new Error('observationHandler requires toolName'); + // No tool name provided - skip observation gracefully + return { continue: true, suppressOutput: true, exitCode: HOOK_EXIT_CODES.SUCCESS }; } const port = getWorkerPort(); diff --git a/src/cli/handlers/summarize.ts b/src/cli/handlers/summarize.ts index bd0756ae..19cd46d9 100644 --- a/src/cli/handlers/summarize.ts +++ b/src/cli/handlers/summarize.ts @@ -29,7 +29,9 @@ export const summarizeHandler: EventHandler = { // Validate required fields before processing if (!transcriptPath) { - throw new Error(`Missing transcriptPath in Stop hook input for session ${sessionId}`); + // No transcript available - skip summary gracefully (not an error) + logger.debug('HOOK', `No transcriptPath in Stop hook input for session ${sessionId} - skipping summary`); + return { continue: true, suppressOutput: true, exitCode: HOOK_EXIT_CODES.SUCCESS }; } // Extract last assistant message from transcript (the work Claude did)