Skip to content
← Back to YouBlog

Published article

Agent CLI Design That Agents Stop Working Around

Drafted with AI from the video "Your Agent Hates Your CLI - Ayush Bhardwaj, Allos AI", then reviewed and published by Gustavo Miranda.

Agent CLI design should start with your transcripts, not your help text. In about 20,000 logged agent calls, roughly a quarter piped output into head, grep, tail or Python, and the same pipes kept reappearing. Those repeats show which parts of your output agents cannot find on their own.

Agent CLI Design Starts With the Commands After Your Command

Agent CLI design starts with transcript analysis, not interface theory. Ayush Bhardwaj, speaking at AI Engineer Code Summit 2026, extracted about 20,000 agent calls from his own coding sessions and found a product roadmap in the commands agents wrote immediately after his tool returned.

The talk, titled Your Agent Hates Your CLI, was published on 10 November 2026 by the AI Engineer channel. Bhardwaj's central argument is that agents can work around friction without filing a bug report. They write a little program around your program. One pipe tells you little; the same pipe written again and again points to something your tool is missing.

His sample covered 14 CLIs, including Git, GitHub CLI, Cargo, curl, npm and Docker. A quarter of calls fed output into filters such as head, grep, tail, Python, sort or wc. For read-heavy commands the share was higher: git show and cargo test sat at 62% each.

The speaker builds a chat history CLI at Allos AI that lets coding agents search their own past sessions across Claude Code, Codex and Cursor. The transcript audit came from using that tool daily, which makes the sample a first-hand observation rather than a controlled study.

Why Does My Coding Agent Report Success When a Command Failed?

A pipeline returns the exit status of its last command, so cargo test piped into head can report success while tests fail. Bash behaves this way when pipefail is disabled, and the agent reading the output has no reason to doubt the green status it receives.

Bhardwaj described two severities of the problem. In the milder case, the status was wrong but the agent could still read the error further up the output. In the worse case, a pipe cuts the error itself. He cited a Claude Code GitHub issue where a script raised a reference error and exited with an error code; tail showed three harmless lines and the agent reported success.

His advice is to fail loudly. When a tool fails, make the very last lines a short summary plus a pointer to the full log. That places the useful signal where an agent's default tail already lands.

The milder case: wrong status, readable error

A green dot next to a compiler error still lets the model recover. The agent reads the error text, ignores the misleading status and continues. The failure costs turns, not correctness.

The worse case: the error never reaches the model

If the pipe discards the error lines, nothing downstream can recover. The model receives a plausible, clean tail and reports success, and only a later check reveals the failure.

The Pipe Tax: What Repeated head and grep Calls Cost

Every hand-written filter is a guess about where the answer sits in the output, and repeating that guess on every call is what Bhardwaj calls the pipe tax. The tax is small per call and mostly works, so nobody reports it.

The objection he addresses came from a Hacker News thread about designing CLIs for agents, where commenters argued agents can pipe through grep or head perfectly well. He agrees for single calls. His evidence is about patterns: across everyday CLIs, 83% of pipes fell into a pattern seen at least 10 times with the same CLI subcommand and pipe tool, even when the arguments differed.

Size explains why agents reach for filters. One long session measured through his tool ran to 1.2 million characters. The part around the search match was about 3,000 characters. A harness output cap limits volume but cannot identify which messages matter, so the agent filters by hand.

Selection flags move that decision into the tool. The agent states which part it wants and the CLI returns that slice directly.

Three Fixes That Turned Pipes Into Flags

The three fixes replaced recurring pipes with CLI options, and each one came directly from a pattern in the transcripts. Bhardwaj shipped ranges and limits before anything more elaborate because 55% of the measured pipelines used only head, tail or sed downstream.

His October audit covered about 1,000 calls to his own tool. In four out of five, the agent opened an old session and piped the output straight into grep, sed, head, tail or Python. After the fixes reached the agents, pipe use fell from 82% to about a quarter.

Observed patternWhat agents wantedFix shipped
grep, sed, head, tail over session readsOnly the part around the matchRead command with match context, message selection and a size cap
Python parsing JSON outputFewer fields per resultCompact mode at roughly six times smaller than JSON
for loops over several sessionsSeveral sessions in one callMulti-session inspect command

The compact mode returns the same results in about one sixth the output. The inspect change removed the manual loop. Neither fix required new backend logic, only new ways to ask for a slice.

Your skill.md and Help Text Are Part of the Interface

An agent follows its written instructions literally, so a stale skill file keeps agents using options that no longer exist. Bhardwaj tested this by turning a flag into a no-op while leaving the skill file telling agents to pass it.

The result was 95 out of 95 searches still passing the dead flag. He then rewrote the skill so two sessions no longer mentioned it. No search passed the flag, and both agents tried new flags on their first read. Agents take their teaching literally, and the downside is that stale documentation becomes a bug.

The wider lesson: skill.md, help text and error messages form the interface agents actually use. That framing matters for anyone documenting an agent CLI design, because the help output is read by the same literal reader that consumes the skill file.

What Sanity, Infracost and DuckDB Learned From Agent Logs

Three published cases show the same pattern across different products: agents write pipelines the tool should have offered, and the fix moves selection into the tool. Each report is vendor-written evidence about that vendor's own tooling.

CaseObserved agent behaviourChange and reported result
Sanity MCP server, June 2026About 3 million tool calls, no bug reportsAdded a feedback tool; agents began expressing problems
Infracost with Claude Code, May 2026jq and Python pipelines over JSON dumpsMoved filtering into the CLI, added a compact format and a skill; plain Claude answered 0 of 6 hard questions, the rebuilt setup 6 of 6, benchmark cost down 41%
DuckDB agent modeAgents parsed the default table outputPlain tables for agents, row counts with a hint for more, JSON errors; model-read output cut 59%

The DuckDB result is the caution. The tokens saved were nearly about 0.5% of all tokens the model read, so cost and runtime did not improve. Its agents were already answering the questions correctly. Bhardwaj's conclusion is to measure turns and correct answers, not just tokens.

Sanity: silence is not satisfaction

Sanity, the content platform, published numbers in June 2026 showing more than 20,000 agents and about 3 million tool calls since launch with not a single bug report. After it shipped a feedback tool, agents started describing what was wrong.

Infracost: from 0 of 6 to 6 of 6

The Infracost write-up describes Claude Code agents writing jq and Python pipelines over JSON dumps. Moving the filtering into the CLI, adding a compact format and teaching it with a skill took their benchmark from 0 of 6 correct to 6 of 6, with cost falling 41% across the benchmark. These are the vendor's own figures for its own benchmark.

DuckDB: smaller output, unchanged cost

DuckDB shipped an agent mode that detects an agent through an environment variable. At a terminal you get a drawn table; an agent gets a plain one stating how many rows were left out and how to get more. Errors return as JSON because agents read them better.

Turn Recorded Calls Into Replay Tests

The commands agents actually ran are already test cases, and replaying them against an old build and a new one shows whether a change helped. Bhardwaj treats what the agent did immediately after each call as a rough answer key.

If you change ranking, check that the result the agent went on to use still comes out on top. If you change an output format, check that nothing went missing. If you change a default, see which commands now behave differently.

A retry with different arguments is a strong signal. The first call failed the agent's needs, so that pair of calls marks a failing case worth keeping.

  • Keep a few cases back from the ones you tune against, then score the fix on those.
  • Back up transcripts first, because Claude Code can delete inactive ones after about 30 days.
  • Search for a tool name followed by a pipe symbol, and for MCP server calls where the agent re-invokes you with different arguments straight away.

Why You Should Design the Tool Yourself

Agents are useful for the engineering half of this work and unreliable for the design half, according to Bhardwaj. Asked to build a tool for agents, a model tends to picture a human user first and bolt the agent layer on afterwards.

He points to three pieces of evidence. A study of official MCP servers found most simply wrap an existing API. A separate check of tool descriptions from real MCP servers flagged issues in 97% of them. Researchers at ETH Zurich tested agent-written context files and found they did not help tasks succeed, cost more to run and performed worse than files written by people.

Anthropic reported that agents improve its own internal tools when given a transcript and a runnable test, sometimes beyond what people wrote by hand. The division of labour that follows: a person decides what the tool should be, and an agent checks that against what really happened.

Frequently Asked Questions

  • What does "agent CLI design" mean in this context? It means shaping a command-line tool's output, flags, help text and skill files around the way coding agents actually call it. The evidence comes from agent transcripts rather than from interviews or support tickets.
  • Why do repeated pipes matter more than a single one? One pipe is a local choice about one output. A pipe pattern that recurs with the same subcommand and filter across many calls points to a missing option the tool should provide.
  • How does a failed command end up reported as a success? In Bash with pipefail disabled, a pipeline returns the exit status of its last command. If cargo test fails but the head command succeeds, the pipeline exits zero and the agent sees success.
  • Should I just ask Claude Code to redesign my CLI? Bhardwaj argues against handing over the design. Models tend to build for a human user first, and the published evidence on agent-written context files and MCP wrappers shows weak results.
  • What should I fix first in my own CLI? Start with ranges and limits for read and test commands, since 55% of the measured pipelines used only head, tail or sed downstream. Then add a compact output format and teach every new flag in the skill file and help text.
  • Does smaller output always reduce cost? No. DuckDB cut model-read output by 59% yet the saved tokens were about 0.5% of all tokens read, and cost and runtime did not improve. Measure correct answers and turns instead.
  • Where do I find these patterns in my product? Search agent transcripts for your tool's name followed by a pipe, and for MCP calls where the agent retries immediately with different arguments. Back the transcripts up first.
  • Is this advice backed by a controlled study? No. The core numbers come from one speaker's own transcripts, plus vendor reports from Infracost, Sanity and DuckDB. Treat them as first-hand and first-party evidence.
  • Who gave the talk and where can I watch it? Ayush Bhardwaj of Allos AI presented at AI Engineer Code Summit 2026, and the session is published on the AI Engineer channel.
  • Do agents really never report problems? Sanity saw no bug reports across about 3 million tool calls before it shipped a feedback tool. That is one vendor's experience, not proof that agents never report issues elsewhere.

Reading Your Own Transcripts

The workaround is the bug report, and it is already sitting in your transcripts. If a coding agent worked around your CLI, it left a record of what it wanted: what it tried, what it discarded, and what it had to ask again.

For developers learning to build tools that agents can drive, programmes such as Crazystack Typescript and the Bootcamp do Dev Doido cover the programming side, and the same distance between what a tool returns and what its user needs applies to any interface. Perspectives from practitioners like Gustavo Dev Doido on shipping software keep returning to the same point: watch how people actually use the thing.

Bhardwaj's summary in the talk is blunt. If you are building a tool for your agent, your agent transcripts are product analytics you are probably not reading.

Source video

YouTube thumbnail: Your Agent Hates Your CLI - Ayush Bhardwaj, Allos AI

Source video

Your Agent Hates Your CLI - Ayush Bhardwaj, Allos AI

Create from this video

This article was created automatically from a new video.

Automate my channel

Turn your YouTube videos into articles

Built for creators with a backlog and no editor on staff. This page started as a video. YouBlog drafts from the transcript, you review every word, then publish on a first-party /p/{slug} page. Nothing goes live until you publish it.

Turn your videos into articles

Published with YouBlog