Live Nov 18 · Cohort 3Nov 18, 19:00 MSK — free hands-on AI agents live workshop · Live Cohort 3 starts Nov 23Join Nov 18 Live →Cohort 3 (Nov 23)
ReleaseInsight · On RadarHabr AI→ original

Three "token-saving" utilities raised the AI agent bill by 18–46%

A developer spent two months saving agent tokens with rtk, Headroom and ripwire, then checked the bill in dollars. It rose 18% on 30 SWE-bench tasks and 46% on real sessions. The cause is the prompt cache: it accounts for 92% of the bill, and compression does not save on it. Even the one-word question "finished?" cost more than analyzing an entire project when it came in the morning, after the cache had gone cold overnight. Look at your provider's bill, not at the token counter.

AI-processed from Habr AI; edited by Hamidun News
Three "token-saving" utilities raised the AI agent bill by 18–46%
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1rtk did not compress a single one of 3 452 calls, and the agent never called ripwire
Key metric #2Cache reads are 20–40 times cheaper than writes, and the cache lives for about an hour
Key metric #3"finished?" cost 606 thousand units versus 471 thousand for analyzing the project

A developer building Tobari, a desktop app for running AI agents such as Claude Code and Codex, spent two months using three popular token-saving utilities: rtk, Headroom and ripwire. The "saved" dashboard showed impressive numbers. But when he checked the actual bill in dollars, costs had gone up.

On a test bench of 30 SWE-bench tasks (a set of real bug-fixing tasks from open-source projects), the bill with the three utilities rose 18%. On a replay of his own real working sessions, it rose 46%. Imagine you compress git status output from eleven lines to three and celebrate, but you actually pay more, because the change breaks the cache that was keeping most of the work cheap.

If you plug "optimizers" into your agents, check them against your provider's bill, not their own counters.

Why save at all

The trigger was the confusion over usage limits. OpenAI and Anthropic keep changing subscription limits and do not officially publish the volumes. In September, Anthropic cut Claude Code's weekly limits but presented the change as a 25% increase. Before that, a temporary +50% bonus had been in place for six months, and in a follow-up clarification the company itself acknowledged a net cut of 17%. On September 29, OpenAI released a Pro 500 subscription for $500 and, the same day, halved the limits of Pro 200 for new subscribers. On October 22, SemiAnalysis measured two $200 Claude Max 20x accounts: one had a five-hour window 19% larger, but a weekly budget 20% smaller.

Three tools and what went wrong with them

All three try to put fewer bytes into the context, but they intervene at different points.

rtk works in the shell: it intercepts command output and hands the model a compressed version. It has 84 thousand stars on GitHub, and its description promises a 60–90% token reduction. Over the entire period, rtk did not compress a single one of 3 452 calls. The README carried a table showing "118 thousand tokens → 24 thousand," but those were estimates, not a measurement. On July 22, the day JetBrains published its measurement, the authors deleted the table. In the commit message they wrote that rtk reduces bash output bytes, not costs.

Headroom (77 thousand stars) sits as a proxy between the agent and the API and compresses JSON, logs and old outputs. It made one of the author's sessions 2.4 times more expensive.

ripwire compresses nothing. Instead, it gives the agent better tools: rather than "read an 800-line file," it offers "show me the function and who calls it." But the agent never called it.

Why tokens are not what you pay for

The author broke down one Claude Code session on Opus 5.5. His prompt "Study the project from top to bottom" took about 15 tokens, while the context grew from 39.5 to 167.5 thousand over the turn. Three quarters of that was files and command output the agent pulled from the repository itself, and another quarter was the starting context. The agent's own output was under 3%.

The model remembers nothing between requests, so the agent resends the entire conversation every time. To write a reply of 2 317 tokens, it sent 167 thousand tokens 19 times. In total, the turn came to 2.19 million tokens, 13 times more than the conversation itself. The author's median request to the model is 335 thousand tokens, and an average session has about forty of them.

The prompt cache saves the day. If a request starts with the same bytes as the previous one, that chunk is read from the cache. The same context token (calculated for Sonnet) costs either ×0.1 or ×2, a 20-fold difference. On Opus 5.5, reading is even cheaper at ×0.05, a 40-fold difference. The whole "Study the project" turn cost 471 thousand units with the cache versus 2.22 million without it.

The cache lives for about an hour. The author finished in the evening while planning, and in the morning, more than 8 hours later, he wrote a single word: "finished?". The context had to be written again, 293 582 tokens at the write price. That cost 606 thousand units, more than all 19 requests of the project analysis. With a warm cache it would have been about 34 thousand, 18 times cheaper. A token compressor would not have helped here: the message was only a couple of tokens.

According to the author's real bill for 146 sessions and 35.5 thousand requests over a little more than two months, 92% of the cost is the prompt cache. Another 42% of the total bill went to rebuilding context that was already in the cache but had expired or broken; 26% of that came after pauses longer than an hour. The cache breaks silently: there are no errors and the agent answers just as well, but the bill grows. The only honest signal is the share of input read from the cache. For bare Claude Code it is about 98%.

What to do in practice

  • Count money by your provider's bill, not by the dashboards of the tools themselves.
  • Watch the share of input read from the cache: every percentage point lost is expensive.
  • Remember that returning to a cold session after a pause of an hour can cost as much as a large project analysis.
  • Do not trust promises like "minus 60–90% tokens" without a methodology and a measurement on a live agent.

This is the experience of one developer and his set of agents, but the issue lies in the cache pricing model itself, not in any particular project.

Story

Key Questions Answered

Why save at all?

The trigger was the confusion over usage limits. OpenAI and Anthropic keep changing subscription limits and do not officially publish the volumes. In September, Anthropic cut Claude Code's weekly limits but presented the change as a 25% increase. Before that, a temporary +50% bonus had been in place for six months, and in a follow-up clarification the company itself acknowledged a net cut of 17%.

What are the key details on Three tools and what went wrong with them?

All three try to put fewer bytes into the context, but they intervene at different points. rtk works in the shell: it intercepts command output and hands the model a compressed version. It has 84 thousand stars on GitHub, and its description promises a 60–90% token reduction. Over the entire period, rtk did not compress a single one of 3 452 calls. The README carried a table showing "118 thousand tokens → 24 thousand," but those were estimates, not a measurement.

Why tokens are not what you pay for?

The author broke down one Claude Code session on Opus 5.5. His prompt "Study the project from top to bottom" took about 15 tokens, while the context grew from 39.5 to 167.5 thousand over the turn. Three quarters of that was files and command output the agent pulled from the repository itself, and another quarter was the starting context. The agent's own output was under 3%. The model remembers nothing between requests, so the agent resends the entire conversation every time.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…