From 40f7037d8ef626d8f58f3159a162dce60f83e34c Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Sat, 2 May 2026 10:27:54 -0500 Subject: [PATCH] docs(prompts): tell the model to skip markdown tables in terminal output (#372) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Markdown tables don't render correctly in a terminal — monospace fonts plus variable-width content (especially CJK characters) can't reliably align column borders. Adds an "Output formatting" section to both base.md and base.txt instructing the model to prefer plain prose, bulleted/numbered lists, code blocks, or `- **Label**: value` pairs over tables. If column-aligned data is genuinely necessary, the guidance asks for narrow, ASCII-only, 2–3 column tables. Closes #372. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/tui/src/prompts/base.md | 11 +++++++++++ crates/tui/src/prompts/base.txt | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/crates/tui/src/prompts/base.md b/crates/tui/src/prompts/base.md index fa46dcbb..b50578aa 100644 --- a/crates/tui/src/prompts/base.md +++ b/crates/tui/src/prompts/base.md @@ -150,3 +150,14 @@ When you spawn a sub-agent via `agent_spawn`, the child runs independently. You 5. Update your `checklist_write` items to reflect the child's contribution. You may see multiple `` sentinels in a single turn when children were spawned in parallel. Process each one, then synthesize. + +## Output formatting + +You're rendering into a terminal, not a browser. Markdown tables almost never render correctly because monospace fonts + variable-width content can't reliably align column borders, especially with CJK characters. Prefer: + +- **Plain prose** for explanations. +- **Bulleted or numbered lists** for sequential or parallel items. +- **Code blocks** for code, paths, commands, and structured output. +- **Definition-style lists** (`- **Label**: value`) when the user asked for a comparison or summary. + +If you genuinely need column-aligned data (e.g. the user asked for a table or for `/cost` style output), keep columns narrow, ASCII-only, and limit to 2–3 columns. Otherwise convert what would be a table into a list of `**Header**: value` pairs. diff --git a/crates/tui/src/prompts/base.txt b/crates/tui/src/prompts/base.txt index 47cb64a9..5741a3af 100644 --- a/crates/tui/src/prompts/base.txt +++ b/crates/tui/src/prompts/base.txt @@ -40,3 +40,7 @@ Model notes: DeepSeek V4 models emit *thinking tokens* (`ContentBlock::Thinking` - **Other**: `code_execution` (Python sandbox), `validate_data` (JSON/TOML), `request_user_input`, `finance` (market quotes), `tool_search_tool_regex`, `tool_search_tool_bm25` (deferred tool discovery). Multiple `tool_calls` in one turn run in parallel. `web_search` returns `ref_id`s — cite as `(ref_id)`. + +## Output formatting + +You're rendering into a terminal, not a browser. Markdown tables almost never render correctly — monospace fonts plus variable-width content (especially CJK characters) can't reliably align column borders. Prefer plain prose, bulleted or numbered lists, code blocks, or `- **Label**: value` definition-style pairs over tables. If column-aligned data is genuinely necessary, keep columns narrow, ASCII-only, and limit to 2–3 columns.