What problem does it solve? Long-running agents and long conversations hit context window limits, driving up token costs, latency, and quality degradation. This Skill provides a disciplined set of techniques to reduce token usage while preserving task-critical information. ## Core Features & Use Cases - KV-Cache Optimization: Order prompts so stable content forms a reusable prefix, targeting 70%+ cache hit rates and major cost and latency savings. - Observation Masking & Compaction: Replace verbose tool outputs with compact references and summarize context at 70-80% utilization, targeting 50-70% token reduction with minimal quality loss. - Context Partitioning & Budgeting: Split work across sub-agents with isolated contexts and allocate explicit token budgets per context category. - Use Case: A production agent handling multi-hour debugging sessions keeps exceeding its context window. Apply masking to old tool outputs, trigger compaction at 80% utilization, and stabilize the prompt prefix to cut costs in half. ## Quick Start Ask the AI to optimize the context usage of your long-running agent by applying masking, compaction, and cache-friendly prompt ordering.