Code Beats Prompts: Cutting the Agent-Orchestration Overhead

We recently worked with a customer who wanted to optimize the cost of an automation they were running. It searched for new prospects, found the people to contact at each company, and drafted an email for each one. Running it cost a few dollars a day, which was too much for one automation.

The cost breakdown

When we analyzed the cost breakdown, Script.it's in-product cost meter split the spend like this (per year, at one run a day):

  • Agent (Claude Sonnet) — re-reads the instructions and orchestrates the run; ~40 calls re-reading ~870k tokens of brief + block output — ~$347/yr (~$0.95/run)
  • Web search — ~167 discovery searches per run, a fraction of a cent each, via the Script.it built-in search integration — ~$182/yr (~$0.50/run)
  • Email drafting (an OpenAI model) — the script's own LLM work, one personalized draft per contact — ~$37/yr (~$0.10/run)
  • Total — ~$566/yr (~$1.55/run)

The agent was ~61% of the bill — pure overhead for re-deciding a script whose steps never change. The rest is genuine work: ~167 discovery searches and one personalized draft per contact.

Root cause: an agent was doing a script's job

The steps were already known and fixed — four blocks that run in order. In Script.it, the whole workflow is just this script:

The daily-outreach script in Script.it — four executable blocks (Find Prospects, Find Contacts, Write Emails, then Save Drafts) that run in a fixed order as code

Instead of running that code directly, an AI agent worked out the whole run from scratch every morning — ~40 model calls in a single run. Over 99% of the agent's tokens go to re-reading: every step re-sends the system prompt, tool definitions, the goal, and all prior output. That re-reading is the ~$347 a year (~$0.95/run, ~61% of the bill) — paid daily to re-derive work the script's code already does.

The fix: remove the agent from the loop when it is not needed

Stop having an agent run it — run the code directly. On the same schedule, the script's four blocks now execute in order as deterministic code: same steps, same output, no agent in the loop.

The result: the same automation, ~61% cheaper to run

From Script.it's in-product cost meter, per year (at one run a day):

  • Agent orchestration: ~$347/yr → $0 — the whole layer, gone
  • Web search: ~$182/yr → ~$182/yr — unchanged (real work)
  • Email drafting: ~$37/yr → ~$37/yr — unchanged (real work)
  • Total: ~$566/yr → ~$219/yr~61% cheaper (~$1.55 → ~$0.60 per run), with identical output

Before and after the change: yearly cost drops from ~$566 to ~$219 as the agent-orchestration layer is removed

Nothing re-reasons the run anymore; the schedule executes the script's blocks directly as code. What remains is the real work — the prospect searches and one draft per contact — which costs the same whether code or an agent triggers it. That's the floor; the avoidable overhead is gone.

What if there were no code at all?

The fix removed the agent overhead — but how big does that overhead get? We measured a third architecture on the same task: a pure prompt with no script, where the agent is handed only the business goal and re-derives the whole workflow from scratch every run — search, planning, and drafting included. One representative run, metered end-to-end on Claude Sonnet:

Yearly cost across three architectures — prompt only ~$3,624 with ~95% agent overhead, script via agent ~$566, script as code ~$219

  • prompt only — no script; the agent improvises the entire workflow every run. Measured ~$9.93 / run (~$3,624/yr), of which ~95% is pure orchestration overhead — roughly 1.7M tokens of reading and reasoning to re-derive a process that never changes.
  • script, via agent — the customer's before: an agent re-runs the script's steps every morning. ~$1.55 / run (~$566/yr).
  • script, as code — the customer's after: the script's blocks run directly, with no agent. ~$0.60 / run (~$219/yr).

The shape holds at every scale: the real work — search + drafting — barely moves; the agent-orchestration layer is the entire variable. Removing it took this customer from ~$566 to ~$219 a year (~61%). Never paying it at all is the gap between ~$219 and ~$3,624 — roughly 16×.

Why Script.it is built for this

Script.it runs your automation as code, not as a prompt. The agent builds the script once — instructions plus the blocks that do the work — and the schedule runs those blocks directly, so the agent-orchestration overhead, ~61% of every run, simply disappears.

In agent-first tools — Claude, Manus, ChatGPT tasks, and similar — a "scheduled automation" is fundamentally a prompt that re-runs an agent on every fire. You pay full reasoning costs every single time, even when the task is the same deterministic steps day after day.

Script.it inverts this. The agent's job is to build the script once — to write its blocks. The schedule then runs that code directly, with no agent in the loop. You pay an LLM only for the genuinely fuzzy steps inside the script (e.g., writing a personalized email), and even those run on the cheapest capable model:

  • What runs the steps — Run by an agent: a full reasoning model, re-invoked on every fire. Run as code: the script's blocks, executed directly.
  • Who decides the steps — Run by an agent: re-reasoned from scratch every run. Run as code: fixed when the script was built, decided once.
  • LLM cost per run — Run by an agent: full model reasoning, every time. Run as code: only the steps that truly need an LLM.
  • Repeatability — Run by an agent: can drift between runs. Run as code: identical, auditable every run.
  • Orchestration cost — Run by an agent: paid in full, every run. Run as code: eliminated — $0.

The point of the platform: an agent is the best way to build and change an automation — but the cheapest, most reliable way to run it every day is plain code.

Playbook

  • Use an agent to build, edit, and debug a script.
  • Run it as code on a schedule — don't keep an agent in the loop just to fire fixed steps.
  • Keep in-script LLM calls minimal and on the cheapest capable model.
  • Reserve agent-in-the-loop only for steps that genuinely need new reasoning each run.