Agent loops get pricey because every call repays the whole conversation history
Future_AGI · reddit · 2026-07-27
The post argues that agent costs are driven less by token price and more by repeated context reuse across loops.
Why agent runs get expensive
- Each call in a loop usually resends the original task, prior steps, and tool results.
- That means you keep paying for the same history again and again.
- In the example, a 20-step run averaging about 6,000 tokens per step would reach roughly 120,000 tokens for one task.
Practical takeaways
- Cost caps should be enforced before the next call, not after it.
- The limit should live in loop code or a gateway, not in the prompt, because the agent can reason around prompt instructions.
- The author recommends tracking cost per successful task, not just cost per token, since messy loops can destroy efficiency long before billing looks alarming.
The post ends by asking whether others cap agents per step, per run, or not at all.
Related event: Soaring Inference Costs Threaten AI Agent Adoption(2 posts)→
More from coding & agent
- UNC's Wanda: agentic AI for neuroimaging validated on 123,000 brains — PTenigma · 2026-12-02
- Software products need an API/MCP/plugin now: agents will drive acquisition and retention — omooretweets · 2026-12-02
- AI coding tools are self-configuring: install Claude Code and you're done — _jaydeepkarale · 2026-12-02
- Image-to-Blender showdown: Neon crushes Opus with a huge gap — YouJiacheng · 2026-12-02
- Matt Shumer says collaborating with Jacob humbles his AI-orchestration skills ahead of Spawn — mattshumer_ · 2026-12-02
- LiveCraft benchmark: top agents score just 30.3/100 in real-time Minecraft worlds — Chengxing Xie · 2026-12-02