xonecas.io
64875
Mc

mini-coder / commit 34f064d

feat: improve cli command config and tool result rendering

xonecas2026-03-15 34f064d13cd1c1f7bc4c1f82b0234064d603e5e8 parent 536a897

20 files changed

TODO.md+2−0
@@ -1,5 +1,7 @@
11 # TODO
22
3+- Gpt 5.4 shows reasoning correctly, but Gpt 5.3 codex does not. Is this a mini-coder issue?
4+
35 ---
46
57 ## UI Audit
mini-coder-idea.md+1−0
@@ -41,6 +41,7 @@ conventions and not introduce more specs. (`.agents` / `AGENTS.md`, while also s
4141 - `/model` (alias `/models`) command allows the user to pick a model from connected providers. As well as thinking effort for the model if supported. Selection persists accross sessions.
4242 - `/undo` removes the last turn from conversation history, it does not restore filesystem state.
4343 - `/reasoning` toggles display of model reasoning output.
44+ - `/verbose` toggles output truncation. Tuncates large outputs keeping start and end sections and truncating the rest when verbose is off.
4445 - `/context` configures context pruning and tool-result caps.
4546 - `/cache` toggles prompt caching globally; sub-commands configure provider-specific caching (`/cache openai <in_memory|24h>`, `/cache gemini <off|cachedContents/...>`).
4647 - `/review` reviews recent changes via a global custom command installed at app start (`~/.agents/commands/review.md`), and can be customized or shadowed locally.
src/agent/agent.ts+10−0
@@ -17,6 +17,7 @@ import {
1717 setPreferredShowReasoning,
1818 setPreferredThinkingEffort,
1919 setPreferredToolResultPayloadCapBytes,
20+ setPreferredVerboseOutput,
2021 } from "../session/db/index.ts";
2122 import type { AgentReporter } from "./reporter.ts";
2223 import { SessionRunner } from "./session-runner.ts";
@@ -28,6 +29,7 @@ interface AgentOptions {
2829 cwd: string;
2930 initialThinkingEffort: ThinkingEffort | null;
3031 initialShowReasoning: boolean;
32+ initialVerboseOutput: boolean;
3133 initialPruningMode: ContextPruningMode;
3234 initialToolResultPayloadCapBytes: number;
3335 initialPromptCachingEnabled: boolean;
@@ -105,6 +107,7 @@ export async function initAgent(opts: AgentOptions): Promise<{
105107 initialModel: currentModel,
106108 initialThinkingEffort: opts.initialThinkingEffort,
107109 initialShowReasoning: opts.initialShowReasoning,
110+ initialVerboseOutput: opts.initialVerboseOutput,
108111 initialPruningMode: opts.initialPruningMode,
109112 initialToolResultPayloadCapBytes: opts.initialToolResultPayloadCapBytes,
110113 initialPromptCachingEnabled: opts.initialPromptCachingEnabled,
@@ -154,6 +157,13 @@ export async function initAgent(opts: AgentOptions): Promise<{
154157 runner.showReasoning = show;
155158 setPreferredShowReasoning(show);
156159 },
160+ get verboseOutput() {
161+ return runner.verboseOutput;
162+ },
163+ setVerboseOutput: (verbose) => {
164+ runner.verboseOutput = verbose;
165+ setPreferredVerboseOutput(verbose);
166+ },
157167 get pruningMode() {
158168 return runner.pruningMode;
159169 },
src/agent/reporter.ts+1−1
@@ -37,7 +37,7 @@ export interface AgentReporter {
3737
3838 renderTurn(
3939 events: AsyncIterable<TurnEvent>,
40- opts?: { showReasoning?: boolean },
40+ opts?: { showReasoning?: boolean; verboseOutput?: boolean },
4141 ): Promise<TurnResult>;
4242 renderStatusBar(data: StatusBarData): void;
4343
src/agent/session-runner.ts+4−0
@@ -30,6 +30,7 @@ interface SessionRunnerOptions {
3030 initialModel: string;
3131 initialThinkingEffort: ThinkingEffort | null;
3232 initialShowReasoning: boolean;
33+ initialVerboseOutput: boolean;
3334 initialPruningMode: ContextPruningMode;
3435 initialToolResultPayloadCapBytes: number;
3536 initialPromptCachingEnabled: boolean;
@@ -60,6 +61,7 @@ export class SessionRunner {
6061 public currentModel: string;
6162 public currentThinkingEffort: ThinkingEffort | null;
6263 public showReasoning: boolean;
64+ public verboseOutput: boolean;
6365 public pruningMode: ContextPruningMode;
6466 public toolResultPayloadCapBytes: number;
6567 public promptCachingEnabled: boolean;
@@ -87,6 +89,7 @@ export class SessionRunner {
8789 this.currentModel = opts.initialModel;
8890 this.currentThinkingEffort = opts.initialThinkingEffort;
8991 this.showReasoning = opts.initialShowReasoning;
92+ this.verboseOutput = opts.initialVerboseOutput;
9093 this.pruningMode = opts.initialPruningMode;
9194 this.toolResultPayloadCapBytes = opts.initialToolResultPayloadCapBytes;
9295 this.promptCachingEnabled = opts.initialPromptCachingEnabled;
@@ -236,6 +239,7 @@ export class SessionRunner {
236239 const { inputTokens, outputTokens, contextTokens, newMessages } =
237240 await this.reporter.renderTurn(events, {
238241 showReasoning: this.showReasoning,
242+ verboseOutput: this.verboseOutput,
239243 });
240244 const historyMessages = sanitizeModelAuthoredMessages(
241245 newMessages,
src/cli/commands-config.test.ts+15−0
@@ -3,6 +3,7 @@ import {
33 handleCacheCommand,
44 handleContextCommand,
55 handleReasoningCommand,
6+ handleVerboseCommand,
67 } from "./commands-config.ts";
78 import type { CommandContext } from "./types.ts";
89
@@ -14,6 +15,8 @@ function createContext(overrides?: Partial<CommandContext>): CommandContext {
1415 setThinkingEffort: () => {},
1516 showReasoning: true,
1617 setShowReasoning: () => {},
18+ verboseOutput: false,
19+ setVerboseOutput: () => {},
1720 pruningMode: "balanced",
1821 setPruningMode: () => {},
1922 toolResultPayloadCapBytes: 0,
@@ -71,4 +74,16 @@ describe("commands-config", () => {
7174 handleReasoningCommand(ctx, "");
7275 expect(reasoningVisible).toBe(false);
7376 });
77+
78+ test("/verbose toggles when no arg is provided", () => {
79+ let verboseOutput = false;
80+ const ctx = createContext({
81+ verboseOutput,
82+ setVerboseOutput: (value) => {
83+ verboseOutput = value;
84+ },
85+ });
86+ handleVerboseCommand(ctx, "");
87+ expect(verboseOutput).toBe(true);
88+ });
7489 });
src/cli/commands-config.ts+39−13
@@ -2,33 +2,59 @@ import * as c from "yoctocolors";
22 import { PREFIX, writeln } from "./output.ts";
33 import type { CommandContext } from "./types.ts";
44
5-export function handleReasoningCommand(
6- ctx: CommandContext,
7- args: string,
8-): void {
9- const mode = args.trim().toLowerCase();
5+function handleBooleanToggleCommand(opts: {
6+ args: string;
7+ current: boolean;
8+ set: (value: boolean) => void;
9+ label: string;
10+ usage: string;
11+}): void {
12+ const mode = opts.args.trim().toLowerCase();
1013 if (!mode) {
11- const nextVisibility = !ctx.showReasoning;
12- ctx.setShowReasoning(nextVisibility);
14+ const nextValue = !opts.current;
15+ opts.set(nextValue);
1316 writeln(
14- `${PREFIX.success} reasoning display ${nextVisibility ? c.green("on") : c.dim("off")}`,
17+ `${PREFIX.success} ${opts.label} ${nextValue ? c.green("on") : c.dim("off")}`,
1518 );
1619 return;
1720 }
1821
1922 if (mode === "on") {
20- ctx.setShowReasoning(true);
21- writeln(`${PREFIX.success} reasoning display ${c.green("on")}`);
23+ opts.set(true);
24+ writeln(`${PREFIX.success} ${opts.label} ${c.green("on")}`);
2225 return;
2326 }
2427
2528 if (mode === "off") {
26- ctx.setShowReasoning(false);
27- writeln(`${PREFIX.success} reasoning display ${c.dim("off")}`);
29+ opts.set(false);
30+ writeln(`${PREFIX.success} ${opts.label} ${c.dim("off")}`);
2831 return;
2932 }
3033
31- writeln(`${PREFIX.error} usage: /reasoning <on|off>`);
34+ writeln(`${PREFIX.error} usage: ${opts.usage}`);
35+}
36+
37+export function handleReasoningCommand(
38+ ctx: CommandContext,
39+ args: string,
40+): void {
41+ handleBooleanToggleCommand({
42+ args,
43+ current: ctx.showReasoning,
44+ set: (value) => ctx.setShowReasoning(value),
45+ label: "reasoning display",
46+ usage: "/reasoning <on|off>",
47+ });
48+}
49+
50+export function handleVerboseCommand(ctx: CommandContext, args: string): void {
51+ handleBooleanToggleCommand({
52+ args,
53+ current: ctx.verboseOutput,
54+ set: (value) => ctx.setVerboseOutput(value),
55+ label: "verbose output",
56+ usage: "/verbose <on|off>",
57+ });
3258 }
3359
3460 export function handleContextCommand(ctx: CommandContext, args: string): void {
src/cli/commands-help.ts+1−0
@@ -30,6 +30,7 @@ export function renderHelpCommand(
3030 renderEntries([
3131 ["/model [id]", "list or switch models"],
3232 ["/reasoning [on|off]", "toggle reasoning display"],
33+ ["/verbose [on|off]", "toggle output truncation"],
3334 ["/context [prune|cap]", "configure pruning and tool-result caps"],
3435 ["/cache [...]", "configure provider prompt caching"],
3536 ["/agent [name]", "set or clear the active primary agent"],
src/cli/commands.ts+5−0
@@ -5,6 +5,7 @@ import {
55 handleCacheCommand,
66 handleContextCommand,
77 handleReasoningCommand,
8+ handleVerboseCommand,
89 } from "./commands-config.ts";
910 import { renderHelpCommand } from "./commands-help.ts";
1011 import { handleMcpCommand } from "./commands-mcp.ts";
@@ -135,6 +136,10 @@ export async function handleCommand(
135136 handleReasoningCommand(ctx, args);
136137 return { type: "handled" };
137138
139+ case "verbose":
140+ handleVerboseCommand(ctx, args);
141+ return { type: "handled" };
142+
138143 case "context":
139144 handleContextCommand(ctx, args);
140145 return { type: "handled" };
src/cli/completions.test.ts+9−3
@@ -38,6 +38,12 @@ describe("getCommandCompletions", () => {
3838 expect(results).toContain("/reasoning off");
3939 });
4040
41+ test("completes /verbose params", () => {
42+ const results = getCommandCompletions("/verbose o", cwd);
43+ expect(results).toContain("/verbose on");
44+ expect(results).toContain("/verbose off");
45+ });
46+
4147 test("completes /context subcommands", () => {
4248 const results = getCommandCompletions("/context p", cwd);
4349 expect(results).toContain("/context prune");
@@ -78,11 +84,11 @@ describe("getCommandCompletions", () => {
7884 expect(results).toEqual(["/undo"]);
7985 });
8086
81- test("/ alone lists all commands", () => {
87+ test("/ alone lists top commands", () => {
8288 const results = getCommandCompletions("/", cwd);
83- expect(results.length).toBeGreaterThan(5);
89+ expect(results.length).toBe(10);
8490 expect(results).toContain("/model");
85- expect(results).toContain("/help");
91+ expect(results).toContain("/verbose");
8692 });
8793
8894 test("returns empty for fourth token", () => {
src/cli/completions.ts+2−0
@@ -10,6 +10,7 @@ const BUILTIN_COMMANDS = [
1010 "models",
1111 "undo",
1212 "reasoning",
13+ "verbose",
1314 "context",
1415 "cache",
1516 "agent",
@@ -25,6 +26,7 @@ const BUILTIN_COMMANDS = [
2526 const COMMAND_PARAMS: Record<string, string[] | ((cwd: string) => string[])> = {
2627 model: ["effort"],
2728 reasoning: ["on", "off"],
29+ verbose: ["on", "off"],
2830 context: ["prune", "cap"],
2931 cache: ["on", "off", "openai", "gemini"],
3032 mcp: ["list", "add", "remove", "rm"],
src/cli/headless-reporter.ts+1−1
@@ -27,7 +27,7 @@ export class HeadlessReporter implements AgentReporter {
2727
2828 async renderTurn(
2929 events: AsyncIterable<TurnEvent>,
30- _opts?: { showReasoning?: boolean },
30+ _opts?: { showReasoning?: boolean; verboseOutput?: boolean },
3131 ): Promise<TurnResult> {
3232 let inputTokens = 0;
3333 let outputTokens = 0;
src/cli/output.ts+1−1
@@ -213,7 +213,7 @@ export class CliReporter implements AgentReporter {
213213
214214 async renderTurn(
215215 events: AsyncIterable<TurnEvent>,
216- opts?: { showReasoning?: boolean },
216+ opts?: { showReasoning?: boolean; verboseOutput?: boolean },
217217 ): Promise<TurnResult> {
218218 this.liveOutput.finish();
219219 return renderTurn(events, this.spinner, opts);
src/cli/stream-render.ts+5−2
@@ -15,7 +15,7 @@ import { renderToolCall, renderToolResult } from "./tool-render.ts";
1515 export async function renderTurn(
1616 events: AsyncIterable<TurnEvent>,
1717 spinner: Spinner,
18- opts?: { showReasoning?: boolean },
18+ opts?: { showReasoning?: boolean; verboseOutput?: boolean },
1919 ): Promise<{
2020 inputTokens: number;
2121 outputTokens: number;
@@ -24,6 +24,7 @@ export async function renderTurn(
2424 reasoningText: string;
2525 }> {
2626 const showReasoning = opts?.showReasoning ?? true;
27+ const verboseOutput = opts?.verboseOutput ?? false;
2728 const content = new StreamRenderContent(spinner);
2829 const liveReasoning = new LiveReasoningBlock();
2930
@@ -87,7 +88,9 @@ export async function renderTurn(
8788 startedToolCalls.delete(event.toolCallId);
8889 liveReasoning.finish();
8990 spinner.stop();
90- renderToolResult(event.toolName, event.result, event.isError);
91+ renderToolResult(event.toolName, event.result, event.isError, {
92+ verboseOutput,
93+ });
9194 renderedVisibleOutput = true;
9295
9396 spinner.start("thinking");
src/cli/tool-render.test.ts+55−0
@@ -120,6 +120,61 @@ describe("renderToolResult", () => {
120120 expect(plain).toContain("│ world");
121121 });
122122
123+ test("truncates shell previews by keeping head and tail when verbose is off", () => {
124+ captureStdout();
125+ const stdoutLines = Array.from(
126+ { length: 8 },
127+ (_, i) => `line-${i + 1}`,
128+ ).join("\n");
129+
130+ renderToolResult(
131+ "shell",
132+ {
133+ stdout: stdoutLines,
134+ stderr: "",
135+ exitCode: 0,
136+ success: true,
137+ timedOut: false,
138+ streamedOutput: false,
139+ },
140+ false,
141+ );
142+
143+ const plain = stripAnsi(stdout);
144+ expect(plain).toContain("│ line-1");
145+ expect(plain).toContain("│ line-2");
146+ expect(plain).toContain("… +4 lines");
147+ expect(plain).toContain("│ line-7");
148+ expect(plain).toContain("│ line-8");
149+ });
150+
151+ test("shows full shell previews when verbose is on", () => {
152+ captureStdout();
153+ const stdoutLines = Array.from(
154+ { length: 8 },
155+ (_, i) => `line-${i + 1}`,
156+ ).join("\n");
157+
158+ renderToolResult(
159+ "shell",
160+ {
161+ stdout: stdoutLines,
162+ stderr: "",
163+ exitCode: 0,
164+ success: true,
165+ timedOut: false,
166+ streamedOutput: false,
167+ },
168+ false,
169+ { verboseOutput: true },
170+ );
171+
172+ const plain = stripAnsi(stdout);
173+ expect(plain).toContain("│ line-1");
174+ expect(plain).toContain("│ line-8");
175+ expect(plain).not.toContain("… +");
176+ });
177+
123178 test("renders compact listSkills previews", () => {
124179 captureStdout();
125180
src/cli/tool-render.ts+11−2
@@ -62,20 +62,29 @@ function formatErrorBadge(result: unknown): string {
6262 return `${G.err} ${c.red(oneLiner)}`;
6363 }
6464
65+interface ToolResultRenderOptions {
66+ verboseOutput?: boolean;
67+}
68+
6569 export function renderToolResult(
6670 toolName: string,
6771 result: unknown,
6872 isError: boolean,
73+ opts?: ToolResultRenderOptions,
6974 ): void {
7075 if (isError) {
7176 writeln(` ${formatErrorBadge(result)}`);
7277 return;
7378 }
7479
75- if (renderToolResultByName(toolName, result)) {
80+ if (renderToolResultByName(toolName, result, opts)) {
7681 return;
7782 }
7883
7984 const text = JSON.stringify(result);
80- writeln(` ${c.dim(text.length > 120 ? `${text.slice(0, 117)}…` : text)}`);
85+ if (opts?.verboseOutput || text.length <= 120) {
86+ writeln(` ${c.dim(text)}`);
87+ return;
88+ }
89+ writeln(` ${c.dim(`${text.slice(0, 117)}…`)}`);
8190 }
src/cli/tool-result-renderers.ts+106−37
@@ -1,7 +1,15 @@
11 import * as c from "yoctocolors";
22 import { G, writeln } from "./output.ts";
33
4-type ToolResultRenderer = (result: unknown, toolName?: string) => boolean;
4+interface ToolResultRenderOptions {
5+ verboseOutput?: boolean;
6+}
7+
8+type ToolResultRenderer = (
9+ result: unknown,
10+ opts?: ToolResultRenderOptions,
11+ toolName?: string,
12+) => boolean;
513 function writePreviewLines(opts: {
614 label: string;
715 value: string;
@@ -11,17 +19,35 @@ function writePreviewLines(opts: {
1119 if (!opts.value.trim()) return;
1220 const lines = opts.value.split("\n");
1321 writeln(` ${c.dim(opts.label)} ${c.dim(`(${lines.length} lines)`)}`);
14- for (const line of lines.slice(0, opts.maxLines)) {
22+ if (!Number.isFinite(opts.maxLines) || lines.length <= opts.maxLines) {
23+ for (const line of lines) {
24+ writeln(` ${opts.lineColor("│")} ${line}`);
25+ }
26+ return;
27+ }
28+
29+ const headCount = Math.max(1, Math.ceil(opts.maxLines / 2));
30+ const tailCount = Math.max(0, Math.floor(opts.maxLines / 2));
31+ for (const line of lines.slice(0, headCount)) {
1532 writeln(` ${opts.lineColor("│")} ${line}`);
1633 }
17- if (lines.length > opts.maxLines) {
18- writeln(
19- ` ${opts.lineColor("│")} ${c.dim(`… +${lines.length - opts.maxLines} lines`)}`,
20- );
34+ const hiddenLines = Math.max(0, lines.length - (headCount + tailCount));
35+ if (hiddenLines > 0) {
36+ writeln(` ${opts.lineColor("│")} ${c.dim(`… +${hiddenLines} lines`)}`);
37+ }
38+ if (tailCount > 0) {
39+ for (const line of lines.slice(-tailCount)) {
40+ writeln(` ${opts.lineColor("│")} ${line}`);
41+ }
2142 }
2243 }
2344
24-function truncateOneLine(value: string, max = 100): string {
45+function truncateOneLine(
46+ value: string,
47+ max = 100,
48+ verboseOutput = false,
49+): string {
50+ if (verboseOutput) return value;
2551 return value.length > max ? `${value.slice(0, max - 1)}…` : value;
2652 }
2753
@@ -47,6 +73,7 @@ function buildShellSummaryParts(opts: {
4773 stderrLines: number;
4874 stdoutSingleLine: string | null;
4975 streamedOutput: boolean;
76+ verboseOutput: boolean;
5077 }): string[] {
5178 const parts = [`exit ${opts.exitCode}`];
5279 if (opts.streamedOutput) {
@@ -64,7 +91,9 @@ function buildShellSummaryParts(opts: {
6491 opts.stdoutSingleLine !== null &&
6592 opts.stdoutSingleLine.length > 0
6693 ) {
67- parts.push(`out: ${truncateOneLine(opts.stdoutSingleLine)}`);
94+ parts.push(
95+ `out: ${truncateOneLine(opts.stdoutSingleLine, 100, opts.verboseOutput)}`,
96+ );
6897 return parts;
6998 }
7099
@@ -91,7 +120,10 @@ function shouldPreviewShellStdout(opts: {
91120 return opts.stdoutSingleLine === null;
92121 }
93122
94-function renderShellResult(result: unknown): boolean {
123+function renderShellResult(
124+ result: unknown,
125+ opts?: ToolResultRenderOptions,
126+): boolean {
95127 const r = result as {
96128 stdout: string;
97129 stderr: string;
@@ -105,6 +137,7 @@ function renderShellResult(result: unknown): boolean {
105137 }
106138
107139 const streamedOutput = r.streamedOutput === true;
140+ const verboseOutput = opts?.verboseOutput === true;
108141 const stdoutLines = countShellLines(r.stdout);
109142 const stderrLines = countShellLines(r.stderr);
110143 const stdoutSingleLine = getSingleShellLine(r.stdout);
@@ -119,6 +152,7 @@ function renderShellResult(result: unknown): boolean {
119152 stderrLines,
120153 stdoutSingleLine,
121154 streamedOutput,
155+ verboseOutput,
122156 });
123157
124158 writeln(` ${badge} ${c.dim(parts.join(" · "))}`);
@@ -131,7 +165,7 @@ function renderShellResult(result: unknown): boolean {
131165 label: "stderr",
132166 value: r.stderr,
133167 lineColor: c.red,
134- maxLines: 6,
168+ maxLines: verboseOutput ? Number.POSITIVE_INFINITY : 6,
135169 });
136170 if (
137171 shouldPreviewShellStdout({
@@ -145,13 +179,16 @@ function renderShellResult(result: unknown): boolean {
145179 label: "stdout",
146180 value: r.stdout,
147181 lineColor: c.dim,
148- maxLines: 4,
182+ maxLines: verboseOutput ? Number.POSITIVE_INFINITY : 4,
149183 });
150184 }
151185
152186 return true;
153187 }
154-function renderSubagentResult(result: unknown): boolean {
188+function renderSubagentResult(
189+ result: unknown,
190+ _opts?: ToolResultRenderOptions,
191+): boolean {
155192 const r = result as {
156193 inputTokens?: number;
157194 outputTokens?: number;
@@ -165,9 +202,13 @@ function renderSubagentResult(result: unknown): boolean {
165202 return true;
166203 }
167204
168-function buildSkillDescriptionPart(description: string | undefined): string {
205+function buildSkillDescriptionPart(
206+ description: string | undefined,
207+ verboseOutput = false,
208+): string {
169209 const trimmed = description?.trim();
170210 if (!trimmed) return "";
211+ if (verboseOutput) return ` ${c.dim("·")} ${c.dim(trimmed)}`;
171212 return ` ${c.dim("·")} ${c.dim(trimmed.length > 60 ? `${trimmed.slice(0, 57)}…` : trimmed)}`;
172213 }
173214
@@ -177,17 +218,20 @@ function renderSkillSummaryLine(
177218 description?: string;
178219 source?: "local" | "global";
179220 },
180- label?: string,
221+ opts?: { label?: string; verboseOutput?: boolean },
181222 ): void {
182223 const name = skill.name ?? "(unknown)";
183224 const source = skill.source ?? "unknown";
184- const labelPrefix = label ? `${c.dim(label)} ` : "";
225+ const labelPrefix = opts?.label ? `${c.dim(opts.label)} ` : "";
185226 writeln(
186- ` ${G.info} ${labelPrefix}${name} ${c.dim("·")} ${c.dim(source)}${buildSkillDescriptionPart(skill.description)}`,
227+ ` ${G.info} ${labelPrefix}${name} ${c.dim("·")} ${c.dim(source)}${buildSkillDescriptionPart(skill.description, opts?.verboseOutput === true)}`,
187228 );
188229 }
189230
190-function renderListSkillsResult(result: unknown): boolean {
231+function renderListSkillsResult(
232+ result: unknown,
233+ opts?: ToolResultRenderOptions,
234+): boolean {
191235 const r = result as {
192236 skills?: Array<{
193237 name?: string;
@@ -201,17 +245,23 @@ function renderListSkillsResult(result: unknown): boolean {
201245 return true;
202246 }
203247
204- for (const skill of r.skills.slice(0, 6)) {
205- renderSkillSummaryLine(skill);
248+ const maxSkills = opts?.verboseOutput ? r.skills.length : 6;
249+ for (const skill of r.skills.slice(0, maxSkills)) {
250+ renderSkillSummaryLine(skill, {
251+ verboseOutput: opts?.verboseOutput === true,
252+ });
206253 }
207254
208- if (r.skills.length > 6) {
209- writeln(` ${c.dim(`+${r.skills.length - 6} more skills`)}`);
255+ if (r.skills.length > maxSkills) {
256+ writeln(` ${c.dim(`+${r.skills.length - maxSkills} more skills`)}`);
210257 }
211258 return true;
212259 }
213260
214-function renderReadSkillResult(result: unknown): boolean {
261+function renderReadSkillResult(
262+ result: unknown,
263+ _opts?: ToolResultRenderOptions,
264+): boolean {
215265 const r = result as {
216266 skill?: {
217267 name?: string;
@@ -224,11 +274,17 @@ function renderReadSkillResult(result: unknown): boolean {
224274 writeln(` ${G.info} ${c.dim("skill")} ${c.dim("(not found)")}`);
225275 return true;
226276 }
227- renderSkillSummaryLine(r.skill, "skill");
277+ renderSkillSummaryLine(r.skill, {
278+ label: "skill",
279+ verboseOutput: _opts?.verboseOutput === true,
280+ });
228281 return true;
229282 }
230283
231-function renderWebSearchResult(result: unknown): boolean {
284+function renderWebSearchResult(
285+ result: unknown,
286+ opts?: ToolResultRenderOptions,
287+): boolean {
232288 const r = result as {
233289 results?: Array<{ title?: string; url?: string; score?: number }>;
234290 };
@@ -238,7 +294,8 @@ function renderWebSearchResult(result: unknown): boolean {
238294 return true;
239295 }
240296
241- for (const item of r.results.slice(0, 5)) {
297+ const maxResults = opts?.verboseOutput ? r.results.length : 5;
298+ for (const item of r.results.slice(0, maxResults)) {
242299 const title = (item.title?.trim() || item.url || "(untitled)").replace(
243300 /\s+/g,
244301 " ",
@@ -251,13 +308,16 @@ function renderWebSearchResult(result: unknown): boolean {
251308 if (item.url) writeln(` ${c.dim(item.url)}`);
252309 }
253310
254- if (r.results.length > 5) {
255- writeln(` ${c.dim(` +${r.results.length - 5} more`)}`);
311+ if (r.results.length > maxResults) {
312+ writeln(` ${c.dim(` +${r.results.length - maxResults} more`)}`);
256313 }
257314 return true;
258315 }
259316
260-function renderWebContentResult(result: unknown): boolean {
317+function renderWebContentResult(
318+ result: unknown,
319+ opts?: ToolResultRenderOptions,
320+): boolean {
261321 const r = result as {
262322 results?: Array<{ url?: string; title?: string; text?: string }>;
263323 };
@@ -267,7 +327,8 @@ function renderWebContentResult(result: unknown): boolean {
267327 return true;
268328 }
269329
270- for (const item of r.results.slice(0, 3)) {
330+ const maxPages = opts?.verboseOutput ? r.results.length : 3;
331+ for (const item of r.results.slice(0, maxPages)) {
271332 const title = (item.title?.trim() || item.url || "(untitled)").replace(
272333 /\s+/g,
273334 " ",
@@ -277,24 +338,31 @@ function renderWebContentResult(result: unknown): boolean {
277338 const preview = (item.text ?? "").replace(/\s+/g, " ").trim();
278339 if (preview) {
279340 const trimmed =
280- preview.length > 220 ? `${preview.slice(0, 217)}…` : preview;
341+ opts?.verboseOutput || preview.length <= 220
342+ ? preview
343+ : `${preview.slice(0, 217)}…`;
281344 writeln(` ${c.dim(trimmed)}`);
282345 }
283346 }
284347
285- if (r.results.length > 3) {
286- writeln(` ${c.dim(` +${r.results.length - 3} more`)}`);
348+ if (r.results.length > maxPages) {
349+ writeln(` ${c.dim(` +${r.results.length - maxPages} more`)}`);
287350 }
288351 return true;
289352 }
290353
291-function renderMcpResult(result: unknown): boolean {
354+function renderMcpResult(
355+ result: unknown,
356+ opts?: ToolResultRenderOptions,
357+): boolean {
292358 const content = Array.isArray(result) ? result : [result];
359+ const maxBlocks = opts?.verboseOutput ? content.length : 5;
293360 for (const block of (
294361 content as Array<{ type?: string; text?: string }>
295- ).slice(0, 5)) {
362+ ).slice(0, maxBlocks)) {
296363 if (block?.type === "text" && block.text) {
297- const lines = block.text.split("\n").slice(0, 6);
364+ const maxLines = opts?.verboseOutput ? Number.POSITIVE_INFINITY : 6;
365+ const lines = block.text.split("\n").slice(0, maxLines);
298366 for (const line of lines) writeln(` ${c.dim("│")} ${line}`);
299367 }
300368 }
@@ -313,12 +381,13 @@ const TOOL_RESULT_RENDERERS: Readonly<Record<string, ToolResultRenderer>> = {
313381 export function renderToolResultByName(
314382 toolName: string,
315383 result: unknown,
384+ opts?: ToolResultRenderOptions,
316385 ): boolean {
317386 if (toolName.startsWith("mcp_")) {
318- return renderMcpResult(result);
387+ return renderMcpResult(result, opts);
319388 }
320389
321390 const renderer = TOOL_RESULT_RENDERERS[toolName];
322391 if (!renderer) return false;
323- return renderer(result, toolName);
392+ return renderer(result, opts, toolName);
324393 }
src/cli/types.ts+2−0
@@ -9,6 +9,8 @@ export interface CommandContext {
99 setThinkingEffort: (effort: ThinkingEffort | null) => void;
1010 showReasoning: boolean;
1111 setShowReasoning: (show: boolean) => void;
12+ verboseOutput: boolean;
13+ setVerboseOutput: (verbose: boolean) => void;
1214 pruningMode: ContextPruningMode;
1315 setPruningMode: (mode: ContextPruningMode) => void;
1416 toolResultPayloadCapBytes: number;
src/index.ts+2−0
@@ -39,6 +39,7 @@ import {
3939 getPreferredShowReasoning,
4040 getPreferredThinkingEffort,
4141 getPreferredToolResultPayloadCapBytes,
42+ getPreferredVerboseOutput,
4243 pruneOldData,
4344 } from "./session/db/index.ts";
4445 import { getMostRecentSession, printSessionList } from "./session/manager.ts";
@@ -67,6 +68,7 @@ function buildAgentOptions(opts: {
6768 cwd: opts.cwd,
6869 initialThinkingEffort: getPreferredThinkingEffort(),
6970 initialShowReasoning: getPreferredShowReasoning(),
71+ initialVerboseOutput: getPreferredVerboseOutput(),
7072 initialPruningMode: getPreferredContextPruningMode(),
7173 initialToolResultPayloadCapBytes: getPreferredToolResultPayloadCapBytes(),
7274 initialPromptCachingEnabled: getPreferredPromptCachingEnabled(),
src/session/db/settings-repo.ts+10−0
@@ -53,6 +53,16 @@ export function setPreferredShowReasoning(show: boolean): void {
5353 setSetting("preferred_show_reasoning", show ? "true" : "false");
5454 }
5555
56+export function getPreferredVerboseOutput(): boolean {
57+ const v = getSetting("preferred_verbose_output");
58+ if (v === null) return false;
59+ return v !== "false";
60+}
61+
62+export function setPreferredVerboseOutput(verbose: boolean): void {
63+ setSetting("preferred_verbose_output", verbose ? "true" : "false");
64+}
65+
5666 export function getPreferredContextPruningMode(): ContextPruningMode {
5767 const v = getSetting("preferred_context_pruning_mode");
5868 if (v === "off" || v === "balanced" || v === "aggressive") return v;