# Stop Making Your AI Carry the Data. Let It Write the Program.

> Source: <https://ainexusdaily.vercel.app/article/2026-11-20-stop-making-your-ai-carry-the-data-let-it-write-the-program>
> Published: 2026-11-20 14:51:29+00:00

**Recommendation:** Move multi-step tool work into a code execution environment with only 3–5 definitions loaded on demand, and gate batched writes behind dry-runs, count caps, per-action allowlists and read-back samples.
More in the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

# Stop Making Your AI Carry the Data. Let It Write the Program.

TL;DR: Your agent pays two taxes you never itemised. The definition tax: every tool definition sits in its context permanently — one vendor example burns about 55K tokens on 58 tools before the conversation even starts, and the bigger the toolbox, the worse the model gets at picking the right tool.

The transport tax: every intermediate result is carried through the model, so a two-hour transcript gets copied by the most expensive typist you own, and copied wrong. The fix, reached independently last autumn by Anthropic and Cloudflare, is to stop treating tools as buttons the model presses one at a time, and start treating them as a code API the model programs: load only the 3–5 definitions a task actually needs, run the loops, filters and joins in an execution environment, and let only the final answer come back. But a program that can do fifty steps before anyone looks can also do fifty wrong steps. So the rule that completes the idea is asymmetric: reads may batch.

Writes may not. The button model fails in a specific, measurable way. Vendor-reported figures — internal tests, not independent measurement, and I am labelling them as such — put a traditional tool setup at roughly 77K tokens of definitions, cut to about 8.7K when definitions are loaded on demand, with tool-selection accuracy on a large library rising from 49% to 74% on one model generation. Treat the magnitudes with suspicion; vendors grade their own homework, and the one independent benchmark I could find was narrow — one model, one server, two task types — and it charged a price the brochures omit: output tokens up 120%, because writing code costs words, and latency up 7%.

But the direction has three independent implementations behind it, and the mechanism is not mysterious. Ten thousand rows of a spreadsheet do not need to be read by a reasoner. They need to be filtered where they sit, by a program, and reduced to the five rows that matter. Your context window is the most expensive memory in the building.

Stop using it as a loading dock. Waiting for the next model will not fix this, because the bottleneck is not intelligence. It is plumbing. Cloudflare's explanation — offered as a hypothesis, not a measurement, and I am keeping it labelled that way — is that tool calls are a synthetic syntax models barely saw in training, while code is their native language, learned from millions of real projects.

Whether or not that story is the true cause, the vendors' own "when not to use it" lists are the most honest part of the whole literature, and I follow them as law: programmatic calling wins on three-or-more dependent steps, on large results that only need an aggregate, on loops and parallel work. It loses on one- or two-step calls, and on chains where the model must actually read each intermediate result to judge the next move. Judgement cannot be filtered. Only freight can.

Here is the cost none of the vendors count. When a model calls tools one by one, every step and every result is on the record, readable, auditable. When a script does fifty steps inside an execution environment, the middle disappears. You get the program and the output — and if the program was wrong, you get a wrong answer with no visible path to how it got there.

Efficiency deleted the audit trail. So in my own fleet, a programmatic sweep does not get to report just its conclusion. It reports three things: the aggregate result, a pair of counts — how many records went in, how many came out — and a pointer to a sample of the raw records, so what never entered the model can still be checked. And the write side is stricter.

A script can send two hundred wrong emails before a human sees the first one, so any batch of writes in my operation runs dry-run first, under a count cap, against a per-action allowlist enforced in code, with an independent read-back sample afterwards. Approvals for payments and outbound messages stay per-item, exactly as before. Batching merges the reading. It never dilutes the signing.

One more correction, because the internet is already getting this wrong. Claude Code's new Code Mode, launched November 12, is routinely credited with a "37% saving." That number belongs to a different, API-layer feature from a year earlier. The Code Mode documentation contains no savings figure at all — I read it — and it confines the feature to interactive terminal sessions, which means it does not cover headless, scheduled fleets like mine at all. Its safety note deserves more attention than its marketing: the automatic reviewer reads the script, not the values the script computes at runtime.

On my own machine there is not even a Claude CLI binary to test it with. So my verdict is unfashionable and final: adopt the discipline everywhere, adopt the branded switch almost nowhere — and measure on your own workloads, because nobody else's numbers are your numbers. Stop paying your smartest employee to carry boxes. Let it write the program — and keep the keys to the loading dock yourself.

— Jiahui Miao, founder of vertciti, building a personal AI operating system for one.

## Key Takeaways

- •The fix, reached independently last autumn by Anthropic and Cloudflare, is to stop treating tools as buttons the model presses one at a time, and start treating them as a code API the model programs: load only the 3–5 definitions a task actually needs, run the loops, filters and joins in an execution environment, and let only the final answer come back.
- •This story was reported by **Dev.to** , covering developments in the**dev** space.
- •AI advancements continue to reshape industries — read the full article on Dev.to for complete coverage.

📖 Continue reading the full article:

[Read Full Article on Dev.to →](https://dev.to/jiahui-miao/stop-making-your-ai-carry-the-data-let-it-write-the-program-2h96)
