What problem does it solve? Agent sessions burn tokens through bloated system prompts, unbounded tool output, long conversation histories, and oversized models on simple tasks, driving up API cost and hitting context-window limits. This Skill provides a layered triage workflow that measures where tokens go and applies the matching optimization tactic. ## Core Features & Use Cases - Bucketed measurement: Estimate token share across system prompt, tool definitions, history, tool results, and output using heuristic rules (words × 1.3, chars / 4) or exact count_tokens endpoints. - Layered tactic catalog: Prompt caching with stable prefixes, instruction-file slimming, history compression, observation masking, model routing by complexity, parallel tool calls, and output trimming with depth tiers and stop sequences. - Cross-host translation table: Maps each tactic to concrete commands for Claude Code, Codex CLI, Cursor, Gemini CLI, and Copilot CLI. - Use Case: An agent loop crosses 70% of its context window and costs keep climbing. Run the workflow to find that tool results dominate, mask verbose file reads into re-fetchable references, route routine calls to a cheaper model tier, and verify a 40% per-task token reduction. ## Quick Start Use token-optimization to analyze where my agent session's tokens are going and propose the top changes to cut cost.