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?