Most teams trying to make AI agents cheaper reach for a smaller model. Vivek Haldar took the opposite path and got a 94 percent cut in token usage and an 87 percent drop in latency while keeping the exact same model for the steps that actually need it. The trick was not a better engine. It was admitting that most of his agent's daily work had quietly stopped being a reasoning problem and become a fixed routine.

Haldar described the experiment in a July 13 write-up about a personal automation he runs every day. The agent scans his backlog of blog posts, finds one worth resurfacing, checks whether he has mentioned it recently, and drafts a short LinkedIn post linking back to it. The first version was written entirely as natural-language instructions inside an Agent Skill. That was the right call for version one: plain language made the workflow easy to describe and easy to change as he figured out what he actually wanted.

The workflow hardened into a shape

After the skill ran daily for a while, its behavior stopped being exploratory. It always looked in the same places, built the same content inventory, applied the same filters, and saved the same intermediate state. None of that needs a language model to rediscover it every single morning. Haldar realized only two steps genuinely needed an LLM: choosing a good candidate from the filtered list, and writing the draft. Everything else was deterministic plumbing.

So he 'compiled' the skill. The new version is barely a skill at all. It became a thin bootloader that calls a Python program. That program fetches the known sources, builds the inventory, checks recent posts, applies the filters, and manages state. The LLM is invoked only for selection and generation. The savings came entirely from deleting model calls that were doing work ordinary code could do more directly.

Why 'compiling' is the right metaphor

The method deserves attention because it is repeatable, not because it is clever. Haldar already had historical traces from past runs: the actual tool calls, branches, and state the agent touched. He handed those traces, the original skill, and his own notes to a powerful model and asked it to mark which steps truly required an LLM and which had become stable enough to express as code. The natural-language skill acted as a high-level specification. The traces supplied the operational detail that reasoning had already produced.

This mirrors a compiler lowering flexible, high-level intent into a more efficient representation once its real shape is known. You start fluid, run the workflow until it crystallizes, then push the stable parts down into code. The one-time cost of that compilation pass is paid once and amortized across hundreds or thousands of future runs. That is standard optimization economics, not a research breakthrough.

The incentive problem nobody talks about

Haldar makes a sharper point that most efficiency posts skip. The big model vendors earn revenue when tokens flow, especially from their most powerful and expensive models. A technique that preserves output quality while cutting token consumption by 94 percent runs against the grain of a business built on volume. He is not claiming vendors ignore efficiency. Cheaper inference and better caching clearly help them. But there is a difference between making each token cheaper and helping a customer discover that most of their workflow never needed tokens in the first place.

That gap is the opening. Independent builders, not the vendors, have the incentive to inspect recurring agent workflows and move the deterministic parts into code. The value proposition is unusually concrete: same output, far lower cost and latency. For a founder shipping agents into production, that is the difference between a workflow that scales economically and one whose bills never settle down.

What this means

For anyone running agents in production, the takeaway is a discipline, not a tool. Treat your first natural-language agent as a probe. Run it, collect traces, and watch which steps never change. Those steps are candidates for compilation into ordinary code, with the model reserved for the few points where semantic judgment matters. Starting in code from day one is premature because you do not yet know the workflow. Staying in natural language forever means paying the model to re-plan the same routine on every run.

The strategic angle is bigger than one developer's LinkedIn bot. As agent fleets grow inside companies, the dominant cost will not be the model itself but the repeated re-reasoning over workflows that have already been solved. A new category of tooling is forming around 'agent compilation': observability that captures traces, analyzers that flag deterministic steps, and harness generators that emit code. Whoever owns that layer captures value the model vendors are structurally unlikely to chase.

There is also a reliability dividend. Deterministic code does not hallucinate, does not drift between runs, and does not need a prompt tweak to behave. Compiling the stable 90 percent of an agent's work makes the remaining 10 percent, the part that actually uses intelligence, easier to test and trust. In a year where token budgets are becoming line items, the teams that learn to compile their agents will simply out-survive the ones still paying a frontier model to be a very expensive state machine.

Sources