Mali Cowork
Guide

How to reduce AI token spend

Almost all of an AI agent's cost is input tokens: the code it reads, the documents you push into context, the long output of tool calls, and the earlier turns of a conversation that get resent every time. Cutting spend is therefore less about using a cheaper model and more about sending less, resending less, and reusing what is already cached. Mali Cowork does five things along those lines inside the app, and measures a 31% drop in input tokens against its own previous agent and 60% against OpenCode.

Last updated: 21 October 2026

Why input tokens eat the budget

Every turn of a conversation ships the system prompt, the chat history, the attached files and the descriptions of every available tool. The longer the thread, or the more a tool returns, the more you pay for the same request. Three levers actually work: send less, resend less, and reuse what is already cached.

The five things Token Saver does

1. It loads only the connector tools actually in use

Every MCP server ships a long description of its tools with every request. Connect ten servers and you pay for all ten descriptions every time. Token Saver loads the tools of the server that is actually being called.

2. It shortens stale tool output

The output of a file read or a git command is often huge, and after the agent has read it, most of it does not need to travel again. The output is condensed, and the full version can always be fetched again by re-running the tool.

3. It compacts JSON

JSON from APIs tends to repeat keys and waste whitespace. Compacting it cuts tokens without changing what the data means.

4. It sends long image links as short handles

Image and file URLs are often hundreds of characters. Replacing them with a short handle that points back at the original file saves a lot on document-heavy or design work.

5. It uses prompt caching and summarises near the context limit

With Claude, prompt caching kicks in as the context fills up, and the conversation is summarised into a short paragraph so the task can carry on. That keeps quality far better than dropping the thread entirely.

What it measures

Measured over 7 tasks × 2 rounds (input tokens)
ComparisonResultChange
Against Mali Cowork's previous agent31% of the original tokens31% fewer
Against OpenCode40% of the original tokens60% fewer
Quality checks in runs without provider errors100% passed, same as with Token Saver offNo change

Reducing token usage without any of this

  • Split long threads into topics and start a fresh one when a task ends
  • Use a cheaper model for work that does not need deep reasoning, such as summarising or reformatting
  • Turn on prompt caching where your provider supports it, since unchanged context is not billed twice
  • Give the agent an explicit scope of files to read instead of letting it search the whole project
  • Have the agent write its result to a file and start the next round with that summary, not the whole history
  • Set the context window to match the task; a short job does not need a large context
  • Review provider usage logs regularly and look for prompts that are still larger than they need to be

How to measure it yourself

  1. 1Pick three to five real, repetitive tasks and run each one twice under identical conditions
  2. 2Record the input and output token counts from your provider's usage report
  3. 3Turn Token Saver on and run the same tasks again
  4. 4Compare the average per task, then convert it to money with your model's price per token
  5. 5Check answer quality as well, because saving tokens while the work gets worse is not a saving

What else Mali Cowork does

Beyond token savings, Mali Cowork brings several providers into one app, works on real files inside the folders you approve, and can roll back every file it changed. How the app works is covered in “What is Mali Cowork”.

Frequently asked questions

Does saving tokens make the answers worse?
In our measurements, runs without provider errors passed 100% of the quality checks, the same as with Token Saver off. And when condensed data does turn out to be needed, the tool is simply called again to fetch the full version.
How much can I save?
In the measured work, input tokens dropped by 31% against Mali Cowork's previous agent and by 60% against OpenCode. The real number depends on the task, the model and how much data the agent has to read.
Does it work with models other than Claude?
Yes. The condensing and tool-loading work with every provider; prompt caching is a provider capability, so it is only used where it is supported.
How do I benchmark it myself?
Toggle it with MALI_TOKEN_SAVER=0, run the same tasks both ways, and compare the usage your provider reports for each run.

Try Mali Cowork on your machine

Free to download, no paid tier. It runs on macOS and Windows and brings every model you already pay for into one app.