DuckDB’s team described an agent mode for its command-line shell on 9 October 2026. The post says “agent mode ships with DuckDB v2.0.” DuckDB’s latest stable release is still v1.5.6, from 28 September, so this is a v2.0 feature you can read about now and use when that release arrives.
How it detects an agent
Coding agents such as Claude Code, Codex, Cursor, Gemini CLI and GitHub Copilot typically run duckdb -c "..." per shell call and hand the captured output to a model. The CLI checks for environment variables these tools set, including CLAUDECODE, CURSOR_AGENT, GEMINI_CLI, CODEX_SANDBOX, COPILOT_CLI and the generic AI_AGENT or AGENT. Agent mode turns on when one is set, stdout is not a terminal, and no output format was given. -agent and -no-agent force it on or off, and .help agent explains the output.
What changes
- Compact tables: Markdown with no alignment padding and the type in each header cell. DuckDB says that is 25 to 65% smaller than the box renderer on typical results.
- Honest truncation: results up to 1,000 rows and 10,000 bytes print in full. Larger ones show the first and last 20 rows around an explicit “rows omitted” marker, with a footer saying what happened and how to get the rest.
- Early stop: after the cap, rows are counted, and a runaway query is stopped 100,000 rows later, with the count reported as a lower bound.
- Errors as JSON, and compact plans and cost estimates before long queries, so the agent can decide whether to wait.
The numbers, and the honest part
These are DuckDB’s figures from an experiment it ran with Claude Code: 22 TPC-H questions at scale factor 100, asked in plain English, three times with agent mode and three without. All 132 runs were correct, and the DuckDB output the model read fell from 123.6k to 50.8k tokens, a 59% cut. Claude also wrote the report.
DuckDB is upfront that this did not show up in cost or runtime. Each turn re-reads the agent’s much larger system prompt, “so the saved tokens amount to about 0.5% of the total input,” and agent-mode runs took slightly more turns, 237 against 224. The real gain is that a model is less likely to draw conclusions from rows it never saw.

The Campfire
No commentsNobody has pulled up a log by this one yet. Be the first to say what you make of it.
Held for the desk. It appears after a look.