What problem does it solve? Long-running agents and large conversations exhaust limited context windows, driving up token costs, latency, and quality degradation. This Skill provides concrete techniques and utilities to extend effective context capacity without larger models. ## Core Features & Use Cases - Four Optimization Strategies: Apply KV-cache optimization, observation masking, compaction, and context partitioning in a prioritized order with measurable performance targets. - Utility Script: Use scripts/compaction.py for token estimation, category-aware summarization, observation masking with retrievable references, budget tracking, and cache metrics. - Decision Framework: Select the right optimization based on what dominates your context (tool outputs, documents, or message history) using threshold-based triggers at 70-80% utilization. - Use Case: An agent processing dozens of tool calls sees context utilization hit 80%. Use this Skill to mask stale tool outputs, compact old turns, and restructure prompts for cache hits, cutting token costs by over 50%. ## Quick Start Ask the AI to optimize the current agent's context usage by masking old tool outputs and compacting conversation history before the window limit is reached.