63% of my agent's context came from one tool
Description and use
In an agent project, 63% of context came from a single tool (bash), the cheapest per call, while infrequent but expensive web searches drove most of the cost.
Problem
Agents often use tools that generate large amounts of context, but the most frequently used tools are not necessarily the most expensive.
Outcome
The most-used tool (bash) accounted for 63% of context at the lowest cost per call, while a web search tool, used only 20 times, produced 18 times more context per call and was far more expensive.
Workflow
- 1. Extract tool call data from the agent’s session database using SQL.
- 2. Aggregate calls and total characters per tool.
- 3. Calculate characters per call and sort by cost per call.
- 4. Identify high-frequency but low-cost tools and low-frequency but high-cost tools.
- 5. Analyze context re-reading by examining cache read tokens.
- 6. Apply optimizations: filter at the tool, count before reading, batch cheap tools and limit expensive ones.
Evidence
the tools I reach for most are not the ones that cost the most.
bash 1,603 chars per call grep 3,117 read 4,099 scrape a page 10,519 fetch a page 18,548 web search 27,267
Context was re-read roughly 14 times more often than it was first written.
- Record date: 2026-10-12T08:41:25.116Z