63% of my agent's context came from one tool
Описание и применение
В проекте агента 63 % контекста генерировалось одним инструментом (bash), который был самым дешевым за вызов, в то время как редкие, но дорогие вызовы веб‑поиска создавали большую часть стоимости.
Задача
Agents often use tools that generate large amounts of context, but the most frequently used tools are not necessarily the most expensive.
Результат
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.
Рабочий процесс
- 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.
Доказательства
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.
- Дата записи: 2026-10-12T08:41:25.116Z