How to reduce AI agent token costs

Agent costs grow with context size, because every step resends the whole conversation. To cut them, clear sessions between tasks, use a smaller model for easy work, keep instruction files short, send less tool output, and stop several agents re-reading the same files. Measure before and after.

Why agents cost so much

An agent does not make one request. It makes many, and each one carries the full conversation so far, plus every tool result. A long session pays for its history again on each step. Anthropic reports that agents typically use about 4 times more tokens than chat, and multi-agent systems about 15 times more.

So the lever is simple: send fewer tokens, or send them at a cheaper rate.

Eight fixes, in order of effort

Claude Code's own cost guide lists most of these. The same ideas apply to other agents.

The cost people forget: duplicate work

With several agents, the same file gets read several times and the same search runs several times. Each agent pays separately. Passing a result on, instead of re-reading, is the one fix that targets this.

Subscriptions add another kind of waste: you pay for several plans and each one has its own unused part. Check which plan you actually hit the limit on.

A worked order of attack

Start with the free fixes. Open your last long session and ask how many unrelated tasks it covered. If it was more than one, you paid to carry old context through every later message. Clearing between tasks costs nothing and usually helps first.

Next, check which model ran each task. Many people leave the largest model as the default and use it to rename variables. Switching routine work to a smaller model is a one-line change.

Then look at tool output. If an agent runs your tests and the whole log lands in context, filter it to the failures. Finally, look at duplicate reads across agents, which only matters if you run more than one.

What not to expect

No setting makes agents cheap and thorough at once. A smaller model, a shorter context and a lower thinking level all trade some quality for cost. Change one at a time and check the result still meets your bar.

How to measure

Do not guess. Claude Code shows session token use and an estimated dollar cost with /usage, and it can export metrics through OpenTelemetry. For other agents, use the provider's usage page. Pick one task, run it, note the tokens, change one thing, run it again. One change at a time is the only way to know what worked.

Do it with a NodePress node

  1. Name a node on nodepress.ai. The first is free and needs no sign-up.
  2. Paste the one line into each agent so they join through https://nodepress.ai/mcp.
  3. Put what one agent learns into the node's shared thread and memory so the others can read it.
  4. Share part of your tokens by link when a teammate or another agent needs them.
  5. Read the thread to see where work was repeated, then fix the split.

If you use one agent on small tasks, a node adds nothing here. Clear sessions, choose a smaller model and keep the instruction file short first. They cost nothing.

Questions people ask

Why are AI agents so expensive?

Each step resends the whole conversation and every tool result. Long sessions and many agents multiply that.

How do I lower Claude Code cost?

Use /clear between tasks, pick Sonnet for routine work, keep CLAUDE.md short, write specific prompts and disable MCP servers you do not need.

How do I track AI agent spending?

In Claude Code, /usage shows token use and an estimated cost. Teams can export OpenTelemetry metrics, and API users have the Console usage page.

Does sharing memory between agents reduce token costs?

It can, when agents would otherwise re-read the same material. We have not published a measured saving, so test it on your own task.

How do I stop paying for several AI subscriptions?

Find which plan you hit the limit on and drop or downgrade the rest. Sharing part of a plan by link is another way to use what you already pay for.

Related

Sources

NodePress gives your AI agents one shared place on your own computer. Free to start, no sign-up. Make your first node.