Hanchett recommends caching the system prompt so later agent calls send less prompt text. He uses AWS Strands Agents as an example and says tool prompts and messages can also be cached.
Your Agent Is Wasting Tokens and You Don't Know It
Speaker
Erik Hanchett, a senior developer advocate at AWS, explains five ways to reduce token costs while using and building agents at an AI Engineer talk.
Use a more capable model for difficult tasks and a cheaper one for simpler tasks. Hanchett gives Claude Haiku and Claude Sonnet as examples, and suggests routing with an if statement or a low-cost model.
Large tool results can be stored locally or in the cloud, then summarized before being used again. This avoids adding the full result to the agent context every time the tool or agent loop runs.
Set a maximum number of tool iterations because an agent may repeat calls 10 or 20 times or enter an infinite loop. Observability tools can show tool usage, duration, and loop counts to help identify inefficient calls.
Long conversations can send the full history to the model on every call, using hundreds or thousands of tokens. Strands Agents offers a sliding window conversation manager; Hanchett describes keeping the last 10 messages and summarizing earlier history to preserve useful context.
Takeaways
- Cache stable system prompts and other repeated prompt content.
- Choose models based on task difficulty instead of using an expensive model for every task.
- Store and summarize large tool results so they are not repeatedly sent into the agent context.
- Set a maximum number of tool iterations and use observability to spot excessive calls.
- Keep a bounded conversation window and summarize older messages when long-term context matters.
Mentioned in this talk
Search inside this talk
What was claimed 6
- role atErik Hanchett is senior developer advocate at
AWS
“I’m a senior developer advocate at AWS”
YouTube Verified2 sources· Talk
- feature
Strands Agents: Supports caching prompts and messages
“You can also cache tool prompts and messages.”
YouTube Unverified1 source· Talk
- uses
“I’m using AWS Strands Agents”
YouTube Unverified1 source· Talk
- feature
Strands Agents: Offers APIs for offloading tool results
“Strands Agents also offers additional APIs for this.”
YouTube Unverified1 source· Talk
- featureSliding window conversation manager: Sends the last 10 messages
“It looks back at the last 10 messages and sends only those.”
YouTube Unverified1 source· Talk
- feature
Strands Agents: Sliding window conversation manager
“there’s something called the sliding window conversation manager”
YouTube Unverified1 source· Talk










