Why Your AI Coding Agent Is Burning Tokens on Busywork (And What to Do About It)

Jul 18, 2026 ai agents token optimization vibe coding ai-assisted development developer productivity context management claude coding workflows tech efficiency

The Token Illusion

Here's a pattern that keeps showing up in production agent sessions: you give an AI coding assistant a small task, it does good work, and then you look at the token count and feel a little dizzy.

One developer recently instrumented a session where an agent closed a GitHub issue. Read the issue, edited a file, ran tests, committed the change, opened a pull request. Clean, complete, useful work.

The output? About 10,300 tokens of actual reasoning and generation.

The total context processed? Roughly 1.55 million tokens.

Let that sink in. That's a work-to-overhead ratio of about 1:150. The agent wasn't thinking with 1.5 million tokens. It was dragging them along like furniture in a moving truck it couldn't unpack.

If you're running coding agents in your workflow — whether for startup development, DevOps automation, or just accelerating code reviews — this ratio is silently eating your budget, inflating your latency, and increasing your risk of context rot (where the model starts losing the thread because the conversation window is too crowded to parse cleanly).

So let's pull apart where those tokens actually go.

Anatomy of a Bloated Session

After reviewing session data across several agent runs, the pattern becomes clear. Most token consumption doesn't come from the model's reasoning. It comes from context scaffolding — the infrastructure the agent needs just to operate.

The tool catalogue explosion. This is the big one, and it tends to sneak up on you. The more MCP (Model Context Protocol) servers you connect, the more tool definitions get injected into the context window. In one session, nine MCP servers were connected, exposing roughly 260 tools. When two of them attached mid-session, one server alone listed around 180 tool names. This happens once per connection, but it never leaves the conversation history. It just sits there, accumulating, adding weight to every subsequent turn.

The skills catalogue tax. Unlike tool dumps, which are a one-shot cost, the skills catalogue is a per-turn expense. Dozens of skills, each with multi-sentence descriptions, loaded on every single interaction. This doesn't spike the token count dramatically — it just raises the floor. Session after session, it quietly inflates your baseline.

System prompt and infrastructure overhead. Before your agent does anything at all, you're already past 100k tokens in many setups. The system prompt, safety policies, tool schemas, and formatting instructions all load every turn. They're necessary, but they're not the work.

The actual task. Here's the uncomfortable part: the issue text, the file edits, the test output, the commit message — all of it combined might be a few thousand tokens. The task is tiny next to the workshop.

Why This Matters More Than You Think

You might be tempted to shrug this off. "Tokens are cheap, right?"

They are cheap — until you're running twenty agent sessions a day, each bloated by factors you didn't know you could control. The math compounds fast. And it's not just about cost.

High context volume means higher latency. The model has to process more on every turn, slowing down response times just when you need speed.

More critically, context rot becomes a real problem. When your agent's working context is packed with tool definitions, skill descriptions, and conversation history it doesn't need for the immediate task, it starts losing signal-to-noise. It may forget relevant context from earlier in the session, misinterpret what you're asking for, or make decisions based on stale information buried deep in the conversation window.

For startups moving fast, that's not a minor inconvenience — it's a reliability problem.

How to Actually Measure What You're Spending

The instinct is to guess. "Maybe this session is large because the task is complex." Usually, it isn't. Usually, it's the infrastructure.

Three approaches that actually work:

1. Read the usage block on your final API response. Every response from your model carries usage stats: output tokens (what the model generated), input tokens (what you sent), and cache_read_input_tokens (what was pulled from the conversation history). That cache_read figure is your smoking gun. If it reads 1.5 million tokens and your output was 10k, you have a clear picture of the overhead ratio.

2. Check your session context status mid-run. Most modern agent frameworks have a command like /context that shows exactly what's occupying your window right now, categorized. This is how you catch the per-turn costs — the skills catalogue and schemas — that a final-turn usage block can't cleanly separate from the actual task.

3. Audit your tool connections before adding more. Before connecting another MCP server or adding another capability to your agent, ask: what's this going to cost me per turn? A single tool definition might be fine. A hundred tool definitions across dozens of servers is a quiet budget killer.

Practical Ways to Shrink the Ratio

Now the useful part. If you've identified that your agent sessions are token-heavy, here's where to start trimming.

Streamline your tool connections. Audit every MCP server and ask whether it's pulling its weight. If a server exposes 50 tools and your agent used 3, that's a disconnect. Consider whether you need all those tools connected all the time, or whether you could scope them by task phase.

Use focused contexts instead of global ones. Rather than loading your entire tool catalogue and skills library into every session, consider task-specific configurations. An agent helping with code review doesn't need the same context as one writing infrastructure code.

Monitor per-session, not just per-month. Checking aggregate costs hides the outliers. Look at individual session token counts and you start seeing patterns — which tasks spike, which connections bloat, which skills are never used but always loaded.

Consider models and frameworks built for efficiency. Some agent frameworks are more token-efficient than others by design. Vibe Hosting's AI-assisted development environment is built with this in mind — giving you the power of agentic workflows without the hidden overhead that eats into your margins.

The Bottom Line

The next time you run a coding agent and feel like the intelligence-to-cost ratio is off, you're probably right. The tokens aren't going where you think they are. Most of them are carrying the workshop — the tools, skills, schemas, and conversation scaffolding — not doing the actual work.

Measure first. The usage block and context commands don't lie. Once you can see where the tokens go, you can make informed decisions about what to trim. In most cases, you'll find significant room for optimization without sacrificing capability.

Your agent doesn't need to carry the whole workshop. It just needs the right tools for the job. Make sure you're giving it exactly that.

Read in other languages:

IT FR ES DE DA ZH-HANS