SessionStart Hook Output Validator OrchestKit playground

Paste a hook's HookResult JSON below. This validator flags whether hookSpecificOutput.hookEventName is present — the field Claude Code ≥ 2.1.150 requires (and now rejects when missing) for context-injecting hooks. Fixes issue #1983.

HookResult JSON

Verdict

Paste JSON and press Validate (or just type — it validates live).

What changed in CC 2.1.150

Hooks that inject context return a hookSpecificOutput object. Before 2.1.150, Claude Code tolerated a missing hookEventName discriminator on some events. From 2.1.150 onward, the runtime validates and rejects a hookSpecificOutput carrying additionalContext without a matching hookEventName — so a SessionStart hook that omits it gets dropped (the prior-session handoff never reaches the model).

The fix in session-handoff-injector.ts routes through the shared builder instead of a hand-rolled literal:

- return {
-   continue: true,
-   suppressOutput: true,
-   hookSpecificOutput: { additionalContext: context },
- };
+ return outputSessionStartContext(context);
+ // -> { continue:true, suppressOutput:true,
+ //      hookSpecificOutput:{ hookEventName:'SessionStart', additionalContext } }

Rule of thumb: never build a context-injecting hookSpecificOutput by hand. Use the output.ts builders (outputSessionStartContext, outputPromptContext, outputWithContext) — they stamp the correct hookEventName and drop empty context to save tokens.