git log costs your agent 624 tokens. It needs 55. Here's a list of the worst offenders

Reddit r/AI_Agents Tools

Summary

The article highlights how verbose CLI output wastes tokens for LLM coding agents and introduces a pattern-based compressor that reduces shell command output noise while preserving essential information.

I spent a week logging every shell command my coding agent ran and measuring the token cost of the raw output vs. what the agent actually used. Most CLI tools were built for humans reading terminals, not for LLMs paying per token. The worst offenders |Command|Raw tokens|What the agent needs|After compression| |:-|:-|:-|:-| |`git log`|624|Last 3 commits + changed files|55 (-91%)| |`git diff`|2,400+|Changed lines + file list|\~320 (-87%)| |`npm test` (200 passing)|3,100+|Pass/fail summary + failures|\~180 (-94%)| |`cargo build` (clean)|1,800+|Errors/warnings only|\~90 (-95%)| |`docker build`|5,000+|Final image + errors|\~150 (-97%)| |`ls -la` (big directory)|800+|File tree|\~120 (-85%)| |`git status`|340|Staged/unstaged/untracked|\~60 (-82%)| This adds up fast. A typical 30-min session runs 40-60 shell commands. At an average of 1,500 tokens of raw output per command, that's 60-90K tokens just on CLI noise, verbose build logs, green checkmarks, download progress bars. Why this matters more than you think Every token of noisy shell output takes up space in the context window. That's space the agent can't use for reasoning about your actual code. I've seen agents lose track of a multi-step refactoring plan because `npm install` dumped 8K tokens of dependency resolution into the context mid-task. What I did about it I wrote pattern-based compressors for 95+ CLI commands grouped into 34 categories. Deterministic pattern matching, same input always produces the same compressed output in microseconds. The rules are simple: * Strip progress bars, spinners, download indicators * Collapse repeated success lines (`✓ test passed` x200 → `200/200 passed`) * Keep all errors and warnings verbatim * Preserve structure (file paths, line numbers, exit codes) It runs as a transparent shell hook. Your agent runs `git log` like normal and gets the compressed version back. No workflow change. What CLI commands burn the most tokens in your workflow?
Original Article

Similar Articles

@yibie: Recommends this hardcore real-world test. An engineer tracked his coding agent session for a week and found that only 0.67% of tokens were spent on actual tasks—the remaining 99% all went to moving tool directories, skill descriptions, and system prompts. Work-to-overhead ratio 1:1…

X AI KOLs Timeline

An engineer tracked his coding agent's token usage over a week, finding that only 0.67% of tokens were spent on actual tasks, with 99% consumed by tool directories, skill descriptions, and system prompts. He provides optimization strategies, including shell output filtering which saved 46.9% of tokens.