Bad-return function-hook fixture

hooks/register.ts 14 lines1import type { Register } from "claude-code";
2
3const ESCAPE_HATCH_TOOLS = new Set(["AskUserQuestion", "SendUserMessage"]);
4
5export const register: Register = (on) => {
6 on("classic.PreToolUse", { tool: "Read" }, async (_$, e, next) => {
7 const result = await next(e);
8 if (ESCAPE_HATCH_TOOLS.has(e.tool)) {
9 return result;
10 }
11 return { ...result, additionalContext: "not-an-array" };
12 });
13};
14