What I Learned Cutting Claude Code's Token Bill by 77% A developer built the AI Agent Profiler, a transparent proxy that records every byte of traffic between AI coding agents and language models. Profiling Claude Code sessions revealed that agents re-send the entire conversation history on every turn, causing massive token waste. By pruning stale context and unused tool schemas, the developer cut token costs by 77% without changing any results. What building a profiler for AI coding agents taught me about the hidden river of data flowing to Claude on every turn, and how to cut most of it without changing a single result. Dashboard live demo https://rguiu.github.io/ai-agent-profiler/ · Source https://github.com/rguiu/ai-agent-profiler The live dashboard profiles a real DeepSeek session — the plumbing is identical for Claude Code. ⚠️ Early results.Single-sample runs on one fixture Claude Code + Opus 4.6 on Bedrock . The direction is strong and reproducible; treat individual percentages as ballpark. Caveats are at the end, that honesty is part of the point. An AI coding agent feels like magic: ask it to fix a bug, it reads files, writes code, runs tests, reports back. Underneath, it's just making HTTP requests to a model, over and over — traffic you never see. I built the AI Agent Profiler aap : a transparent proxy that records every request byte-for-byte and passes it through untouched. The first thing that jumps out is the volume . Every call to the model is stateless — it remembers nothing between turns. So the agent re-sends the entire history, from the top, on every turn . Turn 30 doesn't send turn 30; it sends turns 1–30. Again. It's not a chat, it's a snowball: System: "You are Claude Code. Here are your 15 tools…" ~5,000 tok — re-sent every turn Tools: full JSON schemas ~7,000 tok — re-sent every turn User: "fix the failing tests" Tool: