Polycracker Guides · Token Shred
How to Decrease LLM Token Usage 50–70%
Fifty to seventy percent savings is not a marketing rounding error—it is the consistent band teams achieve when they treat prompts like fuel maps instead of copy-paste dumps. This guide walks through the levers that actually move input tokens, how to calibrate them in The Tuning House, and how to prove the shred with Polydyno before you touch every developer laptop via Polycracker ECU.
Where the waste actually lives
Most enterprise coding agents spend ninety-five percent of tokens on the prompt side: duplicated imports, unchanged sibling files, giant JSON tool schemas, and full chat transcripts. Output is already relatively lean—models answer in hundreds of tokens, not thousands. Decrease strategies that only shorten answers miss the pile of context sitting in front of the model. The Polycracker stack attacks structural redundancy with deterministic AST passes so semantics stay intact while byte weight drops.
Before changing anything, measure input vs output separately using the process in how to test LLM token usage. If input share is below seventy percent, fix thrash and retry loops first (agent thrashing guide); otherwise AST and MCP tuning deliver the biggest ROI.
The four levers that compound
AST surgical pruning. Strip boilerplate nodes—docstrings you already ingested, generated protobuf stubs, repeated type imports—while preserving identifiers the model must edit. Scope bounding. Send the minimal spanning AST for the task, not the whole package. History compression. Summarize or drop stale turns instead of replaying full diffs. Tool diet. Mount only MCP tools required for the workflow; oversized schemas are silent budget killers (see fix LLM bloat).
Each lever alone might yield fifteen to twenty-five percent. Stack them under a signed tune.jwt from
The Tuning House and you land in the fifty to seventy percent band repeatedly across
repos, not just on demo day.
Worked shred: monorepo service edit
A team refactors payment validation across a twelve-thousand-line Node service. Stock Cursor-style context pulls three adjacent modules, lockfiles, and test fixtures. Below is a simplified before/after token ledger for a single model call (not the whole session).
| Payload segment | Stock tokens | Tuned tokens | Savings |
|---|---|---|---|
| Primary file AST | 2,400 | 2,400 | 0% |
| Sibling modules (unreferenced) | 6,800 | 0 | −100% |
| Import / type boilerplate | 1,950 | 420 | −78% |
| Chat history (turns 1–4) | 4,600 | 1,100 | −76% |
| MCP tool schemas | 3,200 | 890 | −72% |
| Total prompt | 18,950 | 5,810 | −69% |
Completion tokens barely move: 468 stock vs 451 tuned. The model still writes the same patch; it simply is not forced to re-read irrelevant modules. That is the definition of lossless shred.
// Before (excerpt sent to model — 1,950 tokens of imports/types)
import { z } from "zod";
import type { UUID } from "crypto";
import { legacyValidate } from "../legacy/validate";
// ... 40 more lines unchanged ...
// After ECU prune (420 tokens — identifiers preserved)
import { z } from "zod";
import { legacyValidate } from "../legacy/validate";
// [pruned: 31 type-only imports, 2 unused re-exports]
Calibrating in The Tuning House
Open The Tuning House and treat the eight Master AST tables like fuel maps. Start
conservative: enable import pruning and dead-node stripping, leave comment retention high until Polydyno invariants pass.
Use micro-dials to tighten history depth and maximum sibling file fan-out. Each publish mints an Ed25519-signed
tune.jwt your ECU instances trust.
Roll out in rings: staff engineers on Stage 2, whole team on Stage 3 after a week of green CI gates. Never skip rings—a too-aggressive map saves tokens by deleting context the model needed, which shows up as retry thrash and hidden spend.
Deploying Polycracker ECU locally
Polycracker ECU sits between your IDE and the frontier API. In MCP mode it rewrites outgoing
context; in proxy mode it listens on 127.0.0.1:8000 and transparently prunes JSON bodies. Developers keep their
workflow; finance sees immediate input reduction on the same tasks measured in your baseline harness.
ECU loads the signed map from The Tuning House, applies deterministic AST knock guardrails, and rehydrates responses so the IDE still displays full sources locally. The model never sees the bloat; your git checkout stays pristine.
Monthly savings model (team of forty)
Multiply per-task shred by real throughput. Assume forty engineers, each completing six agent-assisted tasks daily, twenty-two working days per month, blended input cost $2.50/MTok.
| Scenario | Input tokens / month | Est. input cost |
|---|---|---|
| Stock (18.4k input/task) | 97.5M | $243,750 |
| Tuned −50% | 48.7M | $121,875 |
| Tuned −68% (typical ECU map) | 31.2M | $78,000 |
| Tuned −70% (cap) | 29.3M | $73,250 |
Even if your per-token price differs, the delta between rows is what you take to the CFO. Pair the table with Polydyno invariant reports so engineering and finance sign the same PDF.
Verification loop you can ship this week
- Pick three Polydyno profiles matching your top languages.
- Capture stock prompt tokens per profile; store artifacts in git.
- Draft a Stage 1 map in The Tuning House; deploy to one ECU canary seat.
- Re-run profiles; require ≥30% input drop and 100% invariants before widening.
- Iterate micro-dials until median shred ≥50% without output regression.
- Promote JWT to org-wide ECU installs; schedule weekly Polydyno drift checks.
Need help on enterprise rollout or compliance review? Use the intake on Polycracker ECU sales.
What not to do
Do not truncate files mid-AST to “save tokens”—that breaks identifiers and causes expensive retries. Do not ban MCP outright; trim schemas and lazy-load tools per task. Do not declare victory on a single cherry-picked PR; publish median shred across profiles. Do not chase seventy percent on greenfield repos and assume the same map works on a ten-year-old monolith without retuning.
Sustainable savings feel boring: signed maps, local ECU enforcement, open benchmarks anyone can re-run. That boredom is what keeps spend down quarter after quarter.
Language-specific tuning notes
TypeScript and Java reward aggressive import pruning; run Polydyno tests that verify re-export paths still resolve. Python benefits from stub trimming in generated protobuf trees but needs docstring retention on public APIs until invariants cover behavior. Go packages punish overzealous sibling file removal—use scope bounding tied to module graph, not directory proximity alone. Rust macros can explode token counts if you paste expanded sources; let ECU send macro call sites, not expansions, unless the task explicitly edits macro output. Calibrate separate JWT profiles per language family instead of forcing one global map.
Negotiating vendor contracts with shred evidence
Once you sustain fifty to sixty percent input reduction, renegotiate prepay commits with evidence packs: harness definitions, Polydyno PDFs, and ninety-day billed usage curves. Vendors discount committed spend more readily when you show durable efficiency gains rather than temporary model downgrades. Keep a control profile that runs stock payloads quarterly so nobody claims the savings vanished because someone disabled ECU on a holiday weekend.
Security and IP side benefits
Shrinking prompts is not only a cost play. Every token you never send is a secret that never leaves your building: fewer pasted credentials in chat, fewer internal URLs in tool results, fewer legacy modules exposed to frontier hosts. Document that dual benefit for security reviewers who gate MCP rollouts—AST shred plus ECU proxy often clears data residency concerns faster than policy PDFs alone.