xonecas.io
64875
Mc

mini-coder / commit a182717

feat: custom commands/agents/skills audit + active agent support

- /review consolidated into a bootstrapped custom command at
  ~/.agents/commands/review.md (created on first run, never overwritten)
- frontmatter.ts: add mode (primary|subagent|all) and agent fields
- agents.ts: add mode to AgentConfig, includeClaudeDirs true (.claude/agents/ fallback)
- custom-commands.ts: add agent field, commands can route to a named agent
- CommandContext.runSubagent: signature updated to (prompt, agentName?, model?)
- Primary-mode agents filtered from subagent tool description
- /agent [name|off] command: set/clear active primary agent
- Active agent system prompt appended to (not replacing) base system prompt
- SessionRunner.extraSystemPrompt made public for runtime mutation
- Status bar shows @agentname in green when an agent is active
- baseConfigFields() helper extracted to eliminate jscpd clone
- Fix: /agent uses raw filename casing for map lookup (case sensitivity bug)
- Fix: setActiveAgent accepts resolved systemPrompt directly (stale map bug)

xonecas2026-03-10 a1827179121b0db77e2b2b35ba0d7105767df198 parent 9fface8

13 files changed

TODO.md+1−20
@@ -70,26 +70,6 @@ error: script "dev" exited with code 1
7070
7171 ---
7272
73-## Audit language to models
74-
75-I want to improve some aspects of the agents behaviour in mini-coder.
76-
77-- More responsible token usage. API costs are escalating in 2026 so it's more important than ever to use as little tokens as possible whithout impacting efficiency.
78-- Evaluate our tools descriptions and wording to make sure they are efficient in token usage and clear to the llm (we see some errors of duplicating code by accident for example).
79-- Evaluate the output of our tools for token usage considerations.
80-- Ensure the system prompts are correct and use up to date wording based on context engineering optimization (check online for latest practices, check opencode, codex and oh-my-pi for context). Make sure we review the codex autonomy texts as well since gpt 5.4 is now out.
81-
82----
83-
84-## Write blog posts
85-
86-- Codex being big dumb and lazy without strong guidance in system prompt/instructions
87-- Keeping up codebase health when using agents to develop an applications. Avoid regressions, bad tests, lint etc.
88-
89----
90-
91-# Post v1.0.0 work:
92-
9373 ## Custom commands vs built-in commands
9474
9575 Let's clean things up:
@@ -97,6 +77,7 @@ Let's clean things up:
9777 - `/review` command should use the same code as a custom-commands, consolidate the two. We can create the global `/review` command in `~/.agents/commands` at app start if it doesn't exist. That way it can be a pure custom command and the users are encouraged to edit it for their own custom reviews. Never overwrite the file if it exists. Print a line notifying the user that the command was created.
9878 - Ensure we are correctly implementing commands, skills and agents. Use the claude code and opencode documentation online to audit our implementations, identify gaps and inconsistencies. We should support both of these types of configs, as well as our .agents.
9979 - Now that we have subagents as subprocesses, let's review how it impacted these features.
80+- We are missing the notion of an active custom agent, we need to add it. It should be documented in the claude code and opencode docs.
10081
10182 ---
10283
src/agent/agent.ts+27−3
@@ -1,5 +1,5 @@
11 import * as c from "yoctocolors";
2-import { loadAgents } from "../cli/agents.ts";
2+import { type AgentConfig, loadAgents } from "../cli/agents.ts";
33 import type { CommandContext } from "../cli/commands.ts";
44 import { tildePath } from "../cli/output.ts";
55 import { getContextWindow, type ThinkingEffort } from "../llm-api/providers.ts";
@@ -30,6 +30,17 @@ interface AgentOptions {
3030 agentSystemPrompt?: string;
3131 }
3232
33+/** Agents with mode "primary" are for interactive use only — exclude from subagent tool. */
34+function subagentAgents(
35+ agents: Map<string, AgentConfig>,
36+): Map<string, AgentConfig> {
37+ const filtered = new Map<string, AgentConfig>();
38+ for (const [name, cfg] of agents) {
39+ if (cfg.mode !== "primary") filtered.set(name, cfg);
40+ }
41+ return filtered;
42+}
43+
3344 export async function runAgent(
3445 opts: AgentOptions,
3546 ): Promise<SubagentSummary | undefined> {
@@ -45,7 +56,7 @@ export async function runAgent(
4556 cwd,
4657 runSubagent,
4758 onHook: (tool, path, ok) => opts.reporter.renderHook(tool, path, ok),
48- availableAgents: agents,
59+ availableAgents: subagentAgents(agents),
4960 });
5061
5162 const mcpTools: ToolDef[] = [];
@@ -89,6 +100,9 @@ export async function runAgent(
89100 killSubprocesses: killAll,
90101 });
91102
103+ // Active primary agent state — name only; the system prompt is stored on runner.
104+ let activeAgentName: string | null = null;
105+
92106 const cmdCtx: CommandContext = {
93107 get currentModel() {
94108 return runner.currentModel;
@@ -119,7 +133,16 @@ export async function runAgent(
119133 runner.planMode = v;
120134 },
121135 cwd,
122- runSubagent: (prompt, model?) => runSubagent(prompt, undefined, model),
136+ runSubagent: (prompt, agentName?, model?) =>
137+ runSubagent(prompt, agentName, model),
138+
139+ get activeAgent() {
140+ return activeAgentName;
141+ },
142+ setActiveAgent: (name, systemPrompt?) => {
143+ activeAgentName = name;
144+ runner.extraSystemPrompt = systemPrompt;
145+ },
123146
124147 undoLastTurn: () =>
125148 undoLastTurn({
@@ -155,6 +178,7 @@ export async function runAgent(
155178 contextWindow: getContextWindow(runner.currentModel) ?? 0,
156179 ralphMode: runner.ralphMode,
157180 thinkingEffort: runner.currentThinkingEffort,
181+ activeAgent: activeAgentName,
158182 });
159183 }
160184
src/agent/reporter.ts+1−0
@@ -20,6 +20,7 @@ export interface StatusBarData {
2020 contextWindow: number;
2121 ralphMode: boolean;
2222 thinkingEffort?: string | null;
23+ activeAgent?: string | null;
2324 }
2425
2526 export interface AgentReporter {
src/agent/session-runner.ts+1−1
@@ -59,7 +59,7 @@ export class SessionRunner {
5959 public totalIn = 0;
6060 public totalOut = 0;
6161 public lastContextTokens = 0;
62- private extraSystemPrompt: string | undefined;
62+ public extraSystemPrompt: string | undefined;
6363 private isSubagent: boolean | undefined;
6464 private killSubprocesses: (() => void) | undefined;
6565
src/cli/agents.test.ts+44−0
@@ -69,4 +69,48 @@ describe("loadAgents", () => {
6969 expect(agents.get("reviewer")?.description).toBe("local reviewer");
7070 expect(agents.get("reviewer")?.source).toBe("local");
7171 });
72+
73+ test("loads mode field from frontmatter", () => {
74+ writeAgent(
75+ dir,
76+ "orchestrator",
77+ "---\ndescription: Primary orchestrator\nmode: primary\n---\n\nYou are the orchestrator.",
78+ );
79+ const agent = loadAgents(dir).get("orchestrator");
80+ expect(agent?.mode).toBe("primary");
81+ expect(agent?.systemPrompt).toBe("You are the orchestrator.");
82+ });
83+
84+ test("mode is undefined when not specified", () => {
85+ writeAgent(dir, "plain", "Just do the task.");
86+ expect(loadAgents(dir).get("plain")?.mode).toBeUndefined();
87+ });
88+
89+ test("loads agents from .claude/agents/ directory", () => {
90+ const claudeDir = join(dir, ".claude", "agents");
91+ mkdirSync(claudeDir, { recursive: true });
92+ writeFileSync(
93+ join(claudeDir, "helper.md"),
94+ "---\ndescription: Claude helper\n---\n\nHelp with tasks.",
95+ );
96+ const agents = loadAgents(dir);
97+ expect(agents.get("helper")?.description).toBe("Claude helper");
98+ expect(agents.get("helper")?.source).toBe("local");
99+ });
100+
101+ test(".agents/agents/ overrides .claude/agents/ for same name", () => {
102+ const claudeDir = join(dir, ".claude", "agents");
103+ mkdirSync(claudeDir, { recursive: true });
104+ writeFileSync(
105+ join(claudeDir, "helper.md"),
106+ "---\ndescription: claude version\n---\n\nClaude prompt",
107+ );
108+ writeAgent(
109+ dir,
110+ "helper",
111+ "---\ndescription: agents version\n---\n\nAgents prompt",
112+ );
113+ const agent = loadAgents(dir).get("helper");
114+ expect(agent?.description).toBe("agents version");
115+ });
72116 });
src/cli/agents.ts+11−7
@@ -1,12 +1,18 @@
11 // ─── Types ────────────────────────────────────────────────────────────────────
22
3-import { loadMarkdownConfigs } from "./load-markdown-configs.ts";
3+import {
4+ baseConfigFields,
5+ loadMarkdownConfigs,
6+} from "./load-markdown-configs.ts";
47
5-interface AgentConfig {
8+export interface AgentConfig {
69 name: string;
710 description: string;
811 /** Override model for this agent (optional) */
912 model?: string;
13+ /** Agent mode: "primary" (interactive session), "subagent" (subprocess only), "all" (both).
14+ * Defaults to "subagent" when omitted for backward compatibility. */
15+ mode?: "primary" | "subagent" | "all";
1016 /** System prompt (the markdown body after frontmatter) */
1117 systemPrompt: string;
1218 /** "global" (~/.agents/) or "local" (./.agents/) — local wins on conflict */
@@ -20,13 +26,11 @@ export function loadAgents(cwd: string): Map<string, AgentConfig> {
2026 type: "agents",
2127 strategy: "flat",
2228 cwd,
23- includeClaudeDirs: false,
29+ includeClaudeDirs: true,
2430 mapConfig: ({ name, meta, body, source }) => ({
25- name,
26- description: meta.description ?? name,
27- ...(meta.model ? { model: meta.model } : {}),
31+ ...baseConfigFields(name, meta, source),
32+ ...(meta.mode ? { mode: meta.mode } : {}),
2833 systemPrompt: body,
29- source,
3034 }),
3135 });
3236 }
src/cli/commands.ts+71−55
@@ -36,7 +36,14 @@ export interface CommandContext {
3636 startNewSession: () => void;
3737
3838 connectMcpServer: (name: string) => Promise<void>;
39- runSubagent: (prompt: string, model?: string) => Promise<SubagentOutput>;
39+ runSubagent: (
40+ prompt: string,
41+ agentName?: string,
42+ model?: string,
43+ ) => Promise<SubagentOutput>;
44+
45+ activeAgent: string | null;
46+ setActiveAgent: (name: string | null, systemPrompt?: string) => void;
4047
4148 cwd: string;
4249 }
@@ -326,54 +333,6 @@ async function handleMcp(ctx: CommandContext, args: string): Promise<void> {
326333 }
327334 }
328335
329-// ─── Review ───────────────────────────────────────────────────────────────────
330-
331-const REVIEW_PROMPT = (cwd: string, focus: string) => `\
332-You are a code reviewer. Review recent changes and provide actionable feedback.
333-
334-Working directory: ${cwd}
335-${focus ? `Review: ${focus}` : "Review the current changes"}
336-
337-Perform a sensible code review:
338-
339-- Correctness: Are the changes in alignment with the goal?
340-- Code quality: Is there duplicate, dead or bad code patterns introduced or as a result of the changes?
341-- Is the code performant?
342-- Never flag style choices as bugs, don't be a zeolot.
343-- Never flag false positives, if you think something is wrong, check before saying it's an issue.
344-
345-Output a small summary with only the issues found. If nothing of note was found reply saying that.
346-`;
347-
348-async function handleReview(
349- ctx: CommandContext,
350- args: string,
351-): Promise<CommandResult> {
352- const focus = args.trim();
353- writeln(
354- `${PREFIX.info} ${c.cyan("review")} ${c.dim("— spawning review subagent…")}`,
355- );
356- writeln();
357-
358- try {
359- const output = await ctx.runSubagent(REVIEW_PROMPT(ctx.cwd, focus));
360- assertSubagentMerged(output);
361-
362- // Show review results.
363- write(renderMarkdown(output.result));
364- writeln();
365-
366- // Send results to LLM as well.
367- return {
368- type: "inject-user-message",
369- text: `Code review output:\n\n${output.result}\n\n<system-message>Review the findings and summarize them to the user.</system-message>`,
370- };
371- } catch (e) {
372- writeln(`${PREFIX.error} review failed: ${String(e)}`);
373- return { type: "handled" };
374- }
375-}
376-
377336 function handleNew(ctx: CommandContext): void {
378337 ctx.startNewSession();
379338 writeln(
@@ -398,7 +357,7 @@ async function handleCustomCommand(
398357 writeln(`${PREFIX.info} ${label} ${src}`);
399358 writeln();
400359 try {
401- const output = await ctx.runSubagent(prompt, cmd.model);
360+ const output = await ctx.runSubagent(prompt, cmd.agent, cmd.model);
402361 assertSubagentMerged(output);
403362
404363 write(renderMarkdown(output.result));
@@ -414,6 +373,61 @@ async function handleCustomCommand(
414373 }
415374 }
416375
376+// ─── Agent ────────────────────────────────────────────────────────────────────
377+
378+function handleAgent(ctx: CommandContext, args: string): void {
379+ const raw = args.trim();
380+ const agents = loadAgents(ctx.cwd);
381+
382+ if (!raw) {
383+ // List all agents
384+ if (agents.size === 0) {
385+ writeln(
386+ c.dim(" no agents found (~/.agents/agents/ or .agents/agents/)"),
387+ );
388+ writeln(
389+ c.dim(" /agent <name> to activate · /agent off to deactivate"),
390+ );
391+ return;
392+ }
393+ writeln();
394+ writeln(c.dim(" agents:"));
395+ for (const agent of agents.values()) {
396+ const modeTag = agent.mode ? c.dim(` [${agent.mode}]`) : "";
397+ const srcTag =
398+ agent.source === "local" ? c.dim(" (local)") : c.dim(" (global)");
399+ const active = ctx.activeAgent === agent.name ? c.cyan(" ◀ active") : "";
400+ writeln(
401+ ` ${c.magenta(`@${agent.name}`.padEnd(26))} ${c.dim(agent.description)}${modeTag}${srcTag}${active}`,
402+ );
403+ }
404+ writeln();
405+ writeln(
406+ c.dim(" /agent <name> to activate · /agent off to deactivate"),
407+ );
408+ writeln();
409+ return;
410+ }
411+
412+ if (raw.toLowerCase() === "off" || raw.toLowerCase() === "none") {
413+ ctx.setActiveAgent(null);
414+ writeln(`${PREFIX.info} ${c.dim("active agent cleared")}`);
415+ return;
416+ }
417+
418+ const agent = agents.get(raw);
419+ if (!agent) {
420+ writeln(`${PREFIX.error} agent ${c.cyan(raw)} not found`);
421+ return;
422+ }
423+
424+ // Pass the resolved system prompt so setActiveAgent never needs to re-lookup.
425+ ctx.setActiveAgent(raw, agent.systemPrompt);
426+ writeln(
427+ `${PREFIX.success} active agent → ${c.cyan(raw)} ${c.dim("(instructions appended to system prompt)")}`,
428+ );
429+}
430+
417431 // ─── Help ─────────────────────────────────────────────────────────────────────
418432
419433 function handleHelp(
@@ -430,7 +444,7 @@ function handleHelp(
430444 "/ralph",
431445 "toggle ralph mode (autonomous loop, fresh context each iteration)",
432446 ],
433- ["/review [focus]", "run a structured code review on recent changes"],
447+ ["/agent [name]", "set or clear active primary agent"],
434448 ["/mcp list", "list MCP servers"],
435449 ["/mcp add <n> <t> [u]", "add an MCP server"],
436450 ["/mcp remove <name>", "remove an MCP server"],
@@ -461,10 +475,11 @@ function handleHelp(
461475 writeln();
462476 writeln(c.dim(" agents (~/.agents/agents/ or .agents/agents/):"));
463477 for (const agent of agents.values()) {
478+ const modeTag = agent.mode ? c.dim(` [${agent.mode}]`) : "";
464479 const tag =
465480 agent.source === "local" ? c.dim(" (local)") : c.dim(" (global)");
466481 writeln(
467- ` ${c.magenta(`@${agent.name}`.padEnd(26))} ${c.dim(agent.description)}${tag}`,
482+ ` ${c.magenta(`@${agent.name}`.padEnd(26))} ${c.dim(agent.description)}${modeTag}${tag}`,
468483 );
469484 }
470485 }
@@ -536,6 +551,10 @@ export async function handleCommand(
536551 handleRalph(ctx);
537552 return { type: "handled" };
538553
554+ case "agent":
555+ handleAgent(ctx, args);
556+ return { type: "handled" };
557+
539558 case "mcp":
540559 await handleMcp(ctx, args);
541560 return { type: "handled" };
@@ -544,9 +563,6 @@ export async function handleCommand(
544563 handleNew(ctx);
545564 return { type: "handled" };
546565
547- case "review":
548- return await handleReview(ctx, args);
549-
550566 case "help":
551567 case "?":
552568 handleHelp(ctx, custom);
src/cli/custom-commands.ts+8−5
@@ -1,12 +1,17 @@
11 // ─── Types ────────────────────────────────────────────────────────────────────
22
3-import { loadMarkdownConfigs } from "./load-markdown-configs.ts";
3+import {
4+ baseConfigFields,
5+ loadMarkdownConfigs,
6+} from "./load-markdown-configs.ts";
47
58 export interface CustomCommand {
69 name: string;
710 description: string;
811 /** Override model for this command (optional) */
912 model?: string;
13+ /** Run command under a specific agent's system prompt (optional) */
14+ agent?: string;
1015 /** Raw template string (after frontmatter is stripped) */
1116 template: string;
1217 /** "global" (~/.agents/) or "local" (./.agents/) — local wins on conflict */
@@ -22,11 +27,9 @@ export function loadCustomCommands(cwd: string): Map<string, CustomCommand> {
2227 cwd,
2328 includeClaudeDirs: true,
2429 mapConfig: ({ name, meta, body, source }) => ({
25- name,
26- description: meta.description ?? name,
27- ...(meta.model ? { model: meta.model } : {}),
30+ ...baseConfigFields(name, meta, source),
31+ ...(meta.agent ? { agent: meta.agent } : {}),
2832 template: body,
29- source,
3033 }),
3134 });
3235 }
src/cli/frontmatter.test.ts+25−0
@@ -44,4 +44,29 @@ describe("parseFrontmatter", () => {
4444 body: raw,
4545 });
4646 });
47+
48+ test("parses mode field for valid values", () => {
49+ const raw = "---\nname: reviewer\nmode: primary\n---\n\nDo a review.";
50+ expect(parseFrontmatter(raw).meta.mode).toBe("primary");
51+ });
52+
53+ test("parses mode: subagent and mode: all", () => {
54+ expect(parseFrontmatter("---\nmode: subagent\n---\n\nBody").meta.mode).toBe(
55+ "subagent",
56+ );
57+ expect(parseFrontmatter("---\nmode: all\n---\n\nBody").meta.mode).toBe(
58+ "all",
59+ );
60+ });
61+
62+ test("ignores invalid mode values", () => {
63+ const raw = "---\nmode: unknown\n---\n\nBody";
64+ expect(parseFrontmatter(raw).meta.mode).toBeUndefined();
65+ });
66+
67+ test("parses agent field for commands", () => {
68+ const raw =
69+ "---\ndescription: Run tests\nagent: build\n---\n\nRun npm test";
70+ expect(parseFrontmatter(raw).meta.agent).toBe("build");
71+ });
4772 });
src/cli/frontmatter.ts+10−0
@@ -4,6 +4,10 @@ export interface Frontmatter {
44 description?: string;
55 model?: string;
66 name?: string;
7+ /** Agent mode: "primary" (interactive session), "subagent" (subprocess only), "all" (both) */
8+ mode?: "primary" | "subagent" | "all";
9+ /** For commands: name of the agent to run the command under */
10+ agent?: string;
711 }
812
913 const FM_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
@@ -28,6 +32,12 @@ export function parseFrontmatter(raw: string): {
2832 if (key === "name") meta.name = val;
2933 if (key === "description") meta.description = val;
3034 if (key === "model") meta.model = val;
35+ if (
36+ key === "mode" &&
37+ (val === "primary" || val === "subagent" || val === "all")
38+ )
39+ meta.mode = val;
40+ if (key === "agent") meta.agent = val;
3141 }
3242
3343 return { meta, body: (m[2] ?? "").trim() };
src/cli/load-markdown-configs.ts+14−0
@@ -4,6 +4,20 @@ import { basename, join } from "node:path";
44 import { warnConventionConflicts } from "./config-conflicts.ts";
55 import { type Frontmatter, parseFrontmatter } from "./frontmatter.ts";
66
7+/** Common fields shared by all markdown-based configs (agents, commands, skills). */
8+export function baseConfigFields(
9+ name: string,
10+ meta: Frontmatter,
11+ source: "global" | "local",
12+) {
13+ return {
14+ name,
15+ description: meta.description ?? name,
16+ ...(meta.model ? { model: meta.model } : {}),
17+ source,
18+ } as const;
19+}
20+
721 interface MarkdownConfigLoaderOptions<T> {
822 type: "commands" | "skills" | "agents";
923 /** Strategy for file discovery: 'flat' reads dir/*.md, 'nested' reads dir/<name>/SKILL.md */
src/cli/status-bar.ts+2−0
@@ -43,6 +43,7 @@ export function renderStatusBar(opts: {
4343 contextWindow: number | null;
4444 ralphMode?: boolean;
4545 thinkingEffort?: string | null;
46+ activeAgent?: string | null;
4647 }): void {
4748 const cols = (process.stdout as NodeJS.WriteStream).columns ?? 80;
4849
@@ -52,6 +53,7 @@ export function renderStatusBar(opts: {
5253 if (opts.provider && opts.provider !== "zen") left.push(c.dim(opts.provider));
5354 left.push(c.dim(opts.sessionId.slice(0, 8)));
5455 if (opts.ralphMode) left.push(c.magenta("↻ ralph"));
56+ if (opts.activeAgent) left.push(c.green(`@${opts.activeAgent}`));
5557
5658 const right: string[] = [];
5759 if (opts.inputTokens > 0 || opts.outputTokens > 0) {
src/index.ts+37−2
@@ -1,6 +1,6 @@
11 #!/usr/bin/env bun
2-import { writeSync } from "node:fs";
3-import { tmpdir } from "node:os";
2+import { existsSync, mkdirSync, writeFileSync, writeSync } from "node:fs";
3+import { homedir, tmpdir } from "node:os";
44 import { join } from "node:path";
55
66 import * as c from "yoctocolors";
@@ -166,6 +166,37 @@ function printHelp(): void {
166166 writeln(` mc -l ${c.dim("# list sessions")}`);
167167 }
168168
169+// ─── Bootstrap global defaults ────────────────────────────────────────────────
170+
171+const REVIEW_COMMAND_CONTENT = `---
172+description: Review recent changes for correctness, code quality, and performance
173+---
174+You are a code reviewer. Review recent changes and provide actionable feedback.
175+
176+$ARGUMENTS
177+
178+Perform a sensible code review:
179+- Correctness: Are the changes in alignment with the goal?
180+- Code quality: Is there duplicate, dead, or bad code patterns introduced?
181+- Is the code performant?
182+- Never flag style choices as bugs, don't be a zealot.
183+- Never flag false positives, check before raising an issue.
184+
185+Output a small summary with only the issues found. If nothing is wrong, say so.
186+`;
187+
188+function bootstrapGlobalDefaults(): void {
189+ const commandsDir = join(homedir(), ".agents", "commands");
190+ const reviewPath = join(commandsDir, "review.md");
191+ if (!existsSync(reviewPath)) {
192+ mkdirSync(commandsDir, { recursive: true });
193+ writeFileSync(reviewPath, REVIEW_COMMAND_CONTENT, "utf-8");
194+ writeln(
195+ `${c.green("✓")} created ${c.dim("~/.agents/commands/review.md")} ${c.dim("(edit it to customise your reviews)")}`,
196+ );
197+ }
198+}
199+
169200 // ─── Main ─────────────────────────────────────────────────────────────────────
170201
171202 async function main(): Promise<void> {
@@ -198,6 +229,10 @@ async function main(): Promise<void> {
198229 // Determine model: CLI flag > persisted user preference > auto-discover
199230 const model = args.model ?? getPreferredModel() ?? autoDiscoverModel();
200231
232+ if (!args.subagent) {
233+ bootstrapGlobalDefaults();
234+ }
235+
201236 if (args.subagent) {
202237 // Headless mode: no banner, no interactive loop, single prompt then exit
203238 const parentCwd = args.cwd;