Skill 3.3.3
Design and implement a strategy for optimizing token usage, including token limits, loop controls, and tool calls
Key Concepts
Token limits include max_output_tokens per call, per-run and per-user budgets and gateway policies such as the API Management token limit policy. Loop controls cap iterations, tool calls and subagent spawns per run and stop on repeated identical actions. Tool call optimization returns only needed fields, paginates large results and avoids exposing more tools than a step needs, because every tool definition consumes input tokens.
Other techniques include prompt caching for stable prefixes, compaction of history, smaller models for simple agents and lower reasoning effort where quality allows. Token usage per agent and per step is measured from trace spans before and after each change.