Skip to content

ProductNot yet confirmed elsewhere1 publisher2 min readPublished

DuckDB's 59% token cut for coding agents never showed up in total cost

DuckDB v2.0's CLI agent mode cut the DuckDB output a coding agent reads by 59% in a 132-run test DuckDB published. Total cost and runtime did not improve, the post says, so a team adopting the mode gets clearer output and no smaller invoice.

The Product Desk

How we use AISend a correction

Agent mode read fewer tokens but took more turns DuckDB's published test of its CLI agent mode: share of input saved, DuckDB output read, turns taken and runs with the correct answer.

Key figures from DuckDB's test. Saved tokens amount to about 0.5% of total input. DuckDB output the model read with agent mode: 50.8k tokens, down from 123.6k. Agent mode runs took 237 turns versus 224. All 132 runs produced the correct answer.

Agent mode read fewer tokens but took more turns
FigureValueNoteClaim
Saved tokens as share of total input, about0.5%6
DuckDB output the model read, agent mode50.8 k tokensdown from 123.6k4
Turns taken, agent mode runs237 turnsvs. 224 without agent mode7
Runs with correct answer132 runs3

What happened

  • Claude Code answered the 22 TPC-H questions on a scale factor 100 dataset, asked in plain English with no SQL, three times with agent mode and three times with -no-agent.
  • All 132 runs, with agent mode on and off, produced the correct answer.
  • Agent mode switches on when three conditions hold: an agent's environment variable is present, stdout isn't connected to a terminal, and the command line specifies no output format.
  • Once on, the CLI prints compact Markdown tables, flags truncated results explicitly, ends runaway queries early and returns errors in JSON.
  • The agent mode runs took slightly more turns than the baseline runs, 237 against 224.

Why it matters

  • contradiction The post's summary promises a faster route to a correct result, but its own runtime figure shows no saving and its turn count went up.
  • decision Any DuckDB command an agent runs without naming a format gets Markdown tables and JSON errors, so a parser built on the box layout needs -csv, -json, -markdown or -no-agent.
  • constraint Detection works from a list of environment variables because agents share no convention, so an agent the list misses keeps the box output until someone passes -agent.

The CLI was built for a person at a terminal [14]. In the post's example, that person asks for a 5000-row result, gets the first and last 20 rows with a row of dots between them, and reads a footer that says "5000 rows (40 shown)" [10]. The person sees the dots and the footer and knows rows are missing [11].

The post says many invocations no longer have a person behind them. Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and other coding agents issue `duckdb -c "..."` in a fresh shell call each time, read stdout through a pipe and feed the text to a language model [21]. To that reader a truncated result looks a lot like a complete one, according to DuckDB: a model can skim past the footer and draw conclusions from data it never saw [15].

DuckDB had Claude do the measuring [8], and the test used Claude Code alone [2]. Output the model read fell from 123.6k tokens to 50.8k, a drop of 72.8k [4][17]. The post's explanation for the flat bill is that each turn re-reads the agent's system prompt, and that prompt is much larger than the query output, so the saved tokens come to about 0.5% of total input [6].

Turns went the other way, by 13 more, or 5.8% [18]. Every extra turn re-reads that prompt too [6]. The post describes the prompt only as much larger than the output, so the 13 extra turns cannot be netted against the 72.8k tokens saved.

Accuracy gives the same picture. Each side made 66 runs [19] and all were right [3], so there was no wrong answer for a truncation notice or a JSON error to prevent. The test shows agent mode did no harm. It does not show the notice rescuing anyone.

The post quotes the model's own summary. "Agent mode fixes the things about a terminal shell that quietly mislead a model," said Claude Fable 5.1 [9]. In the same passage the model rounds the post's 59% to "60 percent" [9].

Two questions sort the rollout. The first is how large the DuckDB output is next to the system prompt an agent re-reads every turn. The second is whether a cut-off result could change an answer someone acts on. Large output with costly truncation gets both of agent mode's effects. Small output with costly truncation gets the truncation notice, and the check is whether answers change with the mode on. Large output with harmless truncation gets the token saving, and that saving should show on the invoice. Small output with harmless truncation leaves agent mode little to do.

What to watch

  • Claude's full report and its follow-up experiment (the post links both) for any breakdown of cost, and for how large the system prompt is next to the DuckDB output.
  • Repeat runs with Codex, Cursor, Gemini CLI or GitHub Copilot, since this test used Claude Code only.
  • Whether the list of environment variables DuckDB checks grows, or agent makers settle on one marker.

Clarity's read

What the record supports and how the coverage leans. The claims behind it follow.

Reality

Evidence50
Adoption
Insufficient
Hype gap+20
Incentives55
Confidence65
Why these scores

Claim ledger

Ranked by verification strength, evidence, and original report placement.

  1. [1]

    When the DuckDB v2.0 CLI detects an agent, it prints compact Markdown tables instead of padded boxes, says clearly when a result was cut, stops runaway queries early, and reports errors as JSON.

    ReportedSupportedSource: DuckDB, 'Agent Mode in the DuckDB CLI', duckdb.orgView cited source
  2. [2]

    Claude Code answered the 22 TPC-H questions on a scale factor 100 dataset, phrased in plain English without any SQL; each question was answered three times with agent mode and three times with -no-agent.

    ReportedSupportedSource: DuckDB, 'Agent Mode in the DuckDB CLI', duckdb.orgView cited source
  3. [3]

    All 132 runs produced the correct answer.

    ReportedSupportedSource: DuckDB, 'Agent Mode in the DuckDB CLI', duckdb.orgView cited source

Sources

1 independent publisher whose own reporting we read for this story.

  1. duckdb.org

    1 article · October 12, 2026

    Agent Mode in the DuckDB CLI (11 minute read)

Share your take

Let Clarity write the post for you.

Signed-in readers get a short post drafted on this story in the register they choose — narrative, analytical, or a direct position — editable to the last word before it goes anywhere. The share buttons at the top of this story work without an account.

Topics and entities

Follow any of these and your For You feed starts watching them — no settings page required.

Loading related stories