Reserved-prefix plugin name: validate must reject it (#1496)

hooks/register.ts 17 lines1import type { Register } from "claude-code";
2
3// Every module registering classic.PreToolUse must permit these, consulted —
4// asserted by `assert_escape_hatch_permitted`. This fixture denies nothing, and
5// carries the set anyway: the invariant is deliberately exception-free.
6const ESCAPE_HATCH_TOOLS = new Set(["AskUserQuestion", "SendUserMessage"]);
7
8export const register: Register = (on) => {
9 on("classic.PreToolUse", { tool: "Read" }, async (_$, e, next) => {
10 const result = await next(e);
11 if (ESCAPE_HATCH_TOOLS.has(e.tool)) {
12 return result;
13 }
14 return { ...result, additionalContext: ["fixture-valid"] };
15 });
16};
17