Findings
Same work, a third fewer tokens
We taught FireMoon to stop resending what the model doesn't need. Then we ran real coding tasks with and without it to see what it actually saves, and what it costs.
11 November 2026 · 8 min read · MintFlow Technologies
Every request a coding agent sends repeats most of the last one. The system prompt goes again, the whole history goes again, and so does the description of every tool the agent could possibly call. Before this work, FireMoon sent about 12,700 tokens of tool definitions with each request. A typical task uses five or six of those tools.
Providers cache a lot of that repetition, which helps. It doesn't make it free, and it does nothing for the model's attention: a model that reads dozens of tool descriptions on every turn has to keep deciding which of them matter. Vercel wrote about this last year. They cut their data agent from 17 tools down to two and watched its success rate go from 80% to 100%. We didn't want to take tools away from people. We wanted to stop shoving all of them at the model every time.
Other agents have been moving the same way. Claude Code, Codex, Cursor and Antigravity now keep MCP tools out of the request until they're needed, and most of them save very long output to a file instead of pasting it in. We wanted to go further on three fronts: our own built-in tools, the content of the output itself, and what an agent can learn from the projects you work in.
What we built
Three features, all running inside the app, all on by default.
Tools on demand. Each request now carries a small core set: reading, editing, searching, the shell, the web and a handful more. Everything else, MCP tools included, sits in a short catalog the model can see by name. When it needs one, it loads it, and the tool stays loaded for the rest of the conversation. If the model just calls a tool it hasn't loaded, that works too, and it's loaded from then on. FireMoon also preloads what a request clearly points at, like the tools of an MCP server you mention by name, so most loads happen before the first reply.
Context Compression. A port of Headroom, an open-source project that compresses tool output before the model sees it. A 940-line test log becomes the failing test, its assertion and the summary. A big JSON array becomes a compact table. Grep output keeps the best matches per file. Only the newest output is touched, so everything the provider already cached stays byte for byte the same, and the full original is saved where the agent can read it back.
Token Economizer. A port of Microsoft'sTokenEconomizer. It learns each project as you work in it. Tools you never use in a project get set aside after enough sessions to be sure. When a turn keeps editing the same file and hitting the same failure, it sends the agent one short process check that points this out. It never stops the agent. And it can remember small facts that keep proving true, like "python fails here, use python3".
Both ports are written in Rust and run on your machine. Neither project sends anything anywhere when it runs inside FireMoon, and the thresholds they use come from a small signed rules file we can update without shipping a new app.
How we tested it
We used FireMoon's own evaluation harness. It starts the real agent with the real tools, gives it a task in a small project and grades the result with a command, usually the project's tests. Seven tasks: three we already had (add a feature, fix a failing test, a refactor) and four new ones built to stress these features. One prints a 320-row inventory as JSON. One has a noisy test suite where a single test out of 122 fails. One is a rename across 28 files. One needs a Jupyter notebook edited, which is exactly the kind of specialised tool that no longer sits in the core set.
The model was Nvidia's Nemotron 3 Ultra through OpenRouter's free tier. We picked a free model on purpose: anyone can rerun this without a bill. The catch is that free models cost nothing, so a dollar figure means nothing either. We priced every run's tokens at Claude Sonnet 5.5's API rates instead, cache reads included, to get a number that translates to a real invoice.
Each task ran once in each of seven setups: everything off, each feature on its own, everything on, all tools on every request (how FireMoon worked before), and two runs where the Token Economizer started from a project it had seen before. That's 49 runs and 470 requests. The free tier allows 1,000 requests a day, which is why there is one run per cell and not five.
What we found
- fewer tool tokens per request
- 63%
- 12,713 down to 4,671 with tools on demand
- fewer input tokens
- 37%
- with both savers on, compression in full mode
- lower estimated cost
- 33%
- priced at Claude Sonnet 5.5 rates
- tasks still pass
- 6/6
- the same as with every saver off
The clearest number is the one that doesn't depend on how a particular run went. With every tool on every request, each request carried 12,713 tokens of tool definitions. With tools on demand it carried 4,671. With the Token Economizer pruning a project it knew, 2,890. Same tasks, same pass rate.
- Every tool on every requestFireMoon before this work177k
- Tools on demandFireMoon with the savers off144k
- + Context Compression121k
- + Compression and Token Economizer91k
Every setup passed all six tasks. Measured with Context Compression in full mode; the default, "Lossless only", saves less on logs and search results.
Across the six tasks that behaved consistently, turning on both Context Compression and the Token Economizer used 37% fewer input tokens than having them off, and the estimated cost fell by 33%. Every setup passed all six.
| Setup | Passed | Input tokens per task | Est. cost per task |
|---|---|---|---|
| Every tool on every request | 6/6 | 177,023 | $0.122 |
| Tools on demand, savers off | 6/6 | 143,957 | $0.123 |
| + Token Economizer | 6/6 | 136,115 | $0.120 |
| + Context Compression | 6/6 | 120,566 | $0.111 |
| + both | 6/6 | 91,447 | $0.083 |
Compression earned its keep on big outputs and did nothing on small ones, which is what you want. On the noisy test suite it took about 18,000 tokens out of the run and the agent still found the bug. On the small refactor it didn't touch anything, because nothing was big enough to bother.
The Token Economizer is a slow starter by design. In a project it has never seen there's nothing to prune and no idea of what a normal turn looks like, so it mostly watches. Once it has history it removes another chunk of tool definitions from every request. Its loop guard never fired in these runs, because none of the tasks sent the agent round in circles. We test that part separately with a scripted spiral.
Caching changes the money math
You may have spotted something odd in the table. Tools on demand saved a lot of tokens against "every tool on every request", but the estimated cost barely moved on those six tasks. That's prompt caching. Roughly 70% of the input tokens in these runs were cache reads, and a cached tool definition costs a tenth of a fresh one. Over all seven tasks, tools on demand cut input tokens by 45% and the cost by 26%. On a provider or a local model that doesn't cache, every token saved is a token you don't pay for or wait for.
What didn't go to plan
The rename task failed in five of the seven setups in the first pass, always by running out of turns. Reading the transcripts made the reason obvious: in the run that passed, the model wrote one sed loop over all 28 files. In the runs that failed, it opened and edited the files one at a time and ran out of turns. That's the model choosing a strategy, not a feature getting in the way, and the reruns showed it. With a higher turn limit, the setup with everything off failed one of two attempts too.
There is a real lesson in it, though. Compressing search results means the model sees the best 30 of 107 matches, not all of them. For a rename, every match matters. The model can read the full list back, and with both features on it did fine, but we'd rather not make it work for that.
The other surprise was the JSON task. Compression saved nothing there in the first pass. The inventory was 82 KB and FireMoon's shell tool cuts output at 64 KB, so compression was handed the tail end of a JSON document and couldn't parse it. We changed it to compress the full output from the file the shell saves, so the model now gets the whole inventory, shortened, instead of its last rows. We reran the task on a second free model, because Nemotron was overloaded that afternoon: compression took 19,700 tokens out of the run, input dropped by 30%, and the task still passed.
Why "Lossless only" is the default
Everything above was measured with compression in its full mode. FireMoon ships with it set to "Lossless only", which only does rewrites that throw nothing away: JSON gets minified and turned into compact tables, while logs, search results and diffs pass through whole. On our sample of real tool outputs that's a 38% saving instead of 86%. We'd rather leave some savings on the table than have the agent miss the one line it needed. If your work is mostly logs and big searches, turn it off in Settings, under Agent, then Token savings.
What to take from it
This is one model, one run per setup and seven small tasks. Single runs vary a lot: the same task in nearly the same setup came in at 145,000 tokens once and 247,000 another time. So treat the totals as a good sign rather than a promise. The per-request numbers are the solid ones. Tools on demand removes about two thirds of the tool definitions from every request, and pruning removes more, with no change in what the agent gets done.
You can see what it saves you in Settings, under Usage, which now counts the tokens kept out of your requests and what they would have cost. The full write-up, with every run and the command to reproduce it, is in the FireMoon repository under docs/benchmarks/token-savings-2026-11.md.
