Research · TMN-010 ·

A negative result: trimming Bash output saves only 1.2%, so I postponed building it

By Fahmi Ghani · about the author and how this is written

A negative result: trimming Bash output saves only 1.2%, so I postponed building it
Illustration made with AI.

My guess was that long Bash command output eats many tokens, so trimming it would matter. After measuring, large results without a limiter are only 2.6% of Bash result tokens, and only 1.2% is not already caught by an existing safeguard. I postponed the build.

Method

I measured the session records of 16 to 23 November 2026: 62 sessions and 9,926 Bash or PowerShell calls. I split results longer than 8,000 characters into those that already had a limiter (for example sed -n, head, a diff summary, grep) and those without one. I estimated tokens from character counts.

Numbers

What was measuredResult
All Bash results in the measurementabout 2.74 million tokens
Results longer than 8,000 characters; those already limited (deliberate reads)180 results (about 565 thousand tokens); 158 already limited
Without a limiter22 results, about 71 thousand tokens (2.6%)
Of that, already triggering advice from the existing read safeguard; what is left to trimabout 38 thousand; about 33 thousand tokens left (1.2%)

Limits

Sources

How it was checked: Quoted from the experiment record; derived figures re-checked, raw files not re-run. This is a synthesis of my own experiments. It is not peer reviewed.

Drafted with AI help from my work notes and experiments; I review it before it is published.

Licence: text and data CC BY 4.0. You may reuse and quote with credit to the author and a link to this page.

Cite as: Ghani, F. (2026). MiganCore Findings, record TMN-010. https://migancore.com/en/blog/research/measure-first-trimming-bash-output-saves-only-1-2-percent/ · JSON

NextSee the work log