@@ -438,6 +438,14 @@ export async function handleCommand(
438438 args: string,
439439 ctx: CommandContext,
440440 ): Promise<CommandResult> {
441+ // Custom commands take precedence over built-ins — a local /review or
442+ // /plan in .agents/commands/ will shadow the built-in with that name.
443+ const custom = loadCustomCommands(ctx.cwd);
444+ const customCmd = custom.get(command.toLowerCase());
445+ if (customCmd) {
446+ return await handleCustomCommand(customCmd, args, ctx);
447+ }
448+
441449 switch (command.toLowerCase()) {
442450 case "model":
443451 case "models":
@@ -469,7 +477,7 @@ export async function handleCommand(
469477
470478 case "help":
471479 case "?":
472- handleHelp(loadCustomCommands(ctx.cwd));
480+ handleHelp(custom);
473481 return { type: "handled" };
474482
475483 case "exit":
@@ -478,11 +486,6 @@ export async function handleCommand(
478486 return { type: "exit" };
479487
480488 default: {
481- const custom = loadCustomCommands(ctx.cwd);
482- const cmd = custom.get(command.toLowerCase());
483- if (cmd) {
484- return await handleCustomCommand(cmd, args, ctx);
485- }
486489 writeln(
487490 `${PREFIX.error} unknown: /${command} ${c.dim("— /help for commands")}`,
488491 );