---
type: "post"
id: "your-agent-hates-your-cli-ayush-bhardwaj-allos-e909e8"
slug: "your-agent-hates-your-cli-ayush-bhardwaj-allos-e909e8"
title: "Your Agent Hates Your CLI - Ayush Bhardwaj, Allos AI"
description: "While improving a CLI for searching past coding-agent sessions, Ayush Bhardwaj analyzed about 20,000 calls from his own transcripts, spanning 14 CLIs."
retrieval_nugget: "While improving a CLI for searching past coding-agent sessions, Ayush Bhardwaj analyzed about 20,000 calls from his own transcripts, spanning 14 CLIs. The recurring behavior: agents often sent command output through filters rather than using a CLI option to get the slice they needed. (youtube.com)"
published_at: "2026-11-26"
updated_at: "2026-11-26"
record_date: "2026-11-26"
date_kind: "published_at"
topics: ["claude","claude-code","codex"]
entities: ["Ayush Bhardwaj","Allos AI","Claude Code","Codex","Cursor","Infracost","DuckDB"]
related_patterns: ["agent-ready-software-exposes-capabilities"]
novelty_label: "new_fact"
what_changed: null
prior_refs: []
source_url: "https://www.youtube.com/watch?v=rS36lYuvXQ8"
source_urls: ["https://www.youtube.com/watch?v=rS36lYuvXQ8"]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:your-agent-hates-your-cli-ayush-bhardwaj-allos-e909e8"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/your-agent-hates-your-cli-ayush-bhardwaj-allos-e909e8/","markdown":"https://newruntime.com/posts/your-agent-hates-your-cli-ayush-bhardwaj-allos-e909e8.md","json":"https://newruntime.com/posts/your-agent-hates-your-cli-ayush-bhardwaj-allos-e909e8.json"}
markdown_url: "https://newruntime.com/posts/your-agent-hates-your-cli-ayush-bhardwaj-allos-e909e8.md"
---

# Your Agent Hates Your CLI - Ayush Bhardwaj, Allos AI

## Retrieval answer

While improving a CLI for searching past coding-agent sessions, Ayush Bhardwaj analyzed about 20,000 calls from his own transcripts, spanning 14 CLIs. The recurring behavior: agents often sent command output through filters rather than using a CLI option to get the slice they needed. (youtube.com)

## Summary

While improving a CLI for searching past coding-agent sessions, Ayush Bhardwaj analyzed about 20,000 calls from his own transcripts, spanning 14 CLIs. The recurring behavior: agents often sent command output through filters rather than using a CLI option to get the slice they needed. ([youtube.com](https://www.youtube.com/watch?v=rS36lYuvXQ8))

## What happened

In a separate October audit, Bhardwaj recorded about 1,000 calls to his session-search CLI. He recommends backing up transcripts, searching for a tool name followed by a pipe and similar patterns, then replaying transcript commands against old and new builds. The agent’s next action can serve as a rough answer key; hold some cases back to score the change.

Across the broader sample, a quarter of calls fed output into filters such as `head`, `grep`, `tail`, Python, `sort` or `wc`; for read-heavy commands, the share exceeded half. `git show` and `cargo test` each had 62% of calls piped into filters. Eighty-three percent of pipes matched a pattern seen at least 10 times, with the pattern defined by the same CLI subcommand and pipe tools, even if arguments differed. In the session-search audit, four out of five times an agent opened an old session, it piped the output into a filter.

Bhardwaj added read options for the area around a match, matching messages only, or the last few messages with a size cap, plus a compact search mode returning one line per hit. He said compact output was about six times smaller than JSON with the same results. About a third of inspect calls involved agents manually looping over several sessions, so he changed inspect to handle multiple sessions in one call. After new flags reached agents, piped reads of his tool fell from 82% to about a quarter. But stale instructions mattered: when a now-no-op `deep` flag remained in the skill instructions, agents passed it in all 95 searches; in two sessions using a rewritten skill without it, neither passed it, and both tried new flags on their first read.

Other examples make the distinction between smaller output and better results important. Bhardwaj reported that DuckDB’s agent-oriented output reduced the output the model read by 59%, while the saved tokens were nearly 0.5% of all tokens read and did not improve cost or runtime. He said Infracost added CLI filtering, compact output and a skill after seeing agents filter JSON dumps with jq and Python; its hard-question test moved from 0 of 6 correct with plain Claude to 6 of 6, with a reported 41% benchmark cost reduction.

## Why it matters

A recurring pipe is a useful design clue, not proof that the CLI change helps. Filtering can hide failures: Bhardwaj described `cargo test | head` returning a successful status despite a compile error, and a user-reported Claude Code issue where `tail` omitted a reference error and the agent reported success. Put a short failure summary and a path to the full log in the final lines of output. Offer selection flags that identify relevant messages, rather than relying only on a size cap. Keep help text and skill files aligned with available flags, and measure turns and correct answers alongside token use.

## Limits and uncertainty

The agent’s next action is only a rough guess at what it wanted. These are Bhardwaj’s observations from his own measured pipelines; he notes that some harnesses pipe far less than others, while Codex lets agents set an output limit on each call. Transcript availability can also be temporary: Bhardwaj said Claude Code can delete inactive transcripts after 30 days.

## Reader takeaway

Repeated piping and filtering can reveal where a CLI makes agents do extra work. Bhardwaj’s own before-and-after measure suggests targeted read options reduced piped reads, but shorter output is not the same as better task performance: replay commands, score held-out cases, and measure correct answers as well as tokens.

## Open question

Do CLI changes prompted by repeated transcript patterns improve held-out task success across different harnesses—not just reduce filtering or output size?

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- topic hub: [Claude](https://newruntime.com/topics/claude.md): Explore the claude topic hub.
- topic hub: [Claude Code](https://newruntime.com/topics/claude-code.md): Explore the claude-code topic hub.
- topic hub: [Codex](https://newruntime.com/topics/codex.md): Explore the codex topic hub.
- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Sources](https://newruntime.com/sources/): See the original sources this archive cites.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
