Compresses context to fit within model token limits while preserving the most critical information for the task at hand.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Context compression is the process of reducing the size of textual context provided to a language model while retaining the information most essential to the task. As conversations grow longer and retrieved documents grow larger, compression becomes critical for staying within token limits and keeping inference costs manageable without sacrificing answer quality.
Workflow
Measure the Token Budget: Determine the model's total context window and subtract the tokens reserved for instructions and output.
Score Information Density: Analyze raw context and assign density scores based on task-relevant facts.
Select a Compression Strategy: Choose between extractive/abstractive summarization, key-point extraction, or selective pruning.
Apply Compression: Execute the chosen strategy.
Validate Information Retention: Ensure no critical facts (entities, numbers, conclusions) were lost.
Assemble the Final Context: Insert the compressed text into the prompt.
Techniques
Extractive Summarization: Selects top-n important sentences verbatim. Best for precision.