How to Reduce Token Usage in Claude Code

The bill grows not from the number of tasks but from the context sent with each request. Here are practices that remove unnecessary tokens.

3 min · · Updated · claude-code · tokens

Where the bill comes from

Claude Code sends the model not only the current question but also the accumulated conversation history, the contents of open files, and the output of invoked tools. Each agent step drags along everything that came before.

So the bill grows non-linearly. A long session with a dozen iterations can cost more than several short ones, where each started with a clean context.

There are three main levers: context cleanup, model slot choice, and narrowing the area the agent searches.

Context cleanup

The first thing that noticeably reduces usage is not keeping in context what is no longer needed.

  • Start a new session when you move to an unrelated task. Otherwise the old conversation is sent again and again.
  • Do not open the whole repository if the change touches two files. The agent includes the contents of open files in the request.
  • Remove long logs and command output from the conversation once you have dealt with them.

A short, focused context also lowers the risk that the model wanders off and spends extra iterations.

Model slot choice

Not every task needs the most expensive model. Small edits, boilerplate generation, and explanations can go to a cheaper model, while heavy reasoning stays with a more capable one — which model handles what, test on your own tasks.

In the Zukko catalog, prices per million tokens differ noticeably:

ModelInput / output per 1M
claude-opus-5-5$0.3 / $0.3
claude-sonnet-5$0.3 / $0.3
gpt-5.6-sol$0.3 / $0.3
gpt-5.6-luna$0.1 / $0.1
glm-5.3$0.1 / $0.1
glm-5.3-flash$0.04 / $0.04

The model set changes; the current list is GET https://api.zukko.pro/v1/models. GLM has a 128K context and no vision; the others have 1M.

For reference: the official Anthropic price for Claude Opus 5.5 is $4 for input and $20 for output per million tokens. The difference is especially visible on output tokens. But most of an agent's tokens are input, and here is a caveat: vendors charge ~10% of the input price for prompt-cache reads, while Zukko bills cached tokens at the regular price, so for long sessions with a large context the real gap is smaller than a straight comparison suggests.

The logic is straightforward: keep two or three models on hand and switch by task type, rather than using one for everything.

Narrowing the search scope

When the agent searches across the project, it reads files, and each file read is input tokens.

  • State the path or directory explicitly instead of asking to search the whole project.
  • Phrase the task narrowly: "fix error handling in this module," not "figure out why it crashes."
  • If you know the file or function name, name it. This cuts the number of steps where the agent reads irrelevant material.

Connecting

Claude Code is configured through environment variables:

ANTHROPIC_BASE_URL=https://api.zukko.pro ANTHROPIC_AUTH_TOKEN=fetch_...

The base URL is given without the /v1 suffix — the client adds the path itself. The ANTHROPIC_API_KEY variable must not be used: with it Claude Code requires signing into an Anthropic account.

These three practices work together. A clean context reduces the size of each request, a suitable model slot lowers the price per token, and a narrow search scope cuts the number of steps. For connection questions, reach Zukko support: https://t.me/zukkopro?direct

zukko

Pay 25×
less

for Claude Code & ChatGPT

One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.

Get API keyDocumentation

api.zukko.pro · fetch_*

Cut Token Usage in Claude Code · Zukko