From b418c31211eb9e6b760c5ad34b9441f6fa68656a Mon Sep 17 00:00:00 2001 From: Nicholas Novak Date: Tue, 15 Sep 2026 17:07:57 +0000 Subject: [PATCH] Add clear command to Pi --- pi/.pi/agent/extensions/clear.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pi/.pi/agent/extensions/clear.ts 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(); + }, + }); +}