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

Cloud Agents just exploded in usage

Reddit r/ArtificialInteligence

Cloud agents are experiencing explosive growth in token usage, with GitLawb leading at 164B tokens, signaling a resurgence in agent adoption.

How I easily cut my input token burn ~90% on long agent runs

Reddit r/AI_Agents

The author shares a practical tip to reduce input token costs by ~90% on long agent runs using prompt caching: placing unchanged text (system prompt, tool definitions, context) at the start of every prompt to leverage cached prefixes from LLM providers.