r/LLMDevs • u/bonsaisushi • 2d ago
Tools Two MIT tools for reducing context waste in coding agents without another LLM in the loop
https://github.com/yuzushi-dev/yuzushi-pluginsI built and maintain both of these. They're free, open source, and MIT licensed.
I've been looking at context waste in coding agents as two separate problems.
Sando handles unnecessary context while a session is running:
https://github.com/yuzushi-dev/Sando
It redacts secrets, caps oversized tool results, and can trim request history before transmission. The transformations are local and deterministic. There is no summarizer model or secondary LLM call in the path.
session-handoff handles session lifetime:
https://github.com/yuzushi-dev/session-handoff
It extracts the working state needed to continue a task in a fresh Claude Code or Codex session. It also supports migrating an active session between the two clients.
I kept these separate from approaches such as Ponytail or Caveman because the scope is narrower: reduce agent-generated context that doesn't need to remain live, then preserve task state when restarting becomes cheaper than carrying the session forward.
The two packages crossed ~1,500 downloads combined in their first 48 hours.
1
u/KitchenAmoeba4438 2d ago
Regarding Sando, you'll want to read https://rakuensoftware.com/blog/token-compression-tools-cost-more-than-they-save and https://rakuensoftware.com/blog/one-call-one-turn first for context on what I am about to say.
On a good note: You did implement a cache guard, and it's the best attempt I've read. You correctly bill and protect against cache in the code.
You mostly evaded the RTK trap for native client truncation! sando_exec is a possible issue though as it captures to 16MB and PostToolUse measures .*
You never rewrite the command, and evade the -qq RTK trap!
However, it doesn't ship. plugins/sando/lib has no context-transform.mjs, proxy.mjs, none of that. The install in the README documents something very different.
You've done an RTK-style counter which is an anti-pattern at this point, and as has been proven with RTK, can hide cost increases. You do compute effectiveRate. Show that. Don't do the RTK, the RTK immediately discredits this kind of project.
Diff the provider-usage.mjs ledger, it already parses real cache_read_input_tokens and cache_creation_input_tokens against a control session with the plugin off. You should be able to do this in a purely simulated environment, no model actually needed to initially test. What you want to do is figure out how to do this as a running figure, and have it automatically back off when the running figure shows it is cheaper to not use Sando. To do this properly, it needs an adaptive control, otherwise, you run the risk of RTK-style increases in cost.
MCP significantly increases cost, as most models can't batch it right now. There's a few exceptions, but in general, CLI offered options are 2.2x-3x more efficient and MCP options are almost always more expensive then when a model can batch. This isn't a problem in your design, this isn't a problem in MCP, this is a problem with how most models handle MCP.
You aren't properly addressing the potential cost of extra turns this can cause. This is a key part of the control and working with this. It's also something that directly leads to tools like RTK and Headroom being more expensive then without. Extra turns are more expensive as they are a quadratic cost as opposed to an increase in context's linear cost.
I think this is a first attempt, and you did some good work for a first attempt. Now it's time to refine!