Engineering

Stop wasting tokens. Start with these four checks.

A per-turn checklist for AI agents: inspect the system prompt, trim tool output, verify caching, and choose a model that fits the job.

A per-turn token checklist: system prompt, tool output, caching, and model choice.SYSTEM PROMPTTOOL OUTPUTCACHINGMODEL CHOICE

You’re probably wasting money on tokens right now. The place I’d start is what your agent reads on each turn: the instructions, the tool results, and the conversation carried forward. Here’s the checklist I run through whenever I’m building an agentic system.

Open an expensive turn

By a turn, I mean the work from a user’s message to the agent’s answer. That can involve several model calls and tool results. Open the trace, the record of those steps, and inspect the input sent to each model call. The final answer alone won’t show you what it cost to get there.

Keep the broader operating budget in view, but use this checklist to find avoidable token spend inside the turn. Work through system prompt, tool output, caching, and model choice in that order. Keep a representative set of turns and their expected results so you can compare each change.

For the wider budget, including review and failed attempts, read The real cost of running an AI agent.

System prompt: am I stuffing too much in it?

Read the assembled input the model actually receives. The prompt file in your repository may be only part of it: your application can add instructions, examples, reference material, and tool definitions before sending the request.

Ask what each part is doing for this task. A classifier needs the categories, decision rules, and examples that help it distinguish them. It probably doesn’t need the instructions for writing a report or every tool available elsewhere in the product. Move task-specific material to the task that uses it; remove stale and duplicated instructions.

Don’t make the prompt shorter by removing the rule that prevents a wrong answer. Keep the output requirements, permission boundaries, and instructions for missing information. Check whether the edited version still makes the right decisions. Clearer instructions can be worth more than a smaller word count.

Source: Anthropic, advanced tool use. November 24, 2025; reread October 9, 2026. Tool definitions are input too; load the relevant tools for the task.

Tool output: what are my tools sending back?

Tools can send back a bloated response that eats up tokens just to interpret it. Open the exact text passed to the model, including the fields hidden when your interface displays a neat summary.

Consider a support-ticket classifier. This is a hypothetical example: the tool returns the customer’s message and ticket status, then repeats the whole ticket inside a raw-data field. It also includes avatar URLs and display settings. The application may need some of that information; the classifier doesn’t need a duplicate copy of the ticket.

Give the model a view of the response that fits its job. Preserve the message, status, timestamps, source reference, and any uncertainty that affects classification. Remove the duplicate and irrelevant display fields. If a field can vary, don’t silently replace it with a shared default.

The Thesis Finance cost investigation dated July 25, 2026 records an offline replay of 11 captured options turns using the founder’s own harness: $2.09 → $0.90 per turn after tool-payload and caching changes. A live production before-and-after was not recorded. That result supports investigating these levers; it isn’t a savings forecast for another agent.

Source: Anthropic, writing effective tools. September 11, 2025; reread October 9, 2026. Return relevant context and evaluate the result.

Source: Thesis Finance replay evidence. Olypsis proof inventory, K05–K07, compiled September 1, 2026; offline replay dated July 25, 2026.

Figure 01Tool output / hypothetical

Send the fields the decision needs.

The model’s jobClassify a support ticket.
01 / Tool returnsFull record
Message“I was charged twice.”
Status · timeOpen · Oct 9, 10:42
SourceTicket #104
UncertaintyPayment not verified
Duplicate raw ticketAvatar URLDisplay settings
02 / Model receivesRelevant context
Message“I was charged twice.”
Status · timeOpen · Oct 9, 10:42
SourceTicket #104
UncertaintyPayment not verified
The evidence and uncertainty travel with the message.
Needed for the decisionKept in the application only

Re-run the same tickets. Check that classification still holds up.

A hypothetical support-ticket classifier. Keep the full application record intact; tailor only what reaches the model. No measured size reduction is implied.

Caching: am I actually getting reuse?

Make sure you have caching locked down. Caching lets you avoid “paying full freight” for tokens already ingested. More precisely, prompt caching can reuse an eligible, unchanged prefix of the input: the material at the beginning that stays identical between requests. The model still generates a new answer.

For Claude, put stable material before changing material. A timestamp inserted ahead of otherwise identical instructions can break reuse. Moving it later helps only if the eligible stable prefix was actually written to cache. Minimum input lengths and cache lifetimes also apply; check the rules for your model and provider.

Then read the usage returned by the API. Claude exposes cache_read_input_tokens for reads and cache_creation_input_tokens for writes. Inspect successive calls inside the tool loop as well as across user messages. A cached system prompt doesn’t prove the growing conversation is being reused.

Keep cache reads, writes, uncached input, and output separate when checking cost. Prompt caching doesn’t store a finished answer for replay, and it doesn’t eliminate the cost of new output.

Source: Anthropic, prompt caching. Documentation checked October 9, 2026. Eligibility, prefix matching, cache writes and reads, and usage fields are provider-specific.

Figure 02Prompt caching / schematic

Reuse the beginning of each request.

Stable prefixChanging input
Request 01Write eligible prefix to cache
Instructions
Tool definitions
Task inputTicket A
Identical prefix · still eligible
New ticket below
Request 02Read the prefix from cache
Instructions
Tool definitions
New task inputTicket B
Reuse this inputProcess this input
Verify in the API response
cache_read_input_tokensConfirm a cache read

Each request still generates a new answer.

Eligible, identical input can be read from cache. A changed prefix, expired entry, or unmet model minimum can prevent reuse. New output is still generated and billed. Anthropic prompt-caching documentation, checked October 9, 2026.

Model choice: is it more than the job needs?

You don’t need the latest and greatest model for your simple classification task. If the job is assigning a ticket to a known category, test a less expensive candidate on the same examples and decision rules before making a frontier model the default.

Look at the wrong classifications and the ambiguous tickets, not just the easy ones. Check whether the candidate follows the required format, knows when to flag uncertainty, and needs more attempts to finish. Lower token rates don’t guarantee a cheaper turn if the model generates more text or takes more tool steps.

Don’t sleep on open source either. Include suitable open-source or open-weight models in the comparison, while checking the actual license and deployment requirements. If you self-host, count serving capacity, operations, and maintenance; if you use a hosted endpoint, count its charges. Available weights don’t make inference free.

Choose the model that meets the quality bar for this part of the workflow. A stronger model may still earn its place on a difficult judgment even when a simpler step can run elsewhere.

Source: Anthropic, cost and intelligence. Documentation checked October 9, 2026. Compare model behavior and cost on the actual workload.

Run the checklist on a real turn

Pick an expensive turn and write down what you find: instructions it didn’t need, fields it didn’t use, input it could reuse, and a model choice worth testing. Change a lever, compare the same cases, and keep the failures visible. A lower bill is useful when the result still does the job.

The age of token maxing is over. We’re now in the age of token optimization. Start by looking at what you’re asking the model to read.

Have a workflow in mind?

Tell us what you want to improve. We’ll help you work out where to start.

Book a call