Token Management and Minimization

Learn to understand and reduce AI token usage.

Every interaction with an LLM costs tokens, money, and time. This workshop teaches practical techniques to manage those costs without sacrificing quality.
Half day (3 hours)
ansible ai
ansible claude
Developers who already use AI coding agents or LLM-based tools
Understand how tokens drive cost, latency, and context limits, and learn practical techniques to minimize token usage.
In-classroom or virtual. A short, focused, hands-on workshop
Need this for your dev team?

Outline

This is a short, focused workshop on understanding and minimizing token usage when working with LLMs and AI coding agents.

Agent

This workshop is taught with Claude Code and Claude CLI by default. But it can be taught with any programming language, development environment and agentic agents.

Prerequisites

Participants need to have basic experience prompting an LLM or coding agent.

Topics

  • What tokens are, and how tokenizers work (subwords, whitespace, code vs. natural language)
  • Why tokens matter: cost, latency, and context window limits
  • Where token usage comes from: prompts, system instructions, file contents, tool output, conversation history
  • Recognizing and diagnosing token bloat in a real session
  • Minimizing prompts and instructions without losing precision
  • Managing file and tool output size (chunking, truncation, summarization)
  • Retrieval vs. “context stuffing”: when to fetch instead of include everything
  • Using caching and compaction effectively
  • Managing conversation history: summarization and context pruning
  • Trade-offs: minimization vs. accuracy and completeness
  • Monitoring and measuring token usage and cost over time
  • Practical exercise: auditing and optimizing a real prompt or agent workflow
Adapt this course to fit your needs