context-compression

Compress textual context to fit specified token limits using summarization and pruning techniques.

147|32|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/seb1n/awesome-ai-agent-skills --skill context-compression-seb1n
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/seb1n/awesome-ai-agent-skills/tree/main/context-engineering/context-compression
Command: npx skills add https://github.com/seb1n/awesome-ai-agent-skills --skill context-compression-seb1n

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill tackles the challenge of exceeding token limits in AI models by intelligently reducing the size of input text while preserving crucial information.

Core Features & Use Cases

  • Token Budget Management: Dynamically allocates tokens across multiple context sources.
  • Information Density Scoring: Analyzes and scores text chunks for relevance.
  • Compression Strategies: Supports extractive summarization, abstractive summarization, key-point extraction, and selective pruning.
  • Use Case: Compressing lengthy legal documents or chat histories to fit within an LLM's context window for analysis or summarization.

Quick Start

Compress the provided document excerpt to fit within a 4000 token budget using abstractive summarization.

Frequently Asked Questions about context-compression

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress lengthy documents to fit within LLM token limits?

To compress text within token limits, the Skill utilizes extractive summarization, abstractive summarization, key-point extraction, and selective pruning. It analyzes information density and validates retention to ensure critical context is preserved for AI tasks.

What is the best way to reduce chat history context for prompt engineering?

The best way to reduce chat history context is by applying selective pruning and key-point extraction. The Skill scores information density across text chunks, dynamically allocates token budgets, and prunes low-relevance sections to preserve essential conversational context.

Does context compression work with abstractive summarization for legal documents?

Yes, context compression supports abstractive summarization for lengthy legal documents. It shrinks textual context to fit specified token budgets while validating information retention, ensuring crucial legal details are preserved for AI analysis.

How do I manage token budgets across multiple context sources for information retrieval?

You manage token budgets by dynamically allocating tokens across multiple context sources. The Skill analyzes information density, scores text chunks for relevance, and applies compression strategies to prioritize the most critical data for LLM retrieval.

When should I use extractive summarization instead of selective pruning for LLM context?

Use extractive summarization to pull direct key sentences from text, whereas selective pruning removes low-density chunks entirely. The Skill selects between these compression strategies based on information density scoring and the required token budget constraints.