context-compression

Compress LLM conversational context using iterative summarization and opaque compression.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/CxxxxDxxxF/project-blackout --skill context-compression-cxxxxdxxxf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compression
Source: https://github.com/CxxxxDxxxF/project-blackout/tree/main/Agent-Skills-for-Context-Engineering/skills/context-compression
Command: npx skills add https://github.com/CxxxxDxxxF/project-blackout --skill context-compression-cxxxxdxxxf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires json, re, dataclasses, enum, typing, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of managing large amounts of conversational history in AI agent sessions, preventing context window limits and ensuring efficient token usage without sacrificing critical information.

Core Features & Use Cases

  • Context Compression Strategies: Implements various methods like Anchored Iterative Summarization and Opaque Compression to reduce token count.
  • Tokens-Per-Task Optimization: Focuses on minimizing total tokens consumed per task, not just per request, by avoiding costly re-fetching of lost information.
  • Use Case: For long-running coding sessions where thousands of messages accumulate, this Skill compresses the history, allowing the agent to maintain focus and recall past decisions and file modifications without exceeding token limits.

Quick Start

Use the context-compression skill to summarize the last 50 messages in the current conversation.

Frequently Asked Questions about context-compression

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

FAQPage Schema
How do I optimize LLM context for long-running agent sessions?

You can optimize LLM context by applying advanced compression techniques like anchored iterative summarization to manage conversational history. This reduces token count while preserving critical past decisions and file modifications needed for long-running coding sessions.

What is anchored iterative summarization for token optimization?

Anchored iterative summarization is a context compression strategy that progressively reduces token count in large codebases. It maintains focus by retaining essential historical anchors while compressing thousands of accumulated messages into a manageable context window.

How do I evaluate LLM context compression quality using probes?

You evaluate LLM context compression quality by applying probe-based methods and detailed rubrics. This process assesses whether the opaque compression or regenerative full summaries successfully retained critical information without sacrificing task efficiency.

Can I compress thousands of messages without losing critical file modifications?

Yes, you can compress thousands of messages without losing critical file modifications by using regenerative full summaries and opaque compression. These strategies focus on minimizing total tokens consumed per task while avoiding the costly re-fetching of lost information.

Does minimizing tokens-per-task prevent context window limits during coding?

Minimizing tokens-per-task prevents context window limits by reducing the overall token consumption throughout an entire session. By avoiding the need to re-fetch lost information, it ensures the agent maintains focus and operates efficiently across large codebases.

What are the limitations of opaque compression for agent memory management?

A limitation of opaque compression for agent memory management is the potential loss of granular conversational details. To mitigate this, compression quality must be strictly evaluated using probe-based methods and detailed rubrics to ensure critical information remains intact.