I changed one sentence in my AI agent's system prompt. Costs dropped 75%. Quality stayed the same.
The Before
System prompt: "Search the web and write a summary"
Results: 14 average tool calls, $0.12 average cost, 45 seconds average duration, Grade A quality.
The After
System prompt: "Search the web and write a summary. Keep tool calls under 10. Never retry a search with the same query."
Results: 6 average tool calls (-57%), $0.03 average cost (-75%), 18 seconds average duration (-60%), Grade A quality (unchanged).
Why This Works
The model was doing exactly what we told it to. We said "search and write." It searched. And searched again. And again with slightly different words.
We never told it to stop searching and start writing. The model isn't wasteful. The prompt was incomplete โ it needed an exit condition.
3 More Patterns That Cut Costs
Pattern 1: "Every URL must come from a search result"
This eliminates URL hallucination. Without it, the agent makes up plausible-looking URLs that are dead links. With it, every URL in the output comes from actual search results. Bonus: this also prevents the agent from searching again to "verify" hallucinated URLs.
Pattern 2: "If a tool fails, skip it and use available data"
This is the biggest cost saver. When web_fetch or browser fails on a site (Reddit, LinkedIn, Craigslist all block automated access), the agent retries with different approaches. Each retry costs tokens. With this instruction, it fails once and moves on โ and the result is usually just as good because the search snippet already contained enough info.
Pattern 3: "Return FINAL result only โ no plans or progress"
OpenClaw's /v1/chat/completions API returns the first response. If that response is a plan ("I'll first search for X, then look up Y..."), you get the plan instead of the work. This instruction forces the agent to complete everything before responding.
The Math
At 20 runs per day: Before = $2.40/day ($72/month). After = $0.60/day ($18/month). Savings: $54/month from one prompt change.
See Your Own Costs
Curious what your agent is spending? Drop your session transcript into our trace analyzer:
You'll get per-step token counts, cost attribution per tool call, and a cumulative cost sparkline showing exactly where your money goes.