How to reduce LLM agent cost when the agent repeats the same task
Most agent bills are the same task, paid again every day. Record the run once, compile the repeated steps to code, and replay with a model only where a choice is needed. These are the numbers we measured and the limits.
Where the money goes
An agent that writes the same morning brief, reconciles the same bank lines or triages the same tickets does the same work each day. Each run pays for every model turn, including the turns that only repeat known steps.
What we measured
On Claude, for the morning-brief task with 10 runs each, the Sonnet agent cost $0.0179 a run and the Haiku replay on new data cost $0.0006. Across two tasks, a replay costs about 30 to 65 times less than the agent (Haiku replay against a Sonnet agent, 10 runs each). Synthetic data.
Speed moves too: about 2.5 times faster on new data, where the model call is most of the time. On repeated data it is up to 8 times faster. Two tasks, Claude, 10 runs each.
What it costs at volume (estimate)
We recomputed the monthly bill from those per-run costs for 1,000 runs a day, 30,000 runs a month. This is an estimate, not a measurement at that volume.
- Sonnet agent every run: about $537 a month.
- Haiku replay, no fallbacks: about $18 a month.
- Haiku replay, one run in ten falls back: about $71 a month.
The fallback rate is the number that moves the bill. A run that falls back to the agent costs about 33 times a finished replay.
Cheaper models for the replay, not for the recording
A replay can run on a small model. On a local 1.7B model on a 6 GB RTX 2060, 20 of 20 replays on new data were correct for each of two tasks, at 0.4 to 1.6 seconds of model time. That replay costs no API money, but the hardware is not free. Recording is the weak point: a free 1.7B model doing everything passed 54% of 99 runs, and 87% where the recording was good. Record with a capable agent.
What it does not do
- A task you have not repeated is still paid for by the agent. Record it two or three times on different days first.
- A replay is only as good as its recording. A wrong recording is replayed wrong every time.
- Opus was not measured. The Opus line in our cost table is an estimate from list prices.
- Healthcare and clinical tasks: no numbers, no claim.
Try it on your own task
Run npx @hotpathrun/cli demo in an empty folder. It records the demo agent three times, learns the path and replays it on new data. The CLI sends run summaries only (workflow names, step counts, time, cost, model calls, fallbacks), never prompts or results. HOTPATH_NO_SYNC=1 turns that off. The code is Apache-2.0.
Full numbers, each with its caveat: the repository's claims file. Failed runs are published too: how we measure.
Try it on your own task.
The CLI is free with an account. No card. Run npx @hotpathrun/cli demo in an empty folder.