TLDRocket
Sign in

A Practical Guide to Reducing Token Spend

adamhjk.com

A dev tool called swamp turned an AI code-review skill into deterministic code instead of running everything through the LLM. Result: 8x fewer tokens and half the runtime on the same review task — a real fix for exploding AI inference bills.

Based on reporting by adamhjk.com — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

David Cramer of Sentry recently wrote about burning through $10,000 a week on AI tokens, pinning much of the blame on a code-review skill called Garfield that leans on a coordinator agent to dispatch dozens of sub-agents. Each one reviews code, reports back, gets adjudicated, then the cycle repeats. It's clever, it's genuinely hard to build, and it's also brutally expensive — every step routes through a non-deterministic model judging the output of other non-deterministic models.

So someone rebuilt Garfield as what they call a "swamp" workflow, keeping the exact same functionality but swapping the coordinator's judgment calls for regular deterministic code. The original skill chewed through 4.5 million tokens, took about 12 minutes, and spun up 23 sub-agents to review a representative problem. The swamp version did the identical job in roughly 500,000 tokens, 6.5 minutes, and just 3 agents. That's an 8x drop in token spend and half the wall-clock time, without giving up any of the review logic.

The trick isn't magic, it's discipline. Swamp stores each sub-agent's output as versioned, typed data, so later steps can see prior work instead of redoing it, and it only calls the LLM where judgment is actually required — leaving the boring, reliable parts of the pipeline (formatting checks, test verification, bookkeeping) to plain code. The write-up frames the whole exercise as a four-step process: understand what the existing skill does, translate it into a swamp extension, black-box test both versions side by side, then refine based on what breaks.

That testing step surfaced something worth noting on its own. When a bug was buried in a complex code diff, the original Garfield skill quietly declared victory and left the defect in place — it failed open. The swamp version, hitting the same budget limit, instead reported that unresolved findings remained. It failed closed. Same underlying constraint, very different behavior, and one of those is clearly the one you want in production.

The bigger argument here is that most agentic workflows today ask the LLM to do work computers have handled reliably for decades — sequencing, aggregation, pass/fail logic — and that's where the token bill actually balloons. Building a lightweight deterministic scaffold around the model, and only calling on it for the parts that genuinely need judgment, is presented as the highest-leverage change available to anyone worried about inference costs right now.

My take — AI-written commentary, not fact-checked reporting

This is the unglamorous fix nobody wants to hear: most of your token bill isn't the AI being smart, it's the AI doing plumbing work a for-loop could handle for free. The industry loves to blame model pricing when the real problem is engineers putting an LLM in the hot path for tasks that never needed one — and Cramer's $10k-a-week story is a symptom of design, not of Anthropic or OpenAI being greedy. Expect more "deterministic scaffolding" tools like this to quietly become the real cost-control layer of agentic AI, way more than any model price cut will be.

Read more about this at: adamhjk.com

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.