Analysis shows tool results dominate AI agent context

alexander.holbreich.org10 min read

An analysis of AI agent context anatomy reveals that tool results typically dominate session history, accounting for the vast majority of end-of-state tokens while user messages and system heads shrink proportionally over long-running interactions. The author examines how different harnesses and model templates structure messages, tool definitions, and conversation tails into token streams, highlighting that memory bloat is driven primarily by tool outputs rather than system prompts. Furthermore, the piece explores the mechanics of session compaction and the processing costs associated with maintaining large context windows across cloud and local setups. Open article →