// Pi: change the agent, keep the model // Teaching excerpts; see the explanation and boundaries on the episode page. // Inspect the requested tool pi.on("tool_call", (event, ctx) => { if (!isToolCallEventType("write", event)) return; if (isMenu(event.input.path, ctx.cwd)) return { block: true, reason: "Menu is locked" }; });