A smaller agent bill is not enough reason to ship a bundle of cost optimizations. If you filter tool results, compact history and reduce reasoning effort in the same change, a cheaper run leaves an important question unanswered: which change helped, and which one removed information the agent needed?
Default to testing one major change at a time, then evaluate the combined configuration before rollout. The first part follows Mia Maren’s “How to Reduce AI Agent Token Costs in Production” (August 5, 2026), which recommends replaying the same evaluation set after each major change. Testing the combination afterward is an experiment-design recommendation here—not a reported result from the article.
Establish what counts as success first
Use a workload-specific baseline. A coding agent and a support agent should not share one global baseline, even if they use the same model route.
The article’s primary metric is:
cost per successful task = total workflow cost / accepted tasks
That denominator matters. Include unsuccessful runs in total workflow cost rather than comparing only the cheapest successful traces. Track human-review time alongside the ratio: lower model spend can still leave more work for a person.
For a controlled comparison, I would fix the task set, acceptance rubric, model route and unrelated settings before changing the selected control. This is a way to make results easier to attribute, not a claim that replay removes model variability or establishes statistical significance. Choose quality and rollback criteria for the actual workload in advance; the source does not supply universal pass thresholds.
Pick the intervention from the trace
The source offers several starting points. Treat them as competing experiments, not a checklist to deploy all at once.
| Observed signal | First change to evaluate | Regression to watch for |
|---|---|---|
| Tool results dominate later prompts | Select required fields structurally before adding results to context | Missing records or evidence needed for the next decision |
| Accumulated history is repeatedly processed | Compact operational state | Lost source IDs, decisions, failed approaches or unresolved constraints |
| Retry and repair costs dominate | Target the largest failure category with a bounded retry policy | Lower completion or more escalations despite fewer attempts |
| Routine steps have high reasoning cost | Reduce effort on those steps, where supported | Lower accepted-task rate |
| Workers receive overlapping history | Narrow each worker’s task and context slice | Missing evidence in returned findings |
| Reusable input sees little caching | Stabilize the reusable prefix | No net cost benefit after applicable caching charges |
The signal-to-intervention choices come from the article; the regression column translates its quality cautions into checks for a trial. None guarantees savings. In particular, retry controls should address the cause of failure, not simply replay the same context, and narrower context still needs enough evidence to complete the task.
Compare the whole run, not just the final prompt
Replay the same evaluation set and retain the baseline beside the changed version. The article recommends comparing:
- Task acceptance rate and cost per successful task.
- Cumulative input and tool-call count.
- Retry tax: retry and repair cost divided by total workflow cost.
- Reasoning share: reasoning-token cost divided by total model cost.
- p50 and p95 latency, plus human-review time.
Consider a compaction trial. A shorter prompt is the intended effect, but it is not the acceptance test. Inspect whether the compacted state retains the user goal, success criteria, verified facts and source IDs, changed records, failed approaches, open questions, next action and safety constraints. Then look for repeated searches or tool calls that rebuild discarded state. Those repetitions are a reason to investigate the trace, not proof of the cause on their own.
Roll back a change that saves tokens by removing necessary evidence or reducing task quality. A lower accepted-task rate or increased human correction should not be hidden behind the token reduction; judge them against the workload’s predeclared criteria.
Keep token savings separate from price savings
The article’s 12-step example reports 26.5% fewer processed input tokens after compaction alongside prefix caching. It explicitly labels this a hypothetical planning calculation, not a provider benchmark. It does not establish preserved task quality or forecast your savings.
Caching and compaction also answer different questions. Caching can lower the effective price of repeated input without reducing the amount of context processed. Compaction reduces the input itself. Record cached and uncached usage separately so a cheaper token mix is not mistaken for less context amplification.
My rollout rule would be: keep an isolated change only when its workload-specific quality checks pass and its full-run economics justify it; then replay the intended combination before shipping. Individually acceptable changes can still interact. Isolation makes the comparison more interpretable, while the final combined test checks the configuration users will actually receive.