RTK reports token savings, but our cost benchmarks disagree
Posted by michalwarda 1 day ago
Comments
Comment by aeneas_ory 1 day ago
What I had success with (although benchmarks are older) is to index the codebase with a dedicated local code embedding model. It's a bit expensive on the CPU side but in my benchmarks it reduced token use and wall clock time significantly. Of course, it's always dependent on statistical noise + host system load, and running sufficiently large benchmarks is simply too expensive, so take em with a grain of salt.
Why does it work you may ask? Well, LLMs basically brute force words/phrases and pipe that into find/grep/pgrep/whatever (or as recently discussed here write a python script for it - https://news.ycombinator.com/item?id=49654229). Semantic search looks for similarities so you have to do less brute forcing. Comes of course at the cost of indexing everything first.
You can find the project here: https://github.com/ory/lumen
Comment by Whitespace 1 day ago
Save 30% token costs when using Claude Code, Codex, OpenCode for free - with open source, local semantic search. Works for small and large codebases and monorepos! Enterprise-ready and fully compliant via Ollama and SQLite-vec.
Releases v0.0.42 Latest last month
Why should I trust that what you're peddling isn't snakeoil?Comment by aeneas_ory 1 day ago
> Of course, it's always dependent on statistical noise + host system load, and running sufficiently large benchmarks is simply too expensive, so take em with a grain of salt.
And the savings listed are coming from a benchmark harness that implements different OSS bugs one time with and one without lumen - in those cases the % saved are reproducible (caveat: it was on older models, Opus 4.6 I believe).
Also I explain WHY it saves tokens - because the model doesn’t have to brute force different terms until it finds the match it needs, but uses semantic „distance“ so the embedding does it for the model.
Comment by lucaprata 1 day ago
Comment by icantevenhold 1 day ago
I’m using less tokens with Lumen but I also use a bunch of other tokens hacks/skills; it’s hard to measure the impact exactly but it feels significant
Comment by bustermellotron 19 hours ago
Comment by iharnoor 13 hours ago
Comment by huflungdung 1 day ago
Comment by esperent 1 day ago
https://github.com/dirac-run/dirac
I spent way too long trying to reproduce the results in Pi and failing before I decided that I shouldn't trust author benchmarks for any of these tools. Then I found that I couldn't even close to reproduce their benchmark results using the exact model and their harness.
If any person other than the author has time to verify these Lumen benchmark results I'd be curious to hear it. I don't have the time to do it myself at the moment.
Comment by lopatin 1 day ago
Comment by bunderbunder 1 day ago
But anecdotally I do think it saves me quite a lot of time on reading LLM outputs. And that, if nothing else, is good for my sanity.
The caveman gimmick makes sense to me as a clever hack. Caveman talk is a longstanding meme that's presumably well-represented in the models' training data. So just asking it to do that is just an ultra-concise way to tell the LLM to be ultra-concise. Which, in turn, is theoretically good for accuracy because putting too many instructions in the prompt is bad for task performance.
Comment by bustermellotron 16 hours ago
Comment by bunderbunder 13 hours ago
Comment by surefirestudios 11 hours ago
Comment by hedgehog 10 hours ago
https://github.com/jahala/tilth
It combines search with tree sitter grammars so the results can annotate usage vs definitions, cite line number ranges, inline the actual definition if it's short, etc. Not as precise as LSP but simple (no daemon), human readable, and in many cases works without configuration.
Comment by tracerbulletx 20 hours ago
Comment by bkotrys 16 hours ago
Comment by theshrike79 15 hours ago
When caveman was released, token efficiency was a lot more relevant. But in the time I've actually come to like its matter-of-fact and short way of responding. There are other similar ones, but caveman is familiar.
Comment by wlonkly 35 minutes ago
Comment by alemanek 12 hours ago
Comment by Bridged7756 1 day ago
Comment by SJMG 1 day ago
https://blog.jetbrains.com/ai/2026/05/what-happens-when-you-...
Comment by bustermellotron 16 hours ago
Comment by 8note 15 hours ago
Comment by gslepak 21 hours ago
Comment by ramon156 1 day ago
Comment by cassianoleal 1 day ago
What makes it incompatible with Pi, Zed or any other harness?
Comment by aeneas_ory 1 day ago
Comment by woadwarrior01 21 hours ago
Comment by cosmojg 22 hours ago
Comment by simianwords 21 hours ago
the kinda guy who honestly thinks caveman.md reduces costs, actually adds it to his system prompt and is painstakingly reading the terse output
Comment by rvz 23 hours ago
Comment by aeneas_ory 22 hours ago
Comment by liam_ilands 23 hours ago
Comment by oefrha 23 hours ago
rtk command-that-prints-100k-tokens | tail -5
costs 5 lines, maybe 100 tokens without rtk, but rtk will report 100k savings. Of course it doesn't know about that tail -5.Worse, since rtk defaults to persisting that savings stat, it breaks sandboxing. Prefixing with rtk leads to random auto-mode denials from time to time too (this is independent of disabling savings stat persistence).
Honestly have no idea why anyone who knows the first thing about CLIs would take rtk gain seriously. I guess clueless vibe coders who has hardly ever worked in a terminal before will look at the stat and feel good about it?
That said, rtk is still mildly useful for compressing repeated test run outputs and stuff, but you should only ever use it on whitelisted commands; wrapping everything like they suggest you to do is just stupid.
Comment by ProjectBarks 1 day ago
Here are other cases demonstrating the exact same issues with these kinds of tools:
https://blog.jetbrains.com/ai/2026/07/rtk-claude-code-token-... https://brandonbarker.me/writing/headroom-fewer-tokens-bigge...
Comment by everforward 17 hours ago
Eg absurd idea, but you could write something that minifies a codebase (by token, rather than byte) and then translates edits back into the expanded code. Probably an insane use of fuse lol. Partially minifying on each tool call sounds like a huge pain with a lot of state to track.
There’s also a lot of common situations where humans prefer solutions that take more tokens because it’s easier for us to read (eg for loop vs map vs list comprehension), which may have some gains.
I strongly suspect there is some form of token compression that works, but I don’t think it will be as simple as “pipe arbitrary text with no context into this tool”.
Jetbrains feels like a place this might come from. “Take this code, parse it to an AST, find the fewest token representation of it” feels like something they’d do, or maybe Astral (specifically in Python land, type checkers feel sort of adjacent as well).
Comment by ProjectBarks 16 hours ago
Ultimately, the problem is people aren't actually benchmarking any of these ideas or if they are its via an extremely misleading methodology. For example, headroom violates cache frequently, nullifying any potential savings it could have; but does their benchmarks show that? Nope. [1]
As an aside, I wonder how many days are we away from Codex or Claude taking all the "read" tool calls and re-assembling a full map of your codebase and then offering it as a feature.
Comment by everforward 13 hours ago
I have more faith in companies with a more targeted approach. Eg gzip does fine, but video codecs beat compressing raw video by a ton.
> As an aside, I wonder how many days are we away from Codex or Claude
That sounds like SourceGraph but twice as expensive, although it does have “AI” so probably lol
Comment by ericyd 1 day ago
Not defending these tools, but one reason these might not be upstreamed is because it would negatively impact vendor margins, and they have no incentive to save their users money
Comment by kgeist 17 hours ago
It's more subtle than that. If a user has to wait longer for a solution/pay more, they'll be less satisfied and may switch to a competitor. More unnecessary tokens also means more unnecessary compute. Longer sessions are increasingly more expensive to serve than shorter sessions.
And there's always the Jevons effect: as a resource becomes cheaper, demand often increases, and so does net resource consumption.
So, imho, frontier labs have every incentive to reduce token usage per task (while also making you use AI for more and more tasks in your daily life)
Comment by gillesjacobs 1 day ago
Average cost per attempt, without → with RTK:
Claude/Fable: $1.72 → $1.64 (~5% cheaper)
DeepSeek: $0.115 → $0.121 (~5% more expensive)
Almost all Claude savings came from a single task.
Excluding it, savings were under 1%.
It took me a few rereads to parse out the top-line.
This article really buries the lede.Comment by fg137 1 day ago
That's also how I feel about skills/plugins. While some provide important context for specific projects/environments, I am very skeptical about (over)generalized skills like "writing JS tests" or "creating a spec". There are dozens of these skills internally at my company, but I haven't seen a single benchmark that shows any of those are better than just plain, single sentence prompts in a meaningful way (aka statistically significant).
Comment by joegibbs 5 hours ago
Comment by jasonjmcghee 1 day ago
But so many of the weird collections of skills that people on YouTube get viral followings for - I just don't get it.
People excitedly ask me what skills I use and I feel bad just saying only things we've directly authored for some express purpose. None of the "hot" ones.
I've written a large handful of skills, but they aren't like vim plugins. I don't just leave them "on".
This has been my experience at least- curious if I'm just behind the times.
I also effectively didn't leave the IDE+ChatGPT copy/paste workflow until the first release of Claude code. So maybe I'm slow to adopt.
Comment by linrl3 11 hours ago
Comment by lackoftactics 1 day ago
https://mroczek.dev/articles/the-token-compression-illusion-...
Comment by daliusd 12 hours ago
Comment by drgo 5 hours ago
Comment by kgeist 1 day ago
Comment by jghn 23 hours ago
Comment by fwlr 1 day ago
Comment by simonwsimonw 1 day ago
Comment by monneyboi 15 hours ago
Have not benchmarked it, the intent is mostly to save time, not necessarily tokens. I noticed that the models need a lot of toolcalls to ground themselves, and often have trouble with getting an overview.
Comment by patriciobcs 7 hours ago
Comment by GodelNumbering 1 day ago
I tested rtk among these and it was actually a net negative in both CPU time and accuracy, the latter would throw LLMs way off and make it hard to recover. If you are building a coding agent, I'd hard pass on rtk.
~ $ time grep Return * 2> /dev/null | wc -l
966
grep Return * 2> /dev/null 0.36s user 0.02s system 98% cpu 0.382 total
wc -l 0.00s user 0.00s system 1% cpu 0.380 total
~ $ time rtk grep Return * 2> /dev/null | wc -l
260
rtk grep Return * 2> /dev/null 4.10s user 17.10s system 92% cpu 23.008 total
wc -l 0.00s user 0.00s system 0% cpu 23.007 total
Much worse CPU consumption, and more importantly, plain wrong result. These kind of results compromise the entire agent performance because the model trusts wrong output. Without the correct results, any hypothetical savings are penny wise pound foolishSo yeah I am still on the lookout for a credible CLI wrapper, do let me know if you have any in mind.
Comment by elij 23 hours ago
Comment by chorizo 19 hours ago
Comment by bustermellotron 16 hours ago
Comment by cityofdelusion 1 day ago
If the tool won’t be upfront about those things, they are not worth looking into any further. It’s used car salesman strategy.
Comment by kriskrunch 22 hours ago
"Cap large/unknown command output: `COMMAND 2>&1 | head -c 4000`. Never stream full logs, tests, or large files."
I use that instead of RTK. Empirically, I found RTK makes my agents run longer to complete similar tasks.
Ponytail and Caveman seem to help somewhat.
Comment by woadwarrior01 21 hours ago
Comment by hokkos 1 day ago
Comment by jakozaur 1 day ago
Sometimes creating less verbose variants yourself (a simple script, build.sh, with pointers to logs) can be a quick win.
Comment by stephantul 22 hours ago
This is not a good thing of course, but I also feel that acting surprised that this is going on is a little unnecessary.
Having said that: most tools are not helpful
Comment by psadri 1 day ago
It is possible to reduce token usage. It’s just much harder than the basic approach.
Comment by dist-epoch 1 day ago
Comment by fleetfox 1 day ago
Comment by daliusd 1 day ago
Comment by sreekanth850 1 day ago
Comment by lmeyerov 1 day ago
Comment by xnorswap 1 day ago
It was so slow that the roslyn results would be lagged well behind any edits it was making, which would just leave it confused.
Comment by VulgarExigency 1 day ago
Comment by sreekanth850 1 day ago
Comment by antupis 1 day ago
Comment by CodesInChaos 1 day ago
Comment by sreekanth850 23 hours ago
Comment by santiago-pl 1 day ago
Comment by semiquaver 1 day ago
Comment by RIMR 23 hours ago
If my agent runs a shell command, show my agent the output of that shell command. I don't have a problem with automatically pruning or paginating large outputs, as long as the agent still has some form of access to the original output (e.g., by searching).
But removing verbosity from an 'ls' command? That's ridiculous! If my agent runs `ls -la`, do not drop the owner and date from the output, because THAT'S AN EXPECTED PART OF THE OUTPUT. Nothing should be trying to predict the agent's intent and interfering, unless you want your agent to get confused and fail.
These LLMs were trained on predictable shell behavior, and RTK deliberately subverts the model's expectations. There's no way that isn't degrading the model's capability.
Comment by vrighter 1 day ago
Comment by nextaccountic 1 day ago
Comment by vrighter 1 day ago
Comment by nextaccountic 15 hours ago
So it's a kind of self-fulfilling prophecy
Comment by sumandebnath944 6 hours ago
Comment by maorbril 7 hours ago
Comment by elian_ilands 1 day ago
Comment by liam_ilands 23 hours ago
Comment by saltypixel 1 day ago
Comment by yuzushi-dev 1 day ago
Comment by lucaprata 1 day ago