Redundant Context Reconstruction & System Prompt Overhead
A significant cost driver comes from agents redundantly re-fetching or re-embedding context, and sending large system prompts or tool schemas with every request. For instance, a coding agent's system prompt can be ~9,600 tokens, which, over 40 steps, costs 384,000 tokens in re-transmission alone.
The top 3
- Stateless Inference: The Root of Agent Context Re-reads: AI agents primarily operate on stateless inference, meaning each interaction requires the full chat history and system prompt to be re-submitted, effectively reconstructing the entire context for every new request and significantly increasing token consumption.
- Bloated System Prompts: Up to 35% Higher Cloud Costs: System prompts that expand from 500 to 5,000 tokens can contribute to an average 35% increase in cloud spend for AI agent operations, as every additional token in these verbose instructions is paid for with each API call.
- Agent Loops: 1000x More Costly Context Re-reads: Agentic tasks are significantly more expensive, consuming up to 1000 times more tokens than simpler LLM uses like code reasoning, because agents must re-read their entire accumulated context (prompts, responses, tool outputs) before each subsequent action, creating a 'costly context snowball'.
Sources
Open the full topic