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

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 measured | Result |
|---|---|
| All Bash results in the measurement | about 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 limiter | 22 results, about 71 thousand tokens (2.6%) |
| Of that, already triggering advice from the existing read safeguard; what is left to trim | about 38 thousand; about 33 thousand tokens left (1.2%) |
Limits
- One week, one user, one way of working. Other people may have different patterns.
- Tokens are estimated from characters, not from the model’s counter. The 2.6% and 1.2% figures are estimates with an error of a few percent.
- Rewriting a command so its output is trimmed changes that command’s exit code and adds about 77 milliseconds per call. That is part of the reason I did not build it.
- The decision can be reopened: if a re-measurement shows results without a limiter above 10% of Bash volume, the contract will be done.
Sources
- Measurement script and session records of 16 to 23 November 2026, work-ledger rows of 23 November (internal archive, unpublished) · record date 23 November 2026
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