SLOPSHOPPER

fnhook-fixture-bad-return

Bad-return function-hook fixture

new
A shopper browsing a rack in a slop shop
Source 1 files
hooks/register.ts 14 lines
1import 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