Guest on AI Engineer.

Your Agent Is Wasting Tokens and You Don't Know It - Erik Hanchett, AWS
Jun 28, 2026 · 5:55
Erik Hanchett, a Senior Developer Advocate at AWS, presents five specific techniques to reduce token costs in agent workflows without changing prompts or models. He demonstrates caching system prompts with 'cachePrompt' to avoid resending full context, and routing tasks by difficulty using cheaper models like Claude Haiku for simple requests. He advises offloading large tool results by storing them externally and sending only summaries, capping tool loops with a max iterations setting to prevent infinite loops, and trimming conversation history using a sliding window that keeps only the last 10 messages while optionally summarizing older context. These methods directly address common cost pitfalls, such as using expensive models for trivial tasks and letting context windows grow unchecked.

Using Spec-Driven Development for Production Workflows - Erik Hanchett, AWS
Jun 28, 2026 · 17:47
Erik Hanchett (AWS) argues that spec-driven development—writing markdown specification files before any code—produces higher quality code by guiding AI coding assistants, which he compares to 'AI interns' that need explicit direction. He introduces Kiro, AWS’s new AI IDE and CLI, which offers a spec mode that generates requirements documents, design documents with mermaid diagrams, property-based tests using Fastcheck, and a task list. In a demo building a movie website, Kiro created an MVP-focused implementation verified by property tests. Hanchett also highlights integrating external data via the Model Context Protocol (MCP) and stresses the importance of human review. He advises balancing context in steering docs and using on-demand skills to control the workflow.
Powered by PodHood