Cost-saving strategies.
A coding session repeats itself. The same files get read twice, the whole history goes back on every turn, and pages of build output matter for one line. squeezy cuts each of those in four layers, and more than one layer can act on the same turn. The first three run by default. The fourth is the controls you use to steer.
contents
contents
1. Understand the code first
Before spending a token, squeezy reads your repository locally and works out which files and lines matter.
- Read the relevant code, not the whole file. squeezy finds the exact declarations, callers, and slices on your machine, then sends the model those instead of entire files.
- Query your code, don't grep it. A local code knowledge database spans 40+ languages and formats: every symbol, definition, caller, and reference. So "who calls this?" is one query, not a dozen file reads.
2. Don't pay for the same bytes twice
Most of a coding session repeats: the same instructions, the same files, the same command output. squeezy keeps that out of the bill.
- Reuse stable context. Where the provider supports caching, squeezy keeps stable instructions and context cache-friendly, so repeated turns cost less.
- Replace repeated output with a receipt. When the same file or output would be sent twice, squeezy sends a short receipt that points back to the first copy, not the bytes again.
- Load tool definitions on demand. The model sees a compact tool index first and loads a full definition only when it's needed, which also keeps the cached prefix intact.
- Stop paying for bytes an edit made stale. After an edit lands, squeezy trims the now-stale parts of earlier reads in place, so later turns don't re-buy lines the change already replaced.
3. Right-size every turn
Not every turn deserves the biggest model or the longest history. squeezy matches the effort and the context to the task in front of it.
- Send simple turns to a cheaper model. Simple, mechanical turns start on a small, fast model and step up to the main one only when the task turns out to be hard.
- Keep long sessions bounded. As a session grows, older turns fold into a short summary of goal, progress, and decisions, so turn 30 doesn't pay for turns 1 through 29.
- Send the useful part of command output. Build, test, and search output is trimmed to the part the model can act on, with the full log one fetch away.
- Keep exploration off the main thread. Short-lived subagents explore or review in their own context and hand back a summary, instead of bloating the main thread.
4. Control the bill, don't just watch it
Seeing where the tokens go only helps if you can act on it. squeezy turns the numbers into control: cap the spend, force a turn cheaper or stronger, and see exactly where it all went.
- Cap the bill before you hit it. Set an optional session cost cap or per-step token ceiling and squeezy stops before it crosses the line, warning as you approach instead of after.
- Force a turn cheaper, or stronger. Send the next turn to the small model when you know it's easy, or to the main one when it isn't, without changing your defaults.
- See where every token went. The cost view splits the session by model and by role, into input, output, reasoning, cache reads, and cache writes, in dollars where the provider publishes rates. The context view says how much of the window is in use right now.
The full catalog
Those four layers are the shape of it. Below is the full set, grouped by the kind of waste each one attacks: 32 reduce what you spend, and 4 more let you see and control it. Each is its own mechanism, so several can act on one turn. When they land on the same tool result, the report's headline total counts that chain once instead of adding it up twice, and still lists each mechanism separately underneath.
Read the right code, not the whole file · 4
Attacks: Over-reading whole files to answer a small question.
- Code knowledge database. Reads your project once, on your machine, into a local database of every symbol and how they connect, so the model gets the exact function, or just its signature, never a whole file.
- Inheritance pre-flight. Answers "what are all the subclasses of X?" with one quick local lookup up front, instead of the model searching the repo across several paid turns.
- Ranked code search. Ranks matches instead of listing them. A question written in prose is also matched by meaning, so a description of what the code does finds it even when you don't know its name; an exact identifier stays a literal search, because there nothing beats the name you already have.
- Relevance ranking. When several matches look equally good, squeezy breaks the tie by following your repository's own imports out from the files already in play, so the one you meant comes first and a wrong guess doesn't cost a read.
Shrink the conversation · 3
Attacks: Re-sending a bloated history on every turn.
- Conversation compaction. Folds older turns into a short summary of the goal, progress, and decisions while keeping recent turns word-for-word, so turn 30 doesn't re-pay for turns 1 through 29. It is reversible if you need the detail back.
- Duplicate collapsing. Spots repeated boilerplate and duplicate blocks within and across messages and collapses them to a single copy, so the model still sees every distinct line but not the repeats.
- Learned context limits. Remembers a provider's real prompt limit after it rejects or clips an oversized turn, so squeezy stops re-sending turns that would fail, each one a wasted paid round-trip.
Shrink tool output · 10
Attacks: Noisy build, test, search, and diff output.
- Structured tool output. Distills a build, test, grep, or diff run down to its errors, failures, and summary before the model sees it, turning a multi-kilobyte log into a few hundred tokens, with the full log one fetch away.
- Shell family shapers. Strips predictable filler such as download bars, progress banners, and hints from git, npm, Maven, Gradle, Go, and more, while keeping anything that looks like an error or a result.
- Large-output spilling. Parks an oversized result in a local file and shows the model a short preview plus a way to fetch the rest, so one big output can't flood the next turn.
- Reversible compression. Collapses redundant runs in diffs, logs, and JSONL in place while keeping every meaningful line, with a handle to recover the exact original.
- Structure-aware compression. For source files the database doesn't cover, shrinks a code dump using its structure, keeping signatures and key lines while trimming filler.
- Graduated trimming. Measures how bloated each output actually is and applies only as much trimming as needed, so clean outputs pass through untouched and only bloated ones get squeezed hard.
- Never-worse guard. A safety rule for every trimmer: a shrunk result must be smaller than the raw one and carry a way to recover the original, or it isn't used, so trimming can never backfire.
- Image compression. Resizes an image down to what the provider actually needs before sending it, since images are billed by size.
- Empty-result notes. When a search or command legitimately finds nothing, says "no results" explicitly so the model doesn't wastefully retry the same call.
- Bounded diagnostics. Caps how much complaint output one broken or unusual file can generate, so a malformed file can't flood the context with thousands of parser warnings.
Don't pay for the same bytes twice · 4
Attacks: Re-billing the identical prompt prefix.
- Byte-stable cache prefixes. Providers that bill for prompt caching discount a request whose opening matches a recent one. Collecting that is table stakes; keeping it is the work. squeezy holds the opening (system prompt, tool list, history) byte-for-byte stable so the discount keeps landing turn after turn instead of breaking on a timestamp or a reordered tool. The discount is the provider's, and squeezy reports it against your bill rather than counting it as its own saving.
- Repeat-output receipts. When the model re-reads a file or re-runs a search, sends a short "you already have this" pointer instead of the bytes again, with the full copy still recoverable.
- Cache ROI & modes. Only pays the up-front cost of warming the provider cache when real reuse will earn it back, and lets you pin or turn off caching by hand.
- Cache-aware compaction. Before trimming the conversation mid-session, checks whether the trim would break the provider-cache discount, and only trims when it comes out ahead.
Slim the fixed request overhead · 2
Attacks: Paying for unused tool and skill definitions.
- Lazy tool & skill loading. Sends a short menu of tools and skills and loads a tool's full details only when the model reaches for it, so you stop paying for dozens of unused ones every turn.
- Tool-schema compaction. Rewrites bloated external tool specs (for example, MCP) down to a tight byte budget without changing what the tool does.
Send the job to the right model & effort · 6
Attacks: Using a big model or full effort for easy work.
- Cheap-model routing. Sends simple, mechanical turns to the Cheap rung you configured, stepping back up automatically if the task turns out hard. Point that rung at a smaller, faster model and those turns cost less; nothing checks, so the saving is as real as the model you named. It uses your main provider unless you point it at another one.
- Sub-agent isolation. Runs a wide investigation in a separate helper agent and brings back only a summary, so the dozen searches never bloat your main thread. Where the request names no model outright, delegated review helpers use one shared Utility route that keeps its provider account and model together. It tries an explicit Utility assignment, the Build Provider profile's Utility default, and a known small, fast model before falling back to the complete Build route. Explore helpers prefer their own route or Base model override, then use that same shared Utility route. Utility handles frequent background work, so choose an economical model that is still capable enough to finish the job; an unreliable bargain model wastes retries, while a flagship model defeats the saving. A request that does name a model — a custom agent's own, or the rung cache isolation picked — runs there and consults none of it. Nothing checks any choice against your Build model's price, so that half of the saving is as real as the model you named.
- Continuation policy. Hidden reasoning is billed as output. When the only thing a step adds is the model acknowledging its own bookkeeping, such as the to-do update it just wrote, squeezy dials that step's reasoning effort down a notch. Any step carrying real evidence, or an error, keeps the full budget.
- Verbosity controls. Lets you set how chatty the assistant is and how much tool output shows, so a quick scripted task doesn't pay for paragraphs of explanation.
- Adaptive verbosity. Automatically lets answers get shorter when recent replies look over-explained, and snaps back the moment one looks too terse, erring toward saying enough.
- Loop guard. Detects when the model is stuck repeating a failing or needless call and cuts the turn short before it burns more steps.
Reuse local work instead of redoing it · 3
Attacks: Rebuilding or re-deriving state across turns and sessions.
- Session persistence & memory. Saves your session and durable notes to disk, so resuming, forking, or recalling a fact re-pays only for what changed instead of re-deriving everything.
- Working set. Tracks which files the agent is actively using and drops the stalest when it grows too big, so the context holds the relevant files without unbounded growth.
- Memory hygiene. Deduplicates near-identical saved facts, lets stale low-value ones fade, and tracks where each came from, so memory stays lean and doesn't bloat what it re-injects.
See and control the bill · 4
Attacks: Flying blind on spend, with no way to cap it.
- Cost & context views. /cost shows what you have spent this session and /context shows where every token is going right now, so a full context window becomes a specific, fixable answer instead of a guess.
- Spend caps. Set an optional session cost cap or a per-step token ceiling, and squeezy stops before it crosses the line, warning as you approach instead of after.
- Force cheaper or stronger. Send one request to Cheap, Main, or Expensive with /router cheap, /router main, or /router expensive, or open routing settings with /router, without changing your defaults. A destination with no target configured runs the request on Main rather than refusing it.
- Savings dashboard & reports. A live cost panel, an exportable HTML report, and cold-shell squeezy savings and /cost discover show what each strategy saved and where to tune next.
How to read the numbers
What you save depends on things squeezy does not decide: which model you run, what your provider charges, whether that provider discounts a repeated prompt opening, how large the codebase is, and what the task looks like. So this page describes mechanisms instead of promising a multiplier. The benchmarks carry the measured numbers, and the controls cap and steer whatever spend is left.
Where a savings number comes from
A savings number is worth something only if it says where it came from. Every time a mechanism saves something, squeezy writes a row to its savings ledger and labels how that number was derived: measured (bytes squeezy watched shrink, or the provider's own usage counters), a deterministic estimate, a counterfactual estimate (what the work that never happened would have cost), or a heuristic. Estimated rows are reported beside measured ones, never folded into them.
The dollar figure carries its own label, because an exactly measured byte saving can still be priced through an estimated token ratio. That makes the ledger evidence about mechanisms, not a reconciliation of your provider invoice.
Three ways to read it: /cost discover reports the session
you are in, squeezy savings reports this project's retained
history from a plain shell, and squeezy savings --export-html
writes the same report as one self-contained HTML file.