← All transcripts

Your Agent Hates Your CLI - Ayush Bhardwaj, Allos AI Transcript, AI Summary & Key Points

AI Engineer · yesterday · Science & Technology · 12:20 · EN

Watch on YouTube

AI Summary

Agent transcripts contain a hidden product roadmap for CLIs and tool interfaces. Ayush Bhardwaj examined roughly 20,000 tool calls from his own coding sessions: a quarter piped output through filters like head, tail, grep, Python, sort or wc, and 83% of pipes fell into repeated patterns — the same CLI subcommand and pipe tools again and again. These workarounds encode assumptions about where the answer sits in output, and they are the bug reports agents never file: Sanity's MCP server saw over 20,000 agents, about 3 million tool calls and not a single bug report until it shipped a give-feedback tool. Pipes also mask failure — without pipefail, `cargo test | head` can report success on a compile error, and a Claude Code user's script threw a ReferenceError that `tail` cut away, so Claude reported success. Fixes are small: return messages around a search match, offer compact search results (chat-history's compact mode is about six times smaller than JSON), batch multi-session inspection into one call, and put a useful failure summary at the end of output. Skill files and help text are the interface — when Ayush's deep flag became a no-op, 95 of 95 searches still passed it; after a rewritten skill, none did. Agent transcripts also become replay tests: the commands agents ran are the test cases, and what they did next is a rough answer key. Design still belongs to people — a study flagged issues in 97% of MCP tool descriptions, and agent-written context files cost more to run and performed worse than human-written ones. Measure turns and correct answers, not just tokens: DuckDB's agent mode cut model-read output by 59%, but the tokens saved were ~0.5% of all tokens read, so cost and runtime didn't improve, while Infracost went from zero of six hard questions right to six of six and cut benchmark cost 41%.

Key Points

  • Agents work around friction without filing bugs — Claude Code downloaded a whole docs page for one setting, Codex grabbed a whole JSON report for the last 40 lines of totals, Cursor kept the last 80 lines of a test suite run with one failure; each cut encodes an assumption about where the answer sits.
  • Sanity's MCP server: more than 20,000 agents, about 3 million tool calls since launch, not a single bug report — until it shipped a give-feedback tool and agents started reporting what was wrong.
  • Of about 20,000 extracted agent calls across 14 CLIs (git, GitHub CLI, cargo, curl, npm, docker and others), a quarter fed output into filters like head, grep, tail, python, sort or wc; for read-heavy commands it's more than half — git show and cargo test at 62% each.
  • Pipes can hide failure: without pipefail, piping cargo test into head returns the exit code of the last command, so a compile error got a green status; in a Claude Code GitHub issue, tail showed three harmless lines of a ReferenceError and Claude reported success.
  • Fail loudly when a tool fails: make the very last lines a short summary and a path to the full log.
  • In chat-history's own case study (~1,000 calls), 80% of the time an agent's output went straight into grep/sed/head/tail or Python — the 'pipe tax', the same cut-down command written by hand every time; 83% of pipes across everyday CLIs fell into patterns seen at least 10 times.
  • Size caps don't identify relevant content: one long session was 1.2 million characters whole, and the part around the search match about 3,000 characters — selection flags let the agent say which part it wants.
  • Three shipped fixes: a read command that returns messages around a match or only matching messages; a compact search mode (one line per hit, about six times smaller than JSON); an inspect command that summarizes several sessions in one call (a third of inspect calls had been agents looping over sessions by hand).

AI in practice

Used for

Agents

  • Work around CLI friction by writing small programs around the tool — piping output through head, tail, grep, sort, wc or Python — instead of filing bug reports. 2 held 00:15

Business ideas

Treat the commands an agent runs immediately after calling your tool as bug reports and a product roadmap. Extract tool calls from your own agent transcripts, find repeated pipes (head, tail, grep, python, sort, wc) and repeated re-invocations with different arguments, then add selection flags, compact output modes, batch operations, loud failure summaries, and an agent mode that the skill file and help text teach. Validate by replaying recorded calls against old and new builds and measuring turns and correct answers, not just tokens.

For
Developers building CLIs, MCP servers, and other tools that coding agents call — including their own products.
Solves
Agents work around friction silently instead of filing bug reports: they pipe away noise, reconstruct the same query by hand every time, and can even have a failed test masked as success because a pipe returns the last command's exit code or tail cuts the error itself. Tool authors never see this friction.
  • chat-history (speaker's own CLI): 80% of session-open calls were piped into grep/head/tail/python; adding context-around-match, compact search, and multi-session inspect cut pipe usage from 82% to about a quarter
🔒  Build steps and tools for 1 idea. Unlock

Tools & resources

5 items

CNo. 7784
AIAINotes.us AI product

chat-history

Open source · ay-bh/chat-history

chat-history is a Rust CLI for agents to search, inspect, export, and resume Claude Code, OpenAI Codex, and Cursor conversation history. It is primarily used through an installed agent skill that tells those coding agents when and how to invoke the CLI, rather than through interactive human browsing. It parses session files from the supported tools and indexes conversation metadata and transcript text with BM25 search. Search can return compact or JSON results, filter by source, project, branch, time, role, errors, tools, files, or similar messages, and identify message ordinals that can be passed to view for surrounding context. The CLI also supports session inspection, multi-session summaries, filtered viewing, Markdown export, resuming stored chats, path lookup, and shell completions. The tool is distributed through crates.io and GitHub and installs with Cargo. It maintains local catalog and search caches, can fall back to temporary or in-memory indexes in sandboxes, and installs a managed skill for Claude Code, Codex, and Cursor. It reads the histories retained by those applications rather than archiving them itself. The project is licensed under the MIT license.

Mentioned in
1 video
Kind
AI
CNo. 0348
AIAINotes.us AI product

Cursor

cursor.com

Cursor is an AI-powered coding agent and integrated development environment designed to accelerate software development by handing off coding tasks to AI. It evolved from an email client into a multimodel development tool, supporting broader developer workflows. The platform also offers MCP-connected capabilities for tasks like searching and editing notes.

Mentioned in
52 videos
Kind
AI
DNo. 4586
AIAINotes.us Tool

DuckDB

duckdb.org

DuckDB is an in-process SQL OLAP database management system for analytical workloads. It uses a PostgreSQL-inspired SQL dialect, can run from edge devices to servers, and reads and writes formats including CSV, JSON, Parquet, Iceberg, and Vortex both locally and in object storage. Extensions add functions and format support, while native clients provide APIs for Python, Go, Java, Node.js, C, C++, R, Rust, and ODBC. DuckDB is open source and MIT-licensed, with governance by the independent DuckDB Foundation.

Mentioned in
4 videos
Kind
Other
GNo. 2411
AIAINotes.us Tool

GitHub CLI

Open source · cli/cli

GitHub CLI is GitHub's official command-line tool, developed for GitHub.com, GitHub Enterprise Cloud, and GitHub Enterprise Server. The `gh` command brings pull requests, issues, and other GitHub concepts into the terminal alongside Git and source code, including workflows for authenticating an account, creating repositories and branches, pushing changes, and opening draft pull requests. It supports macOS, Windows, and Linux, and an agent skill is available for driving `gh` from coding agents.

Mentioned in
5 videos
Kind
Other
SNo. 2051
AIAINotes.us Tool

Sanity

Open source · sanity-io/sanity

Sanity is a headless, real-time CMS for managing structured content such as directory entries, blog posts, and sponsored placements. Its open-source Sanity Studio is a customizable single-page application built with JavaScript and React, with structured editing, an advanced block editor, field validation, document organization, plug-ins, custom components, and branding controls. Content is hosted in Sanity's real-time Content Lake and can be queried or managed through GROQ and GraphQL APIs, with APIs for reading, writing, importing, exporting, historical revisions, and update listeners. Sanity also supports real-time distribution from a shared content source, image uploads and on-demand transformations, rich-text serialization, and metadata queries for images.

Mentioned in
3 videos
Kind
Other

Links mentioned

🔒 Full analysis locked

Unlock more videos and the full analysis

A credit unlocks one video's full analysis for good — the build steps, the tools and how each was used, the methods behind every use case. Pro opens the whole library instead, and raises how many videos you can analyse a day.

Unlock full analysis — free

Transcript

Searchable transcript of Your Agent Hates Your CLI - Ayush Bhardwaj, Allos AI — AI Engineer (12:20). Search for a phrase, then click its timestamp to jump straight to that moment in the video.

Captions sourced from the original video on YouTube, published by AI Engineer. The video, its captions and all related intellectual property remain the property of their respective owners; AINotes claims no ownership. Provided for research, accessibility and search — see the Transcript Notice and Copyright Policy.

00:00 Hi, I am Aush. I built a CLI that lets your agent reuse context from your past session across tools. While improving it, I realized why my agent secretly hated my CLI and what you can do about yours. Cloud Code wanted one setting from a docs page. So, it downloaded the whole page, grabbed it, and kept the result at 40 lines. Codex wanted to know how many dependencies were vulnerable.

00:26 It asked the whole JSON report and kept the last 40 lines where this report puts the totals. Cursor ran a test suit, found one failure and kept the last 80 lines. All three cuts kept the information shown here. Each one coded in an assumption about where the answer sits in the output that can hide friction from the people who build these tools. One pipe tells you very little.

00:50 The same pipe written again and again can point to something your tool is missing. These are real calls from my own transcripts and the cloud code one was the agent reviewing this talk and it still couldn't help itself. Agents can work around friction without filing a bug report. They write a little program around your program. In June, Sanity, the content platform, wrote up their MCP server.

01:16 More than 20,000 agents, about 3 million tool calls since launch and not a single bug report. So they shipped a give feedback tool. Once agent had somewhere to complain, they started expressing what's wrong. But you don't need a feedback tool to start. Feedback is already sitting somewhere in your transcripts. I I extracted about 20,000 agent calls from my same transcripts.

01:40 14 CLI appear in that sample. Git, GitHub CLI, cargo, curl, npm, docker, and others. A quarter fed output into filters such as head, grab, tail, python, sort or wc. For read heavy commands, it's more than half. Git show and cargo test 62% each. Some harnesses pipe far less. Codeex for example lets the agent set an output limit on each call. And pipes don't only cut noise in batch without pipe fail.

02:11 A pipe then returns the exit code of its last command. So let's say you pipe cargo test into head. It can report success even when the test failed. Here's one example on the screen. A compile error and a green dot. The status was wrong but the agent could still read the error. A pipe can also cut the error itself which is worse. In a cloud code issue on GitHub, a user reported it a script through a reference error and exited with an error code.

02:41 tail showed three harmless lines and Claude reported success. The error never reached the model. So my advice would be to fail loudly when a tool fails. Make the very last lines a short summary and a part to the full log. I learned all this while tinkering with a CLI I built. It's a small tool that lets coding agents search their own past sessions across cloud code, codeex, cursor.

03:09 It ships with a skill so the agent can decide when and how to call it. Agents are the users that I'm studying. My October audit recorded about thousand calls and that's my small case study. The method works on anything your agents calls. Just look at what they do right after the call. 80%. Four out of five times an agent opened an old session with my tool.

03:33 The output went straight into crab sad head tail or Python. I call that the pipe text. A pipe keeps junk out of context and that's fine. The text is that the agent writing that same cut down command by hand every single time. It's small each time and it mostly works but each one is another guess about where the answer is. The fair objection comes from a hacker news thread about designing CLS for agent that I was reading.

04:02 The command says to leave it to the agents to choose how much output to reads. agent can pipe through grap or head perfectly well. Well, they can and for oneoff they should. I'm not against that. But across those everyday CLIs, I found 83% of pipes fell into the patterns seen at least 10 times. The same CLI subcomand and pipe tools. The arguments passed could differ, but the agent keep asking for the same things.

04:32 I [snorts] understand the output they're cutting is probably big. I opened one long session with my tool two ways the whole thing 1.2 2 million characters and that's why the agent pipe just the part around the search match was about 3,000 characters. Harnesses do cap output but a size cap does not identify the relevant messages. Selection flags on the other hand let the agent tell your tool which part it wants.

04:59 So based on my experience and improvements I made to my own tool, I'll give you three examples. Read the left column as the bug reports. So starting with the first one filtering with RG and Z means let me pick the part I want. So read my command. So my read command view can now return just the part around a match only the matching messages or the last few with a size gap.

05:23 Second example would be Python over JSON. So Python over JSON means give me fewer fields. So search got a compact mode one line per hit about six times smaller than JSON with the same results. Inspect command in chat history summarizes a session. About the third of inspect calls came from agent looping over several sessions by hand. As you can see with the for loop that means let me ask several about several at once and now it's one call.

05:51 As you can see my road map was in the commands around my command and I had to learn from that. Infraost the cloud cost tool wrote up the same discovery in May. Their agents were writing jQ and Python pipelines over JSON dumps. So they moved the filtering into the CLI and added a compact format and a skill to teach it. Plain claw with none of that got zero of six hard questions right in their testing and with it six of six and cost across the benchmark also fell 41%.

06:21 On hacker news, the person who wrote that post said that reading those agent logs felt like watching usability tests and I couldn't agree more. This part might sound trivial and obvious. Once it's in the CLI, teach your agent it's there with the skill file or the health flag, but the agents take the teaching literally. I made some changes that turned my deep flag into a no op.

06:47 I left the skill telling the agents to use it to see what they do. Would they find out or not? 95 searches of out of 95 still passed it. After that, two sessions loaded a rewritten skill and that no longer told them to use it. None of the searches passed D flag and both tried new flags on their first read. So your skill.md, your help text, your error messages are the interface.

07:12 That also means stale dogs are bugs because your agent will keep following them. Once the new flags reached agents, nearly every search used compact output and nearly every reduced the new flags. Pipe breed fell from 82% to about a quarter. You can get real levels and test cases for your tool easily. If you use it every day, they are already in your transcripts.

07:41 The commands agent really ran are the test cases and what agent did immediately next is a rough answer key. replay those commands through your old build and your new one. If you change a ranking, check that result uh the agent went on to use still comes out on the top or not. If you change an output format, check that nothing went missing. If you change a default, see which commands now behave differently.

08:06 And when an agent reader a call with different arguments, you have probably found a failing case. The answer key is only a rough guess at what the agent wanted. keep a few cases back and use those to score your fix. So after analyzing 20,000 invocation, if I were to start all over again, this is what I would build first. 55% of the measured pipelines used only head, tail, or set downstream that points to demand for smaller slices.

08:34 So ship ranges and limits before anything fancy. A flag only helps if agents reach for it. GitHub CLI's list command have a limit flag. An agent used it 81% of the time. The counter example would be cargo for cargo test quite mode prints a character per test instead of a line and still reports failures. Agent passed it on about one cargo run in 10 and pipped instead.

09:01 So teach the flag. So teach the flag in your help test and your skill and make big outputs print less by default and say how to get more. for example, and with something like showing 20 of 300, add offset flag 20 for the next wage. One way to ship several of these at once is an agent mode. Your CLI notices an agent is calling it and prints differently.

09:25 Agents like cloud code set an environment variable in their cell so your tool can spot them. Doug DB shipped one at a terminal. You get a nicely drawn table, but an agent gets a plain one that says how many rows were left out and how to get them. A huge query stops early and says so. And errors come back as JSON because agents read them better. Is the same list as we have been just through and it cut the output model red by 59%.

09:54 However, the tokens saved were nearly about.5% of all the tokens the model read. So cost and runtime didn't improve. If you remember, infra cost agent started getting answers right. Doug Dvs were already there. So measure turns and write answers, not just tokens. You might be thinking, I'll ask my agent to do all of this. They are not that good at this yet.

10:19 At least not oneshotting it. The design is where it goes wrong. Ask an agent to build a tool for agent. It probably pictures a person and then bolts the agent on. It copies most common patterns it has seen and most of those are poor. A study of official MCP servers found most just rep an existing API. Another check tool descriptions from real MCP servers and flagged issues in 97% of them.

10:43 Docs have the same gap. Researchers at each Zurich tested context file written by agents. They didn't help tasks succeed cost more to run and did worse than files written by people. Agents are already good at other half of this talk. Give one transcript and a test it can run and it can find what's wrong and improve the tool. Sometimes past what people wrote by hand and tropic reported that on its own internal tools as well.

11:12 So you decide what the tool should be and let the agent check it against what really happened. You have seen the evidence for each of these. So, I won't read them. Take a moment to absorb these or screenshot. To find your own list, back up your transcripts first because clot code can delete inactive ones after 30 days. Then, search for them for a tool's name followed by a pipe and other similar patterns.

11:45 If you sip ship an MCP server, look for agent calling your tool again straight away with different arguments. If you remember one thing from this talk, if you are building a tool for your agent, your agent transcript are the product analytics you probably aren't reading. The workaround is the bug report. So go read your transcripts and if you need any help doing that, check out chat history on cargo or GitHub. It can do this for you as well. Thank you.