Developers analyzed token consumption in coding agents and found that high costs are often driven by redundant workflow processes rather than just prompt length. Automated checks, repeated file reads, and overlapping tasks by sub-agents create significant overhead.
To address this, the team developed an experimental 'Optimize layer' using a local MCP server. This system operates in shadow mode, analyzing tool outputs to identify repetitive or unnecessary data without altering the actual information sent to the model.
The team implemented a deterministic compactor for structured data like Node TAP. It validates exit codes and counters, discarding redundant success logs while preserving critical error information. In one test, 97.3% of the output was identified as non-essential for confirming success.
The researchers emphasize that reducing token counts requires careful auditing of agent behavior. They suggest tracking repeated file reads, command outputs, and sub-agent activity to ensure that efficiency gains do not compromise the quality of the development process.
Future optimization efforts will focus on comparing full task runs, measuring total input tokens, cached data, and model calls. The goal is to ensure that cost reductions are verified against actual performance metrics rather than just log size.






