diff --git a/pi/.pi/agent/extensions/clear.ts b/pi/.pi/agent/extensions/clear.ts new file mode 100644 index 0000000..18a8efd --- /dev/null +++ b/pi/.pi/agent/extensions/clear.ts @@ -0,0 +1,16 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; + +/** + * /clear — alias for /new. + * + * Starts a new session, discarding the current conversation history + * (the same behaviour as the built-in `/new`). + */ +export default function (pi: ExtensionAPI) { + pi.registerCommand("clear", { + description: "Start a new session (alias for /new)", + handler: async (_args, ctx) => { + await ctx.newSession(); + }, + }); +}